Tags

, , , ,

SORT – SET RETURN CODE ’04’ IF OUTPUT FILE IS EMPTY

We can make use of SORT to set a RC of ‘0004’, if the output file of the sort operation is empty. Based on his return code, we can run the next steps.

//STEP01 EXEC PGM=SORT,PARM=’NULLOUT=RC4′

//SYSPRINT DD SYSOUT=*

//SYSOUT DD SYSOUT=*

//SORTJNF1 DD DSN=INPUT.FILE.ONE,DISP=SHR

//SORTJNF2 DD DSN=INPUT.FILE.TWO,DISP=SHR

//SORTOUT DD DSN=OUTPUT.FILE,

// DISP=(NEW,CATLG,DELETE),

// SPACE=(CYL,(100,200),RLSE),

// DCB=(RECFM=FB,BLKSIZE=0,LRECL=80)

//SYSIN DD *

SORT FIELDS=COPY

JOINKEYS FILES=F1,FIELDS=(1,10,A)

JOINKEYS FILES=F2,FIELDS=(1,10,A)

REFORMAT FIELDS=(F1:1,71,F2:1,9)

/*

 

 

You might also like to look at:

 

 

SORT – CONVERT PD to ZD and BI to ZD
SORT – EDIT FIRST AND LAST RECORD
SORT – EDIT MASK PATTERNS
SORT – EDIT NUMERIC FIELDS (I,T,S)
SORT – FINDREP, IFTHEN and INREC
SORT – How to use VB dataset (VLSHRT)
SORT – INCLUDE and OMIT
SORT – INREC, INCLUDE and OMIT
SORT – JUSTIFY, SQUEEZE and OVERLAY
SORT – LOOKUP AND CHANGE
SORT – OUTPUT DATASET DCB (LRECL,RECFM,BLKSIZE)
SORT – OUTREC – INSERT ZEROES, BLANKS, STRINGS
SORT – OUTREC – TRAN
SORT – PARSE – REFORMAT VARIABLE FIELDS
SORT – Process Order of CONTROL Statements
SORT – REMOVE DUPLICATES AND WRITE THEM TO XSUM
SORT – SET RETURN CODE ‘04’ IF OUTPUT FILE IS EMPTY
SORT – SKIPREC and STOPAFT
SORT – SUM FIELDS
SORT – TO REPLACE A CHAR WITH ANOTHER CHAR – ALTSEQ
SORT – INREC
SORT – SYMBOLS
SORT JOB – SIMPLE COPY
SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
SORT JOIN – UNPAIRED RECORDS INDICATOR


Advertisements