Category: SORT

SORT Card to Convert FB to VB and VB to FB

Converting VB file to FB or FB file to VB format is a common requirement. JCL SORT utility has the FTOV & VTOF options to convert the datasets as reuired. Converting from FB to VB //STEP1 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //SORTIN DD DSN=MHY.TEST.SORTIN,DISP=SHR //SORTOT DD DSN=MHY.TEST.VB.OUT,DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(CYL,(10,5),RLSE) Notes: No need to give any

SORT card to add header and trailer with date & Counts

This SORT example is to add Header and Trailer to the sorted file along with the total number of records. Header –> A Name along with the current System date Trailer–> A static message along with number of input records count Example Sort Card: //JOBRPT09 JOB MSGLEVEL=(1,1),MSGCLASS=X //********************************************************************** //* ADDING HEADER AND TRAILER ALONG WITH

JCL to reverse the file records

JCL Trick to write the output file in reverse order of input using SORT. If the input file has some records in Random order ( not in sorted order) and if the out file needs to be written exactly in reverse order. This can be achieved by using the SORT Overlay along with OUTREC BUild.
Close Bitnami banner