SORT FIELDS=COPY
OUTFIL FNAMES=VAROUT1,FTOV
OUTFIL FNAMES=VAROUT2,FTOV,
OUTREC=(20,8,35,10)
OUTFIL FNAMES=VAROUT3,FTOV,VLTRIM=X'40'
This example illustrates several ways to convert a fixed-length
record data set to a variable-length record data set using the FTOV
parameter of OUTFIL.
The input data set has an RECFM=FB and LRECL=60.
- The first OUTFIL statement converts the fixed-length input data
set to a variable-length OUTFIL data set associated with ddname VAROUT1.
VAROUT1 will have RECFM=VB and LRECL=64. All of its records will be
64 bytes long (4-byte RDW plus 60-byte input record).
- The second OUTFIL statement converts the fixed-length input data
set to a variable-length OUTFIL data set associated with ddname VAROUT2.
OUTREC is used to select two input fields for the output records,
bytes 20-27 and bytes 35-44. VAROUT2 will have RECFM=VB and LRECL=22.
All of its records will be 22 bytes long (4-byte RDW plus 8-byte input
field plus 10-byte input field).
- The third OUTFIL statement converts the fixed-length input data
set to a variable-length OUTFIL data set associated with ddname VAROUT3.
VAROUT3 will have RECFM=VB and LRECL=64. VLTRIM=X'40' is used to remove
the trailing blanks from the variable-length output records. The records
can vary from 5 bytes long to 64 bytes long depending on the number
of trailing blanks in each record.