You can convert an FB data set to a VB data set with OUTFIL’s FTOV parameter. Each VB output record has a 4-byte RDW followed by the corresponding data from the FB input record, and the length in the RDW is the length of the FB record plus 4. The following JCL and DFSORT control statements convert the bookstore data set records from FB to VB. This parameter converts fixed-length input records to variable-length output records. FTOV can be used both with and without the OUTREC parameter. When FTOV is used with the OUTREC parameter, the variable-length record is created from the specified fields of the fixed-length record. When FTOV is not used with the OUTREC parameter, the variable-length record is created from the whole fixed-length record.
Notes: FTOV cannot be used with IFTRAIL, CONVERT, or VTOF. If the input record is variable-length, FTOV, if specified, will be ignored. It can be used with the VLTRIM parameter to delete pad bytes at the end of a record.
//STEP01 EXEC PGM=SORT //SORTIN DD DSN=INPUT.FB.FILE,DISP=SHR //SORTOF01 DD DSN=OUTPUT.VB.FILE, // DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA, // DCB=(LRECL=80,RECFM=VB,BLKSIZE=84), // SPACE=(TRK,(3000,2000),RLSE) //SYSIN DD * SORT FIELDS=COPY OUTFIL FNAMES=SORTOF01,FTOV //*
It is not essential to give BUILD or OUTREC parameter when FTOV parameter is used. You can also use PARSE, BUILD, OUTREC, OVERLAY, FINDREP, or IFTHEN parameters with FTOV on the OUTFIL statement. All of the reformatting features are available (input fields, strings, editing, and so on). With FTOV, you specify the input positions, and output columns as you would for an FB record (without the RDW). DFSORT adds the RDW after the FB record is reformatted.
Here is an example of using FTOV with BUILD:
OUTFIL FTOV,BUILD=(1:120,25,32:C’in ‘,110,5)
The VB output records look like this:
Positions 1-2: Length (in RDW) = hex 002B = 43
Positions 3-4: Zeros (in RDW) = hex 0000 = 0
Positions 5-29: Input positions 120-144
Positions 30-35: Blanks
Positions 36-38: ‘in ‘
Positions 39-43: Input positions 110-114
Each VB output record is 43 bytes long and the output data set is given an LRECL of 43.
For the previous examples, the VB output records are all the same length. You can use OUTFIL’S VLTRIM parameter to create VB output records of different lengths from FB input records. Suppose you have an FB input data set with LRECL=20 and 20-byte records like this:
ABC ABCDEF AC ABCDEFGHI
These statements change each 20-byte FB input record to a 24-byte VB output record and set LRECL=24 for the VB output data set:
OPTION COPY
OUTFIL FTOV
The VB output records look like this:
Length X’0000′ Data
1 2 3 4 5 24
24 0 ABC 24 0 ABCDEF 24 0 AC 24 0 ABCDEFGHI
To remove the trailing blanks from the end of each VB output record, use VLTRIM=C’ ‘ (or VLTRIM=X’40’) like this:
OUTFIL FTOV,VLTRIM=C’ ‘
LRECL=24 is still set for the resulting VB output data set, indicating that the maximum record length is 24, but the VB output records are not padded on the right with blanks; they now have different records lengths like this.
Length X’0000′ Data
1 2 3 4 5 24
7 0 ABC 10 0 ABCDEF 6 0 AC 13 0 ABCDEFGHI
You can use any character or hexadecimal byte value for VLTRIM. For example, VLTRIM=C’*’ removes trailing asterisks, and VLTRIM=X’00’ removes trailing binary zeros.
A well-maintained product backlog is crucial for successful product development. It serves as a single…
Incremental value to the customer refers to the gradual delivery of small, functional parts of…
A Product Market refers to the group of potential customers who might be interested in…
The Professional Agile Leadership - Evidence-Based Management (PAL-EBM) certification offered by Scrum.org is designed for…
The Professional Agile Leadership (PAL I) certification, offered by Scrum.org, is designed to equip leaders…
Choosing the right Scrum Master Certification depends on your current experience and career goals. If…