The @PRINT statement outputs the content of the specified line ranges or string variables. In interactive mode, the output is written to SYSOUT
and in batch mode it is written to SYSLST
.
For the sake of simplicity, the operand description refers primarily to lines and line ranges. However, the descriptions apply equally to string variables and ranges of string variables unless explicitly indicated to the contrary.
Operation | Operands | F mode, L mode |
[ { lines | svars } [:cols[:] ] [X] [N] [S] [ {V | E} ] ] [,...] |
lines svars cols | Line range that is to be output. Range of string variables whose content is to be output. Column range in the work file or in the string variables that is to be output. If only one column number is specified then the remainder of the line is If no column range is specified then the entire line or string variable is output |
X | The format of the output is hexadecimal. Between two and eight |
N S | Removes the line numbers or string variable names from the output. If the output is sent to |
V, E | In interactive mode, the operands These operands are only meaningful when working at the screen and are If In contrast, if If another range has been specified with the If neither |
If no operand is specified then the entire current work file is output one section at a time (in the same way as if E
is specified).
The content of the specified line range is output line-by-line with or without a prefixed line number (see the N
operand). If SYSOUT
is assigned to a terminal in interactive mode then the individual lines are separated from one another by [LZE] (logical end-of-line).
It is possible to specify multiple ranges with different output options provided that these are separated by commas. The number of range specifications is only limited by the maximum permitted length of EDT statements.
If the statement is interrupted with [K2] and the EDT session is continued with /INFORM-PROGRAM
then the processing of the statement is aborted and message EDT5501
is output.
In the case of section-by-section output in interactive mode, EDT prompts the user to enter a scrolling instruction after outputting a section (section of a file or sequence of string variables). This enables the user to interrupt output or move to a required position. In this case, it is also possible to exit the range defined with lines
or svars
. The following scrolling instructions are possible:
[DUE] | Void input on scrolling causes EDT to go to the next section of the output (i.e. the section immediately following the last one output). In |
* | Switches to E mode and resets the current range (if it has been changed) to the range specified in the statement.EDT then moves on to the next section of the output (i.e. the section immediately following the last one that was output) unless the last line that was output is the last line of the specified range or already exceeds the specified range (possible if + has been entered). In this case, EDT moves on to the next specified range or terminates output. |
+ | Switches to The section which immediately follows the last one output is then output. |
+n | Switches to |
- | Irrespective of the specifications in the |
–n | Irrespective of the specifications in the |
0 | Terminates the output of the current range. If more than one range was |
If in the case of section-by-section output, a long line no longer fits on the screen then the section is terminated before this line (if it already contains lines) even if the screen has not been filled. If the very first line is longer than the screen permits then this line is output as a separate section. Output of the line in interactive mode is only interrupted if the operating system's overflow monitoring is active.
All output is converted from the character set used by the work file or string variable into the character set defined for SYSOUT
or SYSLST
.
If characters are found which do not correspond to a valid character in the target character set then these are replaced by a substitute character if such a character has been specified (see @PAR SUBSTITUTION-CHARACTER). Otherwise blanks are used.
A line feed is inserted in the output after every 132 characters (or 160 characters if job switch 6 is set) when outputting to SYSLST
. Output to SYSOUT
is wrapped as specified in the WROUT
or WRTRD
macros. However, line feeds always occur at a character boundary.
Note
Unlike in compatibility mode, the entry of a command in response to the scroll prompt is always rejected and the request to enter a scrolling instruction is issued again. To enter a command, it is therefore first necessary to terminate @PRINT by entering 0
.
In interactive mode, the output from the @PRINT statement is generated by WROUT
or WRTRD
and, in the case of @PRINT...E, both together. There may therefore be little point in redirecting SYSOUT
to a file, in particular in view of the problems relating to character sets as described in the section “System files”.