MPE/iX Commands Reference Manual (32650-90877)

382 Chapter10
Command List VIII
Commands PASCAL thru PURGEUSER
then streamed as a second job.
Use
This command is available in a session, job, program, or in BREAK. Pressing Break aborts
the execution of this command.
Examples
To send the contents of MYFILE to the line printer, enter the following commands:
FILE XXX;DEV=LP
PRINT MYFILE, *XXX
In this example, the file XXX is equated with the line printer. Then the file MYFILE is
"printed" to the file *XXX.
Use EDIT/V to create the command file TAIL which prints the last 10 lines of a file:
PARM FILE, LAST=10
PRINT !FILE; START = -!LAST
The first line defines FILE as a required parameter of the command file and creates an
optional parameter, LAST the default value of which is 10.
The second line instructs the PRINT command to print the dereferenced
value
of FILE (the
value entered by the user). The second line also tells the command to use the negative of
the dereferenced value of LAST (10 by default) as the starting point for printing (that is, 10
records from the end).
To print the last 10 records of the file called MYFILE, enter:
TAIL MYFILE
To print the last 45 records of MYFILE, because entering the value 45 overrides the default
value of 10, enter:
TAIL MYFILE, 45
NOTE
The PRINT command itself can be used to create a file:
PRINT $STDIN,TAILB
PARM FILE, LAST=5
PRINT !FILE; START = -!LAST
:EOD
SAVE TAILB
The SAVE command is used to make the file TAILB permanent since the
default is temporary.
PRINT infile;NUM;NONUM
would print the line numbers as in the case of UNNUMbered files, ie, line numbers
starting from 1 for the first record and so on.
PRINT infile;UNN;NONUM