IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Force a Return Code and print error message


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1230

PostPosted: Sat Jun 27, 2020 3:23 am
Reply with quote

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.
Back to top
View user's profile Send private message
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Mon Jul 06, 2020 11:52 pm
Reply with quote

I am trying to adapt this group of steps
Code:
//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                                   


What am I doing wrong?
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 336
Location: Inside the SPEW (Cincinnati OH USA)

PostPosted: Tue Jul 07, 2020 12:01 am
Reply with quote

END is not needed.
Back to top
View user's profile Send private message
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Tue Jul 07, 2020 12:54 am
Reply with quote

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
Code:
 OUTFIL FNAMES=(ERROR1,error2),NULLOFL=RC4,REMOVECC,BUILD=(C'GOOD.'),
   INCLUDE=(3,6,CH,EQ,C'HEADER')                                     
 OUTFIL FNAMES=(SORTOUT,sortof2),SAVE,ACCEPT=1,                     

Where would I place the second INCLUDE and BUILD Commands?
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1230

PostPosted: Tue Jul 07, 2020 7:15 pm
Reply with quote

Rick Ryan wrote:
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
Code:
 OUTFIL FNAMES=(ERROR1,error2),NULLOFL=RC4,REMOVECC,BUILD=(C'GOOD.'),
   INCLUDE=(3,6,CH,EQ,C'HEADER')                                     
 OUTFIL FNAMES=(SORTOUT,sortof2),SAVE,ACCEPT=1,                     

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?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2812
Location: NYC,USA

PostPosted: Tue Jul 07, 2020 7:28 pm
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts How to get the message id thats trigg... Java & MQSeries 0
No new posts File Status Error code 39 when Proces... COBOL Programming 2
No new posts VB file copy COBOL program gives erro... COBOL Programming 3
No new posts AUTHORIZED database error in HALDB IMS DB/DC 2
No new posts Issue with CA Copycat-IGD17100I UNEXP... CA Products 5
Search our Forums:

Back to Top