OUTFIL Converting FB to VB
OUTFIL Converting FB to VB Example
Scenario - Create VB file from FB file.
Input File - MATEPK.SORT.INPUT01 - FB file of 80 length
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 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
JCL -
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
//MATEPKD JOB (123),'MTH',NOTIFY=&SYSUID
//*
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=MATEPK.SORT.INPUT01,DISP=SHR
//VBOUTP DD DSN=MATEPK.SORT.OUTPT01,
// SPACE=(CYL,(1,1),RLSE),
// DISP=(NEW,CATLG,DELETE)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=VBOUTP,FTOV
/*
Output File - MATEPK.SORT.OUTPT01 - VB file
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 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
Explaining Example -
OUTFIL FNAMES=VBOUTP,FTOV - Specifies the output is VB, and FTOV specifies that the conversion is Fixed to Variable.