DFSORT OUTFIL Converting VB to FB

DFSORT OUTFIL: Converting FB to VB DFSORT Joining records

Advertisements


VB data set can be converted to an FB data set with OUTFIL's VTOF and BUILDor OUTREC parameters.

All of the PARSE, BUILD, or OUTREC features are available with OUTFIL's VTOF.

DFSORT does not include the RDW in theFB output records.


Syntax:

OUTFIL FNAMES=DDNAMEn, VTOF

Name Description
DDNAMEnDDNAME is eight character’s name that representing the actual dataset in JCL.
VTOF Specifies convert from VB to FB

Note: OVERLAY, FINDREP, or IFTHEN cannot specify with VTOF.


Example: -

Create FB file from VB file.


Input File: MTHUSER.SORT.INPUT02 - VB file of 100 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 ********************************

Job:

000100 //Jobcard 
000400 //*                                                                     
000500 //**********************************************************************
000600 //*                                                                     
001100 //STEP01   EXEC PGM=SORT                                                
001300 //SORTIN   DD DSN=MTHUSER.SORT.INPUT02,DISP=SHR                    
001801 //FBOUTP   DD DSN=MTHUSER.SORT.OUTPT02,                            
001802 //             SPACE=(CYL,(1,1),RLSE),                                  
001803 //             DISP=(NEW,CATLG,DELETE)                                  
001810 //SYSOUT   DD SYSOUT=*                                                  
002410 //SYSIN    DD *                                                         
002411      OPTION COPY                                                        
002420      OUTFIL FNAMES=FBOUTP,VTOF,OUTREC=(5,80)                            
003500 /*                                                                      
****** **************************** Bottom of Data ****************************

Output File: MTHUSER.SORT.OUTPT02 - FB file of length 80

----+----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 Solution:

  1. OUTFIL FNAMES=FBOUTP,.. - Specifies the output is Fixed block file.

  2. OUTFIL FNAMES=..,VTOF,.. - Specifies the conversion is Variable to Fixed.

  3. OUTFIL FNAMES=..,OUTREC=(5,80) - Copies from 5th to 80th byte of the input file to output file.

DFSORT OUTFIL: Converting FB to VB DFSORT Joining records

Advertisements