Wednesday, June 13, 2012

Convert VB to FB

Converting variable block to fixed block file is often necessary in Mainframe. If the VB file has LRECL = n, the corresponding FB file record length will be n-4 as the first 4 bytes of VB file is used for Record Descriptor Word (RDW) containing the integer length of the record in bytes.


Following JCL step shows how to convert VB file to FB.  Let us assume the VB file's  LRECL is 84 here.

//STEP01   EXEC PGM=SORT                                           
//*                                                                
//SYSOUT  DD SYSOUT=*                                              
//SORTIN  DD DISP=SHR,DSN=N1234.VBFILE.EXMPL
//FBOUT   DD DSN=N1234.FBFILE.EXMPL,         
//          DISP=(NEW,CATLG,DELETE),                               
//          DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),                    
//          SPACE=(CYL,(10,5),RLSE)                                 
//SYSIN  DD    *                                                   
  OPTION COPY                                                      
  OUTFIL FNAMES=FBOUT,VTOF,OUTREC=(5,80)                          
/*                                                                 
//SYSPRINT DD SYSOUT=*                                             
//*                                                                

No comments:

Post a Comment