Download SELCOPY Manual

Transcript
Operation Words, Parameters and Keywords
LRECL (2. as an Operation Word)
LRECL = n AT p TYPE x
This will cause n bytes starting at position p of the work area to be evaluated as a numeric value and used to set value of the
length of the current logical input record.
The TYPE argument, (default TYPE=P), may be B, C or P, which indicates Binary, Character or Packed Decimal for the data type
of the 'n' bytes.
Use of TYPE=C obeys the same rules as the CVCP (PACK) operation for obtaining the numeric portion of the 'n' bytes of
Character data. e.g.
READ CARD
W 2000
LRECL = 4 AT 1 TYPE=C
* Set LRECL from 4 bytes of char data.
WRITE XYZ
RECFM=V
B=4096
END
* Data records follow.
0450 This is a data record, len 80. LRECL written to XYZ will be 450.
0033 This data record, len 80, will get written to XYZ length 33.
Example 9 in section Examples sophisticates this technique.
Illegal Settings
1. a value based on invalid data for conversion. e.g. TYPE omitted, so packed decimal conversion used, but binary or
character was required.
2. a value greater than the original record length, unless WORKLEN parameter used. So, without a WORKLEN, you are
able to decrease LRECL, but you are not able to increase it above its original value.
3. a value greater than WORKLEN.
4. a value based on an @ pointer if it points outside the work area or input record, or has no setting. (i.e if the last range test
was unsuccessful).
5. a value less than 1 (i.e. zero or negative) for SELCOPY on mainframe platforms, and a value less than 0 (i.e. negative)
for SELCOPY on AS/400, UNIX and PC platforms,
In such cases the operation is ignored, Return Code 8 is set, and at end-of-job a total is printed of LRECL modifications ignored.
RECFM=V input
Note that if input is RECFM=V, and RDW is in effect, (RDW is default for mainframe SELCOPY), and LRECL is changed, the
4-byte RDW (Record Descriptor Word) at the start of the input record remains unchanged in the input area. In other words,
SELCOPY has noted the "changed" LRECL, but does not modify any of your data in the input area.
Any RECFM=V output file will have RDW's regenerated from SELCOPY's internal store of the current LRECL value, ignoring the
original input record RDW. (This avoids errors due to inadvertant modification of the RDW by the user.)
NORDW may be set as an installation standard in CBLNAME or SELCNAM, and is recommended.
LRECL (3. as a Parameter for Files)
RECSIZE
L
See also:
• LRECL, POS LRECL and RECFM= in this section.
READ FILE=ABC LRECL=250
WRITE FILE=XYZ LRECL=87 RECFM=V
PRINT L 100
THEN LOG TYPE S LRECL @A+@B
The value n defines the maximum Logical RECord Length permitted for a file. However PRINT and LOG are exceptions to this.
If the RECFM (RECord ForMat) of the file is F (Fixed), then all records are fixed at the same length, i.e. the value n.
If RECFM is omitted, then the explicit LRECL=n coded is taken to imply RECFM=F. To overrule this, RECFM=U or V should also
be coded.
RECFM=V or RECFM=U, variable or undefined, allows the LRECL to vary for individual records within the file, up to the maximum
specified.
The original VSE syntax combining RECFM and LRECL, which results in LRECL taking the default value, is still supported for
both VSE and MVS:
LRECL=V to indicate standard Variable length format.
LRECL=U to indicate Undefined length.
2015-03-03 11:16:07
SELCOPY Manual
118