DFSORT OUTFIL Converting FB to VB

DFSORT OUTFIL: Updating counts and totals in trailer DFSORT OUTFIL: Converting VB to FB

Advertisements


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

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

DFSORT adds the RDW after the FB record is reformatted.


Example: -

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 ********************************

Job:

000100 //Jobcard 
000400 //*                                                                     
000500 //**********************************************************************
000600 //*                                                                     
001100 //STEP01   EXEC PGM=SORT                                                
001300 //SORTIN   DD DSN=MTHUSER.SORT.INPUT01,DISP=SHR                    
001801 //VBOUTP   DD DSN=MTHUSER.SORT.OUTPT01,                            
001802 //             SPACE=(CYL,(1,1),RLSE),                                  
001803 //             DISP=(NEW,CATLG,DELETE)                                  
001810 //SYSOUT   DD SYSOUT=*                                                  
002410 //SYSIN    DD *                                                         
002411      OPTION COPY                                                        
002420      OUTFIL FNAMES=VBOUTP,FTOV                                          
003500 /*                                                                      
****** **************************** 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 Solution:

OUTFIL FNAMES=VBOUTP,FTOV - VBOUTP specifies the output is VB,FTOV specifies that the conversion is Fixed to Variable.


DFSORT OUTFIL: Updating counts and totals in trailer DFSORT OUTFIL: Converting VB to FB

Advertisements