OUTFIL: Converting FB to VB
OUTFIL: Converting FB to VB
Summary
- FB data set can be converted 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.
- PARSE BUILD, OUTREC, OVERLAY, FINDREP, or IFTHEN parameters can be used with FTOV on the OUTFIL statement.
Syntax -
OUTFIL FNAMES=DDNAMEn, FTOV
DDNAMEn | DDNAME is eight character’s name that representing the actual dataset in JCL. |
FTOV | Specifies convert from FB to VB |
DFSORT adds the RDW after the FB record is reformatted.
Example -
Scenario - Create VB file from FB file.
Input File - MTHUSER.SORT.INPUT01 - FB file of 80 length
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
00001 student1 dept1 560
00003 student3 dept2 520
00004 student4 dept1 540
00005 student5 dept2 500
00002 student2 dept3 510
00006 student6 dept3 550
00008 student8 dept1 530
00007 student7 dept3 510
00009 student9 dept2 520
00010 student10 dept2 505
******************************** Bottom of Data ********************************
JCL -
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
//Job-card
//**********************************************************************
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=MTHUSER.SORT.INPUT01,DISP=SHR
//VBOUTP DD DSN=MTHUSER.SORT.OUTPT01,
// SPACE=(CYL,(1,1),RLSE),
// DISP=(NEW,CATLG,DELETE)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=VBOUTP,FTOV
/*
**************************** Bottom of Data ****************************
Output File - MTHUSER.SORT.OUTPT01 - VB file
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
00001 student1 dept1 560
00003 student3 dept2 520
00004 student4 dept1 540
00005 student5 dept2 500
00002 student2 dept3 510
00006 student6 dept3 550
00008 student8 dept1 530
00007 student7 dept3 510
00009 student9 dept2 520
00010 student10 dept2 505
******************************** Bottom of Data ********************************
Explaining Example -
OUTFIL FNAMES=VBOUTP,FTOV - VBOUTP specifies the output is VB,FTOV specifies that the conversion is Fixed to Variable.