Sunday, June 10, 2007

SORT

TIP # 079
SORT

Do you know COBOL Internal SORT and MERGE is actually done by DFSORT ?!!
If you SORT or MERGE with COBOL, the compiler automatically generates a SORT or
MERGE control statement for you with the correct DFSORT descriptions for the COBOL fields
you specify.

TIP # 080
SORT

How can I replace all the low-values in a file to spaces??
Use ALTSEQ CODE .
Here's an example of how you could change all low values (X'00') to spaces (X'40'), in an FB
data set with an LRECL of 80:
ALTSEQ CODE=(0040)
OUTREC FIELDS=(1,80,TRAN=ALTSEQ)
(Source: IBM SORT website)

TIP # 081
SORT

SYNCSORT
My Production job is such that, on one of the steps it has to
copy a VSAM dataset to flat file, and then process that flat
file in the subsequent steps. Sometimes the input VSAM may be
empty. When its empty, my job abends. How can I prevent the job
from abending when the VSAM is empty ?
Pass the parameter, VSAMEMT=YES for the SORT utility.
i.e,
//STEP3 EXEC PGM=SORT,PARM=’VSAMEMT=YES’
//*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=VSAM.DSN
// DISP=SHR
//SORTOUT DD DSN=FLATFILE.DSN
// DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*

No comments: