HP 3000 Manuals

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


HP RPG/XL Utilities-Part 2 RISE

LIST 

LIST prints the work file on the screen or on the line printer.

Form 

         L[IST] [lb[/le]] [O[FF]]

Parameter explanation 

lb               First or only line you want to have displayed.

le               Last line of a range you want displayed on the screen.

O[FF]            Print offline on a line printer with the formal file
                 name of "RISELIST" and device class of "LP".

Purpose 

The LIST command prints all or a portion of the work file on the screen
or line printer.  If you do not specify a line or lines for listing, only
the line following the current position of the record pointer is listed.
You specify the "OFF" parameter to list offline to a line printer.

Related Command 

The PRINT command will also list lines offline on a line printer.  PRINT
has an additional feature:  whenever the RPG form type in column 6
changes, it skips three lines so that your listing is in a more readable
form.  The PRINT command will also print offline the compilation listing
produced by a V[ERIFY] R[PG] command.

 *  Execution mode:  Line.

 *  Record pointer:  At the last line printed.

 *  Control Y: Halts execution of the command.

EXAMPLES 

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

LIS A            List the complete contents of the work file.

L F/10           List the first through line 10.

L *-5/*+5        List a range of lines beginning five lines before the
                 current position of the record pointer and ending five
                 lines after the record pointer.

L10              List line 10.

L                List the line following the position of the current
                 record pointer.  (Used for stepping through a file, line
                 by line.)

In the first example, TEXT is used to copy SIMCAL into a work file, and
the first five lines are listed on the screen using the LIST command (1).
The LIST command is then used with the asterisk--(*)--which symbolizes
the current position of the record pointer.  The command calls for a
range of ten lines beginning five lines before the current record pointer
position.  Since the previous command left the record pointer at line 5,
when the command is executed, lines 1 through 10 are displayed (2).

When the L[IST] command is used without any parameters, the line
following the current position of the record pointer is listed.  Thus,
lines 11 through 13 are stepped through (3).

     (1)  >T SIMCAL
           Text completed.
          >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     00015I        OR   02   1  CS

     (2)  >L*-5/*+5
              1     00011H
              SIMCAL
              2     00012FINPUT    1P  F       72            DISK
              3     00013FOUTPUT   O   F       72            DISK
              4     00014IINPUT    AA  01   1  CA
              5     00015I        OR   02   1  CS
              6     00016I        OR   03   1  CM
              7     00017I        OR   04   1  CD
              8     000181        OR   05
              9     00019I                            8   72OPRND1
             10     00020I                            9  132OPRND2         99

     (3)     >L
               11     00021C   01       OPRND1     SUB  OPRND2    RESULT  104

             >L
               12     00022C   02       OPRND1     SUB  OPRND2    RESULT
             >L
               13     00023C   03       OPRND1     MULT OPRND2    RESULT

In the second example, LIST is used to bring the last line of the file to
the screen (1).  Next, the special character "@", which has the same
meaning to RISE as the asterisk (*), is used with LIST to display the
five lines preceding the current position of the record pointer--at line
38 after the last command.  Thus, the last five lines of the file are
listed (2).

     (1)  >L LAST
             38      00048O*END OF PROGRAM

     (2)  >L @-5/L
             33      00043O        D 11      1P
             34      00044O       OR        N1P
             35      00045O                           13 "C NNNDD NNNDD"
             36      00046O        D         05
             37      00047O                           15 "INVALID REQUEST"
             38      00048O*END OF PROGRAM

In the next example, an error results when non-existent lines are used
with the LIST command (1).  Following that, LIST is entered with a "line
beginning" which is higher in sequence than the "line ending", and
another error message is shown (2).  Next, the same error is committed
using special characters to indicate the current position of the record
pointer (3).  LIST used with a line number which includes an illegal
decimal value causes another error (4).  Finally, an illegal character
used with the FIRST parameter brings up another error message.

     (1)  >L 100/150
           Error 81: Range is empty.

     (2)  >L 10/5
           Error 62: The TO line cannot be less than the FROM line number.

     (3)  >L @+5/@-5
           Error 62: The TO line cannot be less than the FROM line number.

     (4)  >L 10.0005
                    ^
           Error 74: A maximum of 3 digits is allowed right of decimal.
          >

     (5)  >L FIRST/
           Error 61: Only a '*',line number,FIRST,LAST,ALL allowed in range.
          >



MPE/iX 5.0 Documentation