HP 3000 Manuals

MODIFY [ HP RPG/XL Utilities-Part 2 RISE ] MPE/iX 5.0 Documentation


HP RPG/XL Utilities-Part 2 RISE

MODIFY 

MODIFY enables you to modify lines interactively.

Form 

         M[ODIFY] [lb[/le]] [^^]

Parameter Explanation 

lb               Single line or first line of range you wish to modify.

le               Last line of range you intend to modify.

^^               Displays the line or lines for modification with the
                 corresponding RPG Record Specification form.

Purpose 

The MODIFY command is your means of modifying lines interactively.  It
operates similarly to the same command in EDIT/3000.  The line which is
selected for modification is displayed at the terminal.  You modify the
line by positioning the cursor beneath the first, or only, character you
wish to modify Three subcommands operate with MODIFY. They are insert
(I), replace (R), and delete (D).

Related Commands 

Insert ("I") Subcommand 

"Istring" will insert a character or string.  You position the cursor
beneath the position where you wish the insertion to begin.  You type an
"I" immediately followed by the "string" to be inserted.

Replace ("R") Subcommand 

"Rstring" will replace the characters in the line marked "R" by your new
"string".  Again, you position the cursor beneath the first character you
wish to replace before typing "Rstring".

Delete ("D") Subcommand 

To delete a character or string of characters, type "D" beneath the first
character to be deleted.  A range of "D"'s will remove the string between
the first and last "D".  If there is more than one "D" used in modifying
a single line, all characters between the leftmost and rightmost "D" will
be deleted.

You can use "I" (insert) and "R" (replace) with a "D" or range of "D"'s.
If only one "D" is used, followed by an "I" or "R", the second "D" is
inferred to be the last character before the "I" or "R".  If more than
one "D" is used, the characters between the first and last will be
deleted, and the second subcommand will be executed as usual at the
character marked by the "I" or "R".

Undesignated Subcommand 

When you use the MODIFY command, the line designated appears on the
screen.  If you do not indicate the subcommand you are using (D, I, or
R), whatever is typed beneath the line to be modified will replace the
character or characters directly above unless blanks alone are typed.  In
other words, R(eplace) is the default subcommand.

Leaving MODIFY 

If you specify a range of lines to be modified and wish to leave the mode
before going through the full range, type double slash (//) at the
beginning of the next line.  When you are modifying a single line, press
the carriage return at the beginning of a new line after the source line
appears on the screen in the form desired.

Control Y 

If you do not wish to make the modifications you originally thought were
necessary, type <Control Y> before you press the carriage return at the
start of a new line.  (Pressing the carriage return at the start of a new
line means leaving modification mode for this line and permanently
storing the newly modified line.)  RISE will respond with the message
"Restore Record", and the changes will not be made.

The UNDELete command does not work with deletions made in the the MODIFY
mode.

 *  Execution mode:  Line.

 *  Record pointer:  At last line modified.

Examples 

The following are legal abbreviations which may be used with the MODIFY
command and its parameters:

M */LAST^^       Modify lines from the current position of the record
                 pointer to the last line and display the corresponding
                 RPG Record Specification form.

M LAST           Modify the last line of the file.

M ^^             Modify line at the current position of the record
                 pointer and display the corresponding RPG Record
                 Specification form.

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

     (6)   2      00012FINFILES  IP  F         80               DISK
                 :                                              TAPE

In the next example, the delete (D) subcommand is used in conjunction
with the insert (1) subcommand with the result that "MAGTAPE" replaces
"TAPE" in the line (1).  The next example demonstrates how all characters
between the two outside D's used in the delete subcommand are removed
upon execution of the subcommand (2).  Again a <Control Y> is used to
restore the characters erroneously deleted (3).  Finally, the delete and
insert subcommands are again used together, and the results are shown
(4).

     (1)   2      00012FINFILES  IP  F         80               TAPE
                 :                                              D  DIMAGTAPE
     (2)   2      00012FINFILES  IP  F         80               MAGTAPE
                 :D DDD                       D

     (3)   2      80             MAGTAPE
                 :<Control Y>   Restore Record.

     (4)   2      00012FINPUT    IP  F        72                DISK
                 :DDDDDI12345
           2      12345FINPUT    IP  F        72                DISK
                 :
          >

In the final example of the MODIFY command, MODIFY ALL is entered with
the additional parameter calling for the record specification form
corresponding to the line being modified (1).  The first line, then, is
shown beneath the Header Specification form (2).  It is modified by
spacing over and typing a "B" as shown under the form (2).  After typing
the "B", the user hits the carriage return, and RISE re-displays the
modified line (3).  Lines 2 and 3 are then displayed under the RPG
Specification form (4) (5).  A double slash (//) entered at the beginning
of line 3 ends the modification mode (6).

      (1) >MODIFY ALL ^^

[]


MPE/iX 5.0 Documentation