SYNCTOOL (and ICETOOL) both provide an option to return various RC without ABEND. But they both do not detect special conditions, as SYNCSORT (and DFSORT) do.
//CHKBTH EXEC PGM=SORT,PARM='MSG=NO'
//* REGION=1536K
//SORTIN DD DSN=PA.TEST.BTR.PA0052.TRANSHDR.INTM.DATA,
// DISP=SHR
//* DD DSN=SWP.BJ#19401.TRANSHDR.BKUP.DATA,
//* DD DSN=PA.TEST.BTR.PA0052.TRANSHDR.BKUP.DFAL,
// DD DSN=PA.TEST.BTR.PA0052.TRANSHDR.BKUP.DATA,
// DISP=OLD
//* STEP01 EXEC PGM=ICETOOL
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//* F1 DD *
//CHECK DD SYSOUT=*
//* UNIT=SYSDA,SPACE=(TRK,(10,10),RLSE),
//* DSN=&&MASTER
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:+1,BI,LENGTH=2))
SORT FIELDS=(75,6,CH,A)
SUM FIELDS=(81,2,BI)
OUTFIL FNAMES=(CHECK),NULLOFL=RC4,REMOVECC,BUILD=(C'GOOD.'),
INCLUDE=(75,6,CH,EQ,C'ENDEDD',AND,81,2,BI,EQ,+2)
OUTFIL FNAMES=(SORTOUT),SAVE,ACCEPT=1,
BUILD=(20:C'**************************************************',/,
20:C'* WARNING WARNING WARNING WARNING WARNING *',/,
20:C'**************************************************',/,
20:C'* *',/,
20:C'* THIS PRODUCTION JOB HAS FAILED BECAUSE EITHER *',/,
20:C'* THE BACKUP HEADER RECORD OR INTERMEDIATE *',/,
20:C'* HEADER RECORD DATASET FOR THIS VENDOR *',/,
20:C'* DOES NOT HAVE AN "ENDEDD" FLAG. THIS MAY MEAN *',/,
20:C'* THAT THERE WAS A PROBLEM IN PREVIOUS *',/,
20:C'* PRODUCTION PROCESSING OR A PROBLEM WITH THE *',/,
20:C'* RJE TRANSMISSION. *',/,
20:C'* PLEASE VERIFY IF THE PREVIOUS PRODUCTION JOB *',/,
20:C'* RAN OKAY. IF SO PLEASE VERIFY THE INTERMEDIATE *',/,
20:C'* HEADER TO SEE WHY IT IS NOT FLAGGED AS ENDEDD. *',/,
20:C'* IF NECESSARY THE TRANSMISSION MIGHT NEED TO *',/,
20:C'* BE REDONE. *',/,
20:C'* CONTACT PRODUCTION PLANNING IF YOU NEED HELP! *',/,
20:C'* *',/,
20:C'**************************************************',/,
20:C'* WARNING WARNING WARNING WARNING WARNING *',/,
20:C'**************************************************')
END
To print 2 errors based on 2 different includes. Here is what I have:
Code:
//CHKHDR EXEC PGM=SORT,COND=(0,NE)
//* REGION=1536K
//*HDRIN DD DSN=SWP.BJ#19401.TRANSHDR.DATA,
//SORTIN DD DSN=PA.TEST.BTR.PA0052.TRANSHDR.DATA,
//* SORTIN DD DSN=PA.TEST.BTR.PA0052.TRANSHDR.DFHR,
// DISP=OLD
//*SYSIN DD DSN=SWP.SAS.CNTL(NULLSTOP),
//* DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//ERROR1 DD SYSOUT=* 6
//ERROR2 DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(COPY)
OUTFIL FNAMES=(ERROR1),NULLOFL=RC4,REMOVECC,BUILD=(C'GOOD.'),
INCLUDE=(3,6,CH,EQ,C'HEADER')
OUTFIL FNAMES=(SORTOUT),SAVE,ACCEPT=1,
BUILD=(20:C'********************************************',/,
20:C'* WARNING WARNING WARNING WARNING *',/,
20:C'********************************************',/,
20:C'* *',/,
20:C'* THE PRIMARY AND/OR BACKUP TRANSMISSION *',/,
20:C'* HEADER RECORD IS INVALID. VERIFY BOTH *',/,
20:C'* BY RUNNING THE TRANSMISSION VERIFICATION*',/,
20:C'* CLIST <<< RJEINPUT >>>. IF HEADER IS *',/,
20:C'* NOT VALID THE ASSOCIATED DATA FILE MAY *',/,
20:C'* ALSO BE INVALID. IF CORRECTIONS CANNOT *',/,
20:C'* BE MADE YOU MUST REMOVE THAT HEADER AND *',/,
20:C'* THE ASSOCIATED TRANSMISSION DATA FILE *',/,
20:C'* FROM THE PRODUCTION JCL PER VENDOR/RJE *',/,
20:C'* PROCEDURES FOR THIS NETWORK. VENDOR *',/,
20:C'* MAY THEN HAVE TO RETRANSMIT THIS DATA. *',/,
20:C'* *',/,
20:C'********************************************',/,
20:C'* WARNING WARNING WARNING WARNING *',/,
20:C'********************************************')
END
OUTFIL FNAMES=(ERROR2),NULLOFL=RC4,REMOVECC,BUILD=(C'GOOD.'),
INCLUDE=(75,6,CH,EQ,C' ')
OUTFIL FNAMES=(SORTOUT),SAVE,ACCEPT=1,
BUILD=(20:C'**********************************************',/,
20:C'** WARNING WARNING WARNING WARNING **',/,
20:C'**********************************************',/,
20:C'* *',/,
20:C'* THE HEADER RECORD FLAG SHOWS AN ERROR *',/,
20:C'* WAS DETECTED BY THE TRANSMISSION PROGRAM *',/,
20:C'* DURING A VENDOR TRANSMISSION. *',/,
20:C'* *',/,
20:C'* THE ERROR HAS NOT BEEN RECONCILED! *',/,
20:C'* *',/,
20:C'* EXECUTE THE TRANSMISSION VERIFICATION *',/,
20:C'* CLIST <<< RJEINPUT >>> TO DETERMINE WHICH *',/,
20:C'* DATASET IS IN ERROR. *',/,
20:C'* *',/,
20:C'* THERE CAN BE MORE THAN ONE IN ERROR! *',/,
20:C'**********************************************',/,
20:C'** WARNING WARNING WARNING WARNING **',/,
20:C'**********************************************')
END
/*
I am getting these error messages:
Code:
000112 .AAAHA 12 CAY6006S VERB
"FNAMES=(ERROR2),NULLOFL=RC4,REMOVECC,BUIL
=(C"GOOD."),INCLUDE=(75,6,CH,EQ,C"" IS
UNKNOWN
000114 .AAAHC 12 CAY6006S VERB
"FNAMES=(SORTOUT),SAVE,ACCEPT=1,BUILD=(20:
"***********************************" IS
UNKNOWN
I removed the 2 END statements. I am still getting duplicate parameter errors for FNAMES and Build related to ERROR2. I renamed SORTOUT to SORTOF2 for the second one and I am still getting the same errors. Any Ideas?:If I change the FNAMES files to
I removed the 2 END statements. I am still getting duplicate parameter errors for FNAMES and Build related to ERROR2. I renamed SORTOUT to SORTOF2 for the second one and I am still getting the same errors. Any Ideas?:If I change the FNAMES files to
Where would I place the second INCLUDE and BUILD Commands?
0) There is no BUILD command
1) END has nothing to do with any problem
2) RTFM
3) INCLUDE can be used:
- as optional stand-alone statement, applied before INREC, and SORT processing
- as optional parameter of any OUTFIL statement
4) BUILD can be used:
- as optional parameter of INREC statement
- as optional parameter of OUTREC statement
- as optional parameter of OUTFIL statement
5) No lowercase statements/parameters/options are accepted by SORT utilities
This all is described in SORT manuals, if you ever tried to read them?
All I can say , this topic need not to this far when two working solutions provided already.
Why do you need OUTFIL FNAMES=(SORTOUT),SAVE,ACCEPT=1, twice, because of two different INCLUDE? Did you just change the requirement ? The solutions given were based on earlier requirements. You could fix syntax errors by looking in manuals,
Please restate the new requirement to distinguish between earlier ask and now.
To ease the understanding , you can always breaks into multiple steps solutions for different conditions and messages in SORTOUT, no hard and fast rule to combine them in one step.