Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

@CHECK (format 2) - Check lines for convertibility

&pagelevel(3)&pagelevel

This format of the @CHECK statement can be used to check whether the specified range in the current work file or range of string variables can be converted into the target character set without loss.

Operation

Operands

F mode, L mode

@CHECK

[ {lines | svars} [,...][:cols[:]]] [,]  CODE = {name | *EDT | *FILE}

 [,MARK[=m]] [,LENGTH = {int |  *FILE} ]

lines

One or more line ranges to be checked. If the specified range contains no
lines or only empty lines then the result of the check is positive (empty lines
can always be written without loss).

svars

cols

One or more ranges of string variables to be checked.

Contiguous column range for checking in the current work file or in the
specified string variables.

If the range specification contains only a single column specification, this
indicates the range from the specified column through to the end of the line.
If the first column specification is greater than the line length then the line or
string variable is ignored.

If no column range is specified then the entire line or string variable is
checked.

CODE=

Specifies, either directly or symbolically, the character set for which the
check is to be performed.

name

Name of the character set for which the check is to be performed. The
specified line range or range of string variables is converted into this
character set for test purposes. Depending on the selected option, faulty
lines are either marked or output to SYSOUT.

*EDT

The character set that is set for the current work file should be used for the
check. Since a work file may not contain any records with characters which
are invalid in the work file's character set, the specification of *EDT is only
of any value if only a check for lines of excess length is to be performed (see
the LENGTH operand).

*FILE

The character set entered in the catalog for the open file or open library
element or which was specified in the CODE operand in the @OPEN
statement is to be used for the check. If no file or library element is open
then the specification of *FILE is rejected with error message EDT5467. If
the character set *NONE is entered for the file then the check is performed
using the character set EDF03IRV.

MARK=

The lines which cannot be converted without loss into the specified
character set should be assigned a record mark. This option is only
permitted if only line ranges in the current work file are to be checked. If
MARK is not specified then the lines or string variables which cannot be
converted without loss are output to SYSOUT.

m

Record mark (1..9) used to mark the lines which cannot be converted
without loss into the specified character set. If m is not specified, record mark
1 is used.

LENGTH=

This specifies a maximum length (in bytes) which may not be exceeded
when the lines or string variables are converted. Since, when conversion is
performed into a Unicode character set, many characters are coded by
multiple bytes, a line may become longer on conversion. Lines or string
variables which exceed the specified maximum length on conversion are
therefore considered to contain an error.

int

*FILE

Explicitly defines a maximum length (1..32768).

The maximum length is calculated from the catalog entry for the open file or
open library element. A value is selected which guarantees that all the
checked records can be copied without loss into the file when all the other
relevant file properties (e.g. the file type and record format) are taken into
account. If no file or library element is open then the value 32768 is used.

If neither lines nor svars is specified then the entire current work file is checked.
A line or string variable is considered to contain an error for the purposes of the check performed by @CHECK if, after conversion, it is either longer than the value specified in LENGTH or if it contains characters which would have to be mapped to any substitute character which may have been specified (see the statement @PAR SUBSTITUTION-CHARACTER) when converted into the specified character set.

If EDT does not identify any such defective lines or string variables or if they are only found to be of excess length (see below) then the user can be certain that a conversion into the specified character set is possible even if no substitute characters have been specified. Otherwise, the user can decide whether to specify a substitute character (if this has not already been done) and accept the resulting loss of information or to modify the relevant lines or string variables in order to permit loss-free conversion.

Lines or string variables which are found to be excessively long are truncated when written to a file, a job variable or an S variable if the checked length is of physical relevance (e.g. in the case of files with a fixed record length). In all cases, truncation is performed at a valid boundary between two characters. The length that is actually written may therefore be a maximum of 3 bytes shorter than the checked length. If truncation is not acceptable, the user must subdivide or shorten the identified lines in a meaningful way.

The function not only marks and/or outputs the lines or string variables in which errors are detected but also issues a message summarizing the result of the check. If only invalid characters are detected, the message EDT5453 is output and if only length overruns are detected, the message EDT5462 is output. If both invalid characters and length overruns occur, the message EDT5456 is output.

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.