HP RPG/iX Utilities Reference Manual (30318-90006)

2- 189
M Modify line at the current position of the record pointer.
MOD AL^^ Modify all the lines and display the corresponding RPG Record Specification form.
The first five lines of SIMCAL are used for these examples. After the lines are listed, MODIFY FIRST is
entered, and a two-character string is replaced using the R subcommand (1). Note that the line selected
for modification is displayed unmodified on the screen initially, and that it is displayed again after the
execution of the subcommand. An effort to use an illegal parameter with MODIFY evokes an error, and
the suitable message is displayed (2).
Line 2 is singled out for a number of modifications. Initially, the word INPUT is deleted. Note that the D's
are placed directly beneath the first and last characters of the string INPUT, and that this is sufficient to
delete the complete word (3). <Control Y> is used to demonstrate a method of restoring an erroneous
deletion (4).
>L 1/5
1 00011H
SIMCAL
2 00012FINPUT IP F 72 DISK
3 00013FOUTPUT O F 72 DISK
4 00014IINPUT AA 01 1 CA
5 000151 OR 02 1 CS
(1) >MOD FIRST
1 00011H
SIMCAL
: R10
1 00010H
SIMCAL
:
(2) >M SECOND
^
Error 61: Only a '*',line number,FIRST,LAST,ALL allowed in range.
(3) >M 2
2 00012FINPUT IP F 72 DISK
: D D
(4) 2 00012F IP F 72 DISK
:<Control Y> Restore Record.
In the next example, the delete subcommand removes a three-character string from the word INPUT (1).
Note that the remainder of the line moves left a corresponding number of spaces (2). Thus, the syntax of
an RPG source program will be affected by modifications which remove characters or insert characters into
records. Next, the string removed by the delete subcommand is replaced by a three character insertion (3).
The replace (R) subcommand is used next (4). Though two more characters are added to the line, they
replace blank spaces, and the syntax of the line is not changed. Replace (R) is used again on the next line
(5). And the word DISK is replaced by TAPE in the line following, although the subcommand is not used.
This is an example of an undesignated subcommand (6).
(1) 2 00012FINPUT IP F 72 DISK
: D D
(2) 2 00012FIN IP F 72 DISK
(3) : IFIL
(4) 2 00012FINFIL IP F 72 DISK
: RES
(5) 2 00012FINFILES IP F 72 DISK
: R80