then only the record 00002500 is deleted. If the file contains
./ D 2500 2800 then all the statements from 2500 through 2800 are deleted from the
source file.
REPLACE Statement: The REPLACE statement allows you to replace one or iore-records-In-the source file. It precedes the new records you want
to add. It is a combination of the DELETE and INSERT statements. For
example, the lines
./ R 38000 38500 PLIST DS OD DC CL8'TYPE' DC CL8" DC CL8'FILE'
DC CL8'Al'
DC 8X'FF' replace existing statements numbered 38000 through 38500 with
lines of code. As with the INSERT statement, new lines
automatically resequenced.
the new
are not Use this statement when you want to place comments in
the update log file. For example, the line:
./ * Changes by John J. programmer
is not processed by the UPDATE command when it creates the new source
file, but it is written into the update log file. SEQUENCING OUTPUT RECORDS The UPDATE command expects source files to have sequence numbers in
columns 73 through 80. If you use the SERIAL subcommand of the editor to sequence your files, the sequence numbers are usually written
in columns 76 through 80; columns 73 through 75 contain a
three-character identifier which is usually the first three characters
of the filename. If you want an eight-character sequence nuaber, you must use the subcommand: serial all
prior to issuing a FILE or SAVE subcommand when you are editing the
file. Or, you can create an UPDATE file with the single record:
./ S and issue the UPDATE command to sequence the file.
If you use the UPDATE command with a file that has been sequenced
using the editor's default values, you must use the NOSEQ8 option.
Otherwise, the UPDATE command cannot process your input file. The
command:
update sample (noseq8
tells UPDATE to use only columns 76 through 80 when it looks for
sequence numbers.
Figure 22 shows the four files involved in simple update, and their
contents.
254 IBM VM/370 CMS User's Guide
The Source File, SA8PLE ISSE8BLE SA8PLE NA8E AGE SAVRET CSECT USING SI8PLE,R12 LR R12,R15 ST R14,SAVRET LINEDIT TEXT='PLEASE ENTER YOUR NA8E' RDTER8 NA8E LINEDIT TEXT='PLEASE ENTER YOUR AGE' RDTER8 IGE LINEDIT TEXT='HI, •••••••••• , YOU JUST TOLD 8E YOU ARE SUB=(CHIR1,NA8E,CHIRA,AGE} ,RENT=NO L R14,SAVRET BR R14
EJECT
DC CL130" DC CL 130' , DC F'O' REGEQU END
The Update File, SAMPLE UPDATE .j * REVISION BY DLC .j R 500 LINED IT TEXT='WHAT"S YOUR NAME1',DOT=NO ./ R 700 1000 LINEDIT TEXT='HI, •••••••••• , ENTER THE DOCNA8El, SUB= (CHARA,n.!E) RDTER8 B18E 8VC DOCFN,BI8E Ll 1,PLIST SVC 202 DC AL4 (ERROR) EQU * ./ I 1200 ERROR BQU * WRTERM 'FILE NOT FOUND' B RETURN ./ D 1500 ./ I 1600 PLIST DS OD DC CL8'TYPE' DOCFN DC CL8' , DC CL8'FILE'
DC CL8'A1'
DC aX'FF' 00000100 00000200 00000300 00000400 00000500 00000600 00000700 00000800 ••••• ',x00000900 00001000 00001100 00001200 00001300 00001400 00001500 00001600 00001700 00001800 51800010 51800020 5A800030 51800040 XS1800050 51800060 S1800070 S1800080 51800090 51800100 5A800110 S1800120 51800130 51800140 51800150 5A800160 SA800170 51800180 51800190 S1800200 51800210 51800220 5A800230 51800240 Figure Updating Source Files with the UPD1TE Command (Part 1 of 2)
Section 13. Programming for the eMS Environment 255
Previous Page Next Page