The JFY subparameter specifies that an input field be processed for left-justification or right-justification for the output record. The JFY subparameter specifies the following basic operations:
-
If left-justification is specified, leading blank characters are eliminated; all remaining characters are shifted left; if necessary, blank characters are introduced to the right to create a fixed-length field.
-
If right-justification is specified, trailing blank characters are eliminated; all remaining characters are shifted right; if necessary, blank characters are introduced to the left to create a fixed-length field.
-
If a variable-length field is requested, all characters are shifted left and trailing blanks are eliminated.
The JFY subparameter also can specify the following options:
-
Introduce new leading and trailing nonblank characters.
-
Eliminate previous leading and trailing nonblank characters.
-
Change the length of the field in the output record.
p,l | Specifies the beginning byte position p and byte length l of the input record’s relevant field. |
%pp | Specifies a fixed-length parsed field. See PARSE Parameter (Optional) for further description. |
SHIFT=LEFT | Specifies left-justification of the input field. Leading blank characters are eliminated; all remaining characters are shifted left; any necessary blanks are introduced on the right side to compensate for the length of the output field. (The default output field length is equal to the input field length.) |
SHIFT=RIGHT |
Specifies right-justification of the input field. Trailing blank characters are eliminated; all remaining characters are shifted right; any necessary blanks are introduced on the left side to compensate for the length of the output field. (The default output field length is equal to the input field length.) |
VL | Specifies that a variable-length field should be produced. The field will be left-justified and trailing blanks will be deleted. The output record must be a variable-length record. The maximum length of the field is determined from the input field length and the lengths of any LEAD and TRAIL strings. Any INREC/OUTREC fields following a VL field cannot specify a starting column number or any of the alignment options (H, F or D for halfword, fullword or doubleword alignment). Also, VL cannot be used with the OVERLAY parameter or the LENGTH subparamter. VL is permitted with fixed-length data and OUTFIL FTOV. It is also permitted with OUTFIL IFTHEN and FTOV, but not with a WHEN=INIT parameter or with a HIT=NEXT parameter when FTOV is used. |
LENGTH=n | Optionally alters the length of the output field to accommodate a change in the total number of characters from the input field. The default output field length is equal to the input field length l. Use LENGTH=n to either extend a field that needs to be larger due to the addition of a leading or trailing string, or to shorten a field from the default length to reduce the number of padding blank characters. LENGTH cannot be specified with the VL subparameter. |
PREBLANK=list |
Optionally specifies nonblank leading or trailing characters to be replaced with blank characters before justification. The characters to be replaced are specified together in a character string constant (C'string') or hexadecimal string constant (X'hh...hh') from 1 to 10 bytes. PREBLANK searches from left to right for leading characters, and from right to left for trailing characters. A blank character is substituted for each individual leading or trailing character that matches any individual PREBLANK string character. The search terminates for each leading and trailing side when the first nonblank character not on the list is encountered. For example, PREBLANK=C'<>' replaces each occurrence of '<' and '>' with a blank character in the leading and trailing characters before justification. |
LEAD=string |
Optionally specifies a character constant (C'string') or hexadecimal constant (X'hh...hh') from 1 to 50 bytes that is placed in the output field immediately left of the first nonblank character in the field. Note that LENGTH=n also may need to be specified to accommodate the additional leading characters. For example, LEAD=C'(' inserts '(' as a leading character in the field. |
TRAIL=string |
Optionally specifies a character constant (C'string') or hexadecimal constant (X'hh...hh') from 1 to 50 bytes that is placed in the output field immediately right of the last nonblank character in the field. Note that LENGTH=n also may need to be specified to accommodate the additional trailing characters. For example, TRAIL=C')' inserts ')' as a trailing character in the field. |
In the example above, the field (11,18) is specified for left-justification for the output record; LENGTH changes the output length to 15 bytes to reduce the output field size; PREBLANK substitutes a blank character for each instance of /, [, ], *, { and } in the leading and trailing characters before justification; LEAD introduces < to the left of the first nonblank character in the justified field; and TRAIL introduces > to the right of the last nonblank character in the justified field.
In the example above, a fixed-length record file is changed to a shorter variable-length record file. The 40-byte field starting in position 5, the 60-byte field starting in position 45 and the 96-byte field starting in position 105 are converted to variable-length fields by removing leading and trailing blanks, and commas separate the fields. Note that FTOV must be specified to create a variable-length record output file.