Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

@PRINT - Print or output line ranges or the content of string variables

&pagelevel(3)&pagelevel

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

@PRINT

[ { 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
output as of this column. If the first column specification is greater than the
line length then the line is not output.

If no column range is specified then the entire line or string variable is output
even if it is empty.

X

The format of the output is hexadecimal. Between two and eight
hexadecimal numbers are output for each character depending on the
character set which has been defined for the work file or string variable.

N

S

Removes the line numbers or string variable names from the output.

If the output is sent to SYSLST then the first line of each range is usually
output with an additional line feed if the output does not start at the
beginning of a page. If S is specified then this empty line is not output. The
operand is only meaningful in batch mode and is ignored in interactive
mode.

V, E

In interactive mode, the operands V and E cause EDT to output the specified
line range one section at a time (depending on the screen size) and possibly
also to give the user the opportunity to enter scrolling statements at the end
of each section (see below). The number of physical lines (screen lines)
present in a section depends on the employed terminal.

These operands are only meaningful when working at the screen and are
ignored in batch mode.

If V is specified (or if a scrolling statement causes a switch to V mode) then
the user is always prompted to enter a scrolling instruction at the end of
each section.
To terminate output or move to the next specified range, the user must enter
0 or change to E mode (see below).

In contrast, if E is specified (or if the user switches to E mode by means of
a scrolling statement) then the user is only prompted to enter a scrolling
statement at the end of a section if this section does not itself contain the
last line of the current range. If the section that is to be output contains the
last line of the current range then the section is output without any scrolling
request if it is not followed by any further ranges or if the following range
does not make use of either the V or the E operand.

If another range has been specified with the V or E operand then the last
section of the current range is joined with the start of the next range to form
a single section. The way EDT behaves at the end of this composite section
is determined by the V or E operands of the next range.

If neither V nor E is specified then the complete range is output. Output in
interactive mode is only interrupted if the operating system's overflow
monitoring (/MODIFY-TERMINAL-OPTIONS OVERFLOW-CONTROL=USER-
ACKNOWLEDGE) is active.
After an interruption of output via %PLEASE ACKNOWLEDGE, the user can
choose [K2] and /RESUME-PROGRAM to abort the output of the line range or
enter any other value to continue the output. Positioning within the line
range is not possible.

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 V mode, if the end of the current range has already been reached then the last line in this
range is output again and the user is once more asked to enter a scrolling instruction.
When the output of a range starts, the current range is always equal to the specified range. However, this can be modified using the scrolling statements + or -.

*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 V mode and the range is set to 0.0001-9999.9999 for lines
and #S01-#S20 for string variables irrespective of the specifications in the
lines or svars operands.

The section which immediately follows the last one output is then output.
When the last line in the work file or the last string variable (#S20) is reached
then entering + again simply causes EDT to output the last line once more
and request a scrolling instruction.

+n

Switches to V mode and the range is set to 0.0001-9999.9999 for lines
and #S01-#S20 for string variables irrespective of the specifications in the
lines or svars operands.
EDT then outputs the section which starts n lines after the last output line in
the work file (the same applies equivalently to string variables). When the
last line in the work file or the last string variable (#S20) is reached then
entering +n again simply causes EDT to output the last line once more and
request a scrolling instruction.

-

Irrespective of the specifications in the lines or svars operands, the range 0.0001-9999.9999 is set for lines and #S01-#S20 is set for string variables (Caution: unlike in the case of +, there is no switch to V mode). The section which immediately precedes the last one output is then output.
When the first line in the work file or the first string variable (#S00) is reached then entering - again simply causes EDT to output the section which starts with the first line once more and request a scrolling instruction.

–n

Irrespective of the specifications in the lines or svars operands, the range
0.0001-9999.9999 is set for lines and #S01-#S20 is set for string
variables (Caution: unlike in the case of +, there is no switch to V mode).
EDT then outputs the section which starts n lines before the first line of the
last section to be output in the work file (the same applies equivalently to
string variables). When the first line in the work file or the first string variable
(#S00) is reached then entering -n again simply causes EDT to output the
section which starts with the first line once more and request a scrolling
instruction.

0

Terminates the output of the current range. If more than one range was
specified for output in the @PRINT statement then EDT moves on to the
next range.

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”.