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 |
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 If the range specification contains only a single column specification, this If no column range is specified then the entire line or string variable is |
CODE= | Specifies, either directly or symbolically, the character set for which the |
name | Name of the character set for which the check is to be performed. The |
*EDT | The character set that is set for the current work file should be used for the |
*FILE | The character set entered in the catalog for the open file or open library |
MARK= | The lines which cannot be converted without loss into the specified |
m | Record mark ( |
LENGTH= | This specifies a maximum length (in bytes) which may not be exceeded |
int *FILE | Explicitly defines a maximum length ( The maximum length is calculated from the catalog entry for the open file or |
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.