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
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Thu Jun 25, 2020 1:18 am
Reply with quote

I am comparing 2 Header files. When one is missing the last 6 characters, I am trying to force a return code of 12 and print an error message. Here is the Input data sets:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
  HEADER BJ#19401061220 90213 000084  RJE TIME=22:44:15  OUTRECS 0000000  ENDEDD
******************************** Bottom of Data ******************************** ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
  HEADER BJ#19401061220 90213 000084  RJE TIME=22:44:15  OUTRECS 0000083       
******************************** Bottom of Data ********************************

Here is my source code:
Code:
 SORT FIELDS=COPY                   HEADER FLAG                     
//*SYSIN    DD  DSN=SWP.SAS.CNTL(KILLPROD),                         
//*             DISP=SHR                                             
//SORTOUT DD   SYSOUT=*                                             
//SYSIN    DD  *                                                     
 OPTION COPY,NULLOUT=RC12                                           
 INREC IFTHEN=(WHEN=(75,6,CH,NE,C'ENDEDD'),                         
 OUTFIL HEADER2=(                                                   
           20:'**************************************************',/,
           20:'*    WARNING WARNING WARNING WARNING WARNING     *',/,
           20:'**************************************************',/,
           20:'*                                                *',/,
           20:'* THIS PRODUCTION JOB HAS FAILED BECAUSE EITHER  *',/,
           20:'* THE BACKUP HEADER RECORD OR INTERMEDIATE       *',/,
           20:'* HEADER RECORD DATASET FOR THIS VENDOR          *',/,
           20:'* DOES NOT HAVE AN "ENDEDD" FLAG. THIS MAY MEAN  *',/,
           20:'* THAT THERE WAS A PROBLEM IN PREVIOUS           *',/,
           20:'* PRODUCTION PROCESSING OR A PROBLEM WITH THE    *',/,
           20:'* RJE TRANSMISSION.                              *',/,
           20:'* PLEASE VERIFY IF THE PREVIOUS PRODUCTION JOB   *',/,
           20:'* RAN OKAY. IF SO PLEASE VERIFY THE INTERMEDIATE *',/,
           20:'* HEADER TO SEE WHY IT IS NOT FLAGGED AS ENDEDD. *',/,
           20:'* IF NECESSARY THE TRANSMISSION MIGHT NEED TO    *',/,
           20:'* BE REDONE.                                     *',/,
           20:'* CONTACT PRODUCTION PLANNING IF YOU NEED HELP!  *',/,
           20:'*                                                *',/,
           20:'**************************************************',/,
           20:'*    WARNING WARNING WARNING WARNING WARNING     *',',
           20:'**************************************************')) 
/*


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

Senior Member


Joined: 15 Aug 2015
Posts: 1222
Location: Bamberg, Germany

PostPosted: Thu Jun 25, 2020 1:37 am
Reply with quote

How and where do you compare both Headers? Are the Headers in two separate Datasets and is it the only Data there? The OUTRECS fields in the Header is different as well besides the ENDEDD text. Please respecify to make it more understandable what you are trying here.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Thu Jun 25, 2020 2:08 am
Reply with quote

NULLOUT=RC? was in effect and there were no records for the SORTOUT data set, or
NULLOFL=RC?was in effect and there were no data records for an OUTFIL data set
Back to top
View user's profile Send private message
Tushar Sood

New User


Joined: 26 Oct 2008
Posts: 14
Location: New Jersey

PostPosted: Thu Jun 25, 2020 2:55 am
Reply with quote

Hopefully similar, do check

ibmmainframes.com/about57721.html
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Thu Jun 25, 2020 9:09 am
Reply with quote

Quote:
What am I doing wrong?

Your syntax is not correct, IFTHEN condition is incomplete.

Tushar Sood wrote:
Hopefully similar, do check

ibmmainframes.com/about57721.html

JOINKEYS is not needed for this task plus TS needs to set RC-12 when 75,6 is empty for either of the record from the dataset and NOT after the compare and mismatch found.

I would think of this as one of many ways, try it- Assuming both Data sets can be concatenated in F1.

RC-12 is set if at least one record with 75,6 is empty found and Header2 is printed as coded Else RC-00.

Code:
//STEP01   EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8-                                                 
//F1       DD *                                                         
  HEADER BJ#19401061220 90213 000084  RJE TIME=22:44:15  OUTRECS 0000000  ENDEDD
  HEADER BJ#19401061220 90213 000084  RJE TIME=22:44:15  OUTRECS 0000000
//OUT      DD  DISP=(NEW,PASS),                                         
//             UNIT=SYSDA,SPACE=(TRK,(10,10),RLSE),                     
//             DSN=&&MASTER                                             
//OUT1     DD  SYSOUT=*                                                 
//TOOLIN   DD *                                                         
 COPY FROM(F1) TO(OUT) USING(CTL1)                                     
 COPY FROM(OUT) TO(OUT1) USING(CTL2)                                   
 COUNT FROM(OUT) NOTEMPTY RC12                                         
//CTL1CNTL DD *                                                         
 INCLUDE COND=(75,6,CH,EQ,C'      ')                                   
//CTL2CNTL DD *                                                         
 INCLUDE COND=(75,6,CH,NE,C'      ')                                   
 OUTFIL HEADER2=(20:C'WARNING')   
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1222
Location: Bamberg, Germany

PostPosted: Thu Jun 25, 2020 2:31 pm
Reply with quote

@Rohit: The second INCLUDE COND=(75,6,CH,NE,C' ') will never match IMHO.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Thu Jun 25, 2020 6:02 pm
Reply with quote

Joerg.Findeisen wrote:
@Rohit: The second INCLUDE COND=(75,6,CH,NE,C' ') will never match IMHO.

It will match for the second record as it is not needed in final out1.

Please run the card with/without it.
Back to top
View user's profile Send private message
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Thu Jun 25, 2020 7:22 pm
Reply with quote

I apologize. yes the 2 headers are in 2 datasets which are sorted in:
Code:
//CHKBTH  EXEC SSORT,                                     
//             REGION=1536K                               
//* SCSAS.FT12F001 DD DUMMY                               
//* SCSAS.WORK DD UNIT=SYSDA,                             
//*            SPACE=(CYL,(30,15),RLSE)                   
//SYSOUT DD  SYSOUT=*                                     
//*HDRIN    DD  DSN=SWP.BJ#19401.TRANSHDR.INTM.DATA,     
//SORTIN   DD  DSN=PA.TEST.BTR.PA0052.TRANSHDR.DATA,     
//             DISP=SHR                                   
//*        DD  DSN=SWP.BJ#19401.TRANSHDR.BKUP.DATA,       
//         DD  DSN=PA.TEST.BTR.PA0052.TRANSHDR.BKUP.DFAL,
//             DISP=OLD                                   
 SORT FIELDS=COPY                   HEADER FLAG           
//*SYSIN    DD  DSN=SWP.SAS.CNTL(KILLPROD),               
//*             DISP=SHR                                 
//SORTOUT DD   SYSOUT=*                                   
//SYSIN    DD  *                                         
             

The first dataset has the header that ends with ENDEDD. The second one does not and should cause the failure. I will try your suggestion. Thanks!
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Thu Jun 25, 2020 7:23 pm
Reply with quote

Rick Ryan wrote:
I apologize. yes the 2 headers are in 2 datasets which are sorted in:
Code:
//CHKBTH  EXEC SSORT,                                     
//             REGION=1536K                               
//* SCSAS.FT12F001 DD DUMMY                               
//* SCSAS.WORK DD UNIT=SYSDA,                             
//*            SPACE=(CYL,(30,15),RLSE)                   
//SYSOUT DD  SYSOUT=*                                     
//*HDRIN    DD  DSN=SWP.BJ#19401.TRANSHDR.INTM.DATA,     
//SORTIN   DD  DSN=PA.TEST.BTR.PA0052.TRANSHDR.DATA,     
//             DISP=SHR                                   
//*        DD  DSN=SWP.BJ#19401.TRANSHDR.BKUP.DATA,       
//         DD  DSN=PA.TEST.BTR.PA0052.TRANSHDR.BKUP.DFAL,
//             DISP=OLD                                   
 SORT FIELDS=COPY                   HEADER FLAG           
//*SYSIN    DD  DSN=SWP.SAS.CNTL(KILLPROD),               
//*             DISP=SHR                                 
//SORTOUT DD   SYSOUT=*                                   
//SYSIN    DD  *                                         
             

The first dataset has the header that ends with ENDEDD. The second one does not and should cause the failure. I will try your suggestion. Thanks!
Thanks and that's what I thought and assumed and should work.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1222
Location: Bamberg, Germany

PostPosted: Thu Jun 25, 2020 7:40 pm
Reply with quote

Rohit Umarjikar wrote:
Joerg.Findeisen wrote:
@Rohit: The second INCLUDE COND=(75,6,CH,NE,C' ') will never match IMHO.

It will match for the second record as it is not needed in final out1.

Please run the card with/without it.

I did of course.

In your CTL1 you filter for an empty condition only, to put matching records to DD:OUT. With CTL2 you attempt to copy non-empty conditions from DD:OUT that can't be there anymore. That's what I meant. The INCLUDE statement in CTL2 can be omitted as it is useless.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Thu Jun 25, 2020 7:42 pm
Reply with quote

Why it cannot be there ? If there are none all good then it’s fine and it will not be there but if there is one or more then it will be there and except header2 messages TS don’t want anything else so filter them out.

I am surprised you did not see it in out1 sysout.
Back to top
View user's profile Send private message
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Thu Jun 25, 2020 10:12 pm
Reply with quote

Here is what I currently have:
Code:
//CHKBTH  EXEC SSORT,                                   
//             REGION=1536K                             
//* SCSAS.FT12F001 DD DUMMY                             
//* SCSAS.WORK DD UNIT=SYSDA,                           
//*            SPACE=(CYL,(30,15),RLSE)                 
//SYSOUT DD  SYSOUT=*                                   
//*HDRIN    DD  DSN=SWP.BJ#19401.TRANSHDR.INTM.DATA,     
//SORTIN   DD  DSN=PA.TEST.BTR.PA0052.TRANSHDR.DATA,     
//             DISP=SHR                                 
//*        DD  DSN=SWP.BJ#19401.TRANSHDR.BKUP.DATA,     
//         DD  DSN=PA.TEST.BTR.PA0052.TRANSHDR.BKUP.DFAL,
//             DISP=OLD                                 
//OUT      DD  DISP=(NEW,PASS),UNIT=SYSDA,               
//             SPACE=(TRK,(10,10),RLSE),                 
//             DSN=&&MASTER                             
//OUT1    DD   SYSOUT=*                                 
//SORTOUT DD   SYSOUT=*                                             
//F1      DD *                                                       
 COPY FROM(F1) TO (OUT) USING (CTL1)                                 
* COPY FROM(OUT) TO (OUT1) USING (CTL2)                             
 COUNT FROM (OUT) NOTEMPTY RC12                                     
//CTL1CNTL DD *                                                     
 INCLUDE COND=(75,6,CH,EQ,C'      ')                                 
//* CTL2CNTL DD *                                                   
* INCLUDE COND=(75,6,CH,NE,C'      ')                               
 OUTFIL HEADER2=(                                                   
           20:'**************************************************',/,
           20:'*    WARNING WARNING WARNING WARNING WARNING     *',/,
           20:'**************************************************',/,
           20:'*                                                *',/,
           20:'* THIS PRODUCTION JOB HAS FAILED BECAUSE EITHER  *',/,
           20:'* THE BACKUP HEADER RECORD OR INTERMEDIATE       *',/,

Whether I comment out The second Include or not, this step doesn't return a 12 code or print the error. Is there something else I am missing?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Thu Jun 25, 2020 10:15 pm
Reply with quote

Rick Ryan wrote:
Here is what I currently have:
Code:
//CHKBTH  EXEC SSORT,                                   
//             REGION=1536K                             
//* SCSAS.FT12F001 DD DUMMY                             
//* SCSAS.WORK DD UNIT=SYSDA,                           
//*            SPACE=(CYL,(30,15),RLSE)                 
//SYSOUT DD  SYSOUT=*                                   
//*HDRIN    DD  DSN=SWP.BJ#19401.TRANSHDR.INTM.DATA,     
//SORTIN   DD  DSN=PA.TEST.BTR.PA0052.TRANSHDR.DATA,     
//             DISP=SHR                                 
//*        DD  DSN=SWP.BJ#19401.TRANSHDR.BKUP.DATA,     
//         DD  DSN=PA.TEST.BTR.PA0052.TRANSHDR.BKUP.DFAL,
//             DISP=OLD                                 
//OUT      DD  DISP=(NEW,PASS),UNIT=SYSDA,               
//             SPACE=(TRK,(10,10),RLSE),                 
//             DSN=&&MASTER                             
//OUT1    DD   SYSOUT=*                                 
//SORTOUT DD   SYSOUT=*                                             
//F1      DD *                                                       
 COPY FROM(F1) TO (OUT) USING (CTL1)                                 
* COPY FROM(OUT) TO (OUT1) USING (CTL2)                             
 COUNT FROM (OUT) NOTEMPTY RC12                                     
//CTL1CNTL DD *                                                     
 INCLUDE COND=(75,6,CH,EQ,C'      ')                                 
//* CTL2CNTL DD *                                                   
* INCLUDE COND=(75,6,CH,NE,C'      ')                               
 OUTFIL HEADER2=(                                                   
           20:'**************************************************',/,
           20:'*    WARNING WARNING WARNING WARNING WARNING     *',/,
           20:'**************************************************',/,
           20:'*                                                *',/,
           20:'* THIS PRODUCTION JOB HAS FAILED BECAUSE EITHER  *',/,
           20:'* THE BACKUP HEADER RECORD OR INTERMEDIATE       *',/,

Whether I comment out The second Include or not, this step doesn't return a 12 code or print the error. Is there something else I am missing?

Please run the one I shared as is before modifying anything as you are using some customized proc instead of straight ICETOOL . Check if your input is correct and have 75,6 as empty.
Back to top
View user's profile Send private message
Tushar Sood

New User


Joined: 26 Oct 2008
Posts: 14
Location: New Jersey

PostPosted: Fri Jun 26, 2020 12:12 am
Reply with quote

Rohit Umarjikar wrote:
Quote:
What am I doing wrong?

Your syntax is not correct, IFTHEN condition is incomplete.

Tushar Sood wrote:
Hopefully similar, do check

ibmmainframes.com/about57721.html

JOINKEYS is not needed for this task plus TS needs to set RC-12 when 75,6 is empty for either of the record from the dataset and NOT after the compare and mismatch found.

I would think of this as one of many ways, try it- Assuming both Data sets can be concatenated in F1.

RC-12 is set if at least one record with 75,6 is empty found and Header2 is printed as coded Else RC-00.

Code:
//STEP01   EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8-                                                 
//F1       DD *                                                         
  HEADER BJ#19401061220 90213 000084  RJE TIME=22:44:15  OUTRECS 0000000  ENDEDD
  HEADER BJ#19401061220 90213 000084  RJE TIME=22:44:15  OUTRECS 0000000
//OUT      DD  DISP=(NEW,PASS),                                         
//             UNIT=SYSDA,SPACE=(TRK,(10,10),RLSE),                     
//             DSN=&&MASTER                                             
//OUT1     DD  SYSOUT=*                                                 
//TOOLIN   DD *                                                         
 COPY FROM(F1) TO(OUT) USING(CTL1)                                     
 COPY FROM(OUT) TO(OUT1) USING(CTL2)                                   
 COUNT FROM(OUT) NOTEMPTY RC12                                         
//CTL1CNTL DD *                                                         
 INCLUDE COND=(75,6,CH,EQ,C'      ')                                   
//CTL2CNTL DD *                                                         
 INCLUDE COND=(75,6,CH,NE,C'      ')                                   
 OUTFIL HEADER2=(20:C'WARNING')   


Rohit - It was not supposed to an precise answer to TS's question, more as an pointer to TS, if he finds it as an fit he can use it. Also, the question from TS starts with - "I am comparing 2 Header files."
Looks like you have shared another solution, so it should be good.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Fri Jun 26, 2020 12:21 am
Reply with quote

It was misleading as no compare needed suppose to whats being shown in the jcl by the TS.
Back to top
View user's profile Send private message
Tushar Sood

New User


Joined: 26 Oct 2008
Posts: 14
Location: New Jersey

PostPosted: Fri Jun 26, 2020 12:44 am
Reply with quote

Rohit Umarjikar wrote:
It was misleading as no compare needed suppose to whats being shown in the jcl by the TS.


Call me and we will resolve it icon_smile.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Fri Jun 26, 2020 12:45 am
Reply with quote

Tushar Sood wrote:
Rohit Umarjikar wrote:
It was misleading as no compare needed suppose to whats being shown in the jcl by the TS.


Call me and we will resolve it icon_smile.gif
haha it’s resolved in that sense 😊
Back to top
View user's profile Send private message
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Fri Jun 26, 2020 1:02 am
Reply with quote

It is still not working. Here is what I have:
Code:
//STEP01   EXEC PGM=ICETOOL                                                     
//TOOLMSG  DD SYSOUT=*                                                         
//DFSMSG   DD SYSOUT=*                                                         
//F1       DD *                                                                 
  HEADER BJ#19401061220 90213 000084  RJE TIME=22:44:15  OUTRECS 0000000  ENDEDD
  HEADER BJ#19401061220 90213 000084  RJE TIME=22:44:15  OUTRECS 0000083       
//* CHKBTH  EXEC SSORT,                                                         
//*             REGION=1536K                                                   
//* SCSAS.FT12F001 DD DUMMY                                                     
//* SCSAS.WORK DD UNIT=SYSDA,                                                   
//*            SPACE=(CYL,(30,15),RLSE)                                         
//* SYSOUT DD  SYSOUT=*                                                         
//*HDRIN    DD  DSN=SWP.BJ#19401.TRANSHDR.INTM.DATA,                           
//* SORTIN   DD  DSN=PA.TEST.BTR.PA0052.TRANSHDR.DATA,                         
//*             DISP=SHR                                                       
//*        DD  DSN=SWP.BJ#19401.TRANSHDR.BKUP.DATA,                             
//*         DD  DSN=PA.TEST.BTR.PA0052.TRANSHDR.BKUP.DFAL,
//*             DISP=OLD                                                       
//OUT      DD  DISP=(NEW,PASS),                                               
//             UNIT=SYSDA,5PACE=(TRK,(10,10),RLSE),                           
//             DSN=&&MASTER                                                   
//OUT1    DD   SYSOUT=*                                                       
//TOOLIN  DD  *                                                               
* SORT FIELDS=COPY                                                             
//*SYSIN    DD  DSN=SWP.SAS.CNTL(KILLPROD),                                   
//*             DISP=SHR                                                       
//*SORTOUT DD   SYSOUT=*                                                       
//* F1      DD *                                                               
 COPY FROM(F1) TO(OUT) USING(CTL1)                                             
 COPY FROM(OUT) TO(OUT1) USING(CTL2)                                           
 COUNT FROM(OUT) NOTEMPTY RC12                                                 
//CTL1CNTL DD *                                                               
 INCLUDE COND=(75,6,CH,EQ,C'      ')                                           
//CTL2CNTL DD *                                                               
 INCLUDE COND=(75,6,CH,NE,C'      ')                                           
 OUTFIL HEADER2=(                                                             
           20:'**************************************************',/,         
                     

It still gives me rc 0. Any Ideas?
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1222
Location: Bamberg, Germany

PostPosted: Fri Jun 26, 2020 1:19 am
Reply with quote

Rick Ryan wrote:
It still gives me rc 0. Any Ideas?

Remove that clutter:
Code:
* SORT FIELDS=COPY                                                             
//*SYSIN    DD  DSN=SWP.SAS.CNTL(KILLPROD),                                   
//*             DISP=SHR                                                       
//*SORTOUT DD   SYSOUT=*                                                       
//* F1      DD *                                                               
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Fri Jun 26, 2020 1:40 am
Reply with quote

Rick Ryan wrote:
It is still not working. Here is what I have:
It still gives me rc 0. Any Ideas?

As requested earlier, Please rerun exactly as is of what I have shared and it will work.
To fix the issues with your JCL, OUTFIL HEADER2 don't have ')' and second don't keep any commented code in the JCL specially within TOOLIN DD *
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1222
Location: Bamberg, Germany

PostPosted: Fri Jun 26, 2020 11:39 pm
Reply with quote

Another solution w/o ICETOOL/SYNCTOOL could be like this:
Code:
//CHECK    EXEC PGM=SORT,PARM='MSG=NO'                                       
//SORTIN   DD *                                                                 
  HEADER BJ#19401061220 90213 000084  RJE TIME=22:44:15  OUTRECS 0000000  ENDEDD
  HEADER BJ#19401061220 90213 000084  RJE TIME=22:44:15  OUTRECS 0000083       
/*                                                                             
//SYSOUT   DD SYSOUT=*                                                         
//SORTOUT  DD SYSOUT=*                                                         
//CHECK    DD DUMMY                                                   
//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'Done.'),                 
    INCLUDE=(75,6,CH,EQ,C'ENDEDD',AND,81,2,BI,EQ,+2)                           
  OUTFIL FNAMES(SORTOUT),SAVE,ACCEPT=1,                                         
    BUILD=(16:C'**************************************************',/,         
           16:C'*    WARNING WARNING WARNING WARNING WARNING     *',/,         
           16:C'**************************************************',/,         
           16:C'*                                                *',/,         
           16:C'* THIS PRODUCTION JOB HAS FAILED BECAUSE EITHER  *',/,         
           16:C'* THE BACKUP HEADER RECORD OR INTERMEDIATE       *',/,         
           16:C'* HEADER RECORD DATASET FOR THIS VENDOR          *',/,         
           16:C'* DOES NOT HAVE AN "ENDEDD" FLAG. THIS MAY MEAN  *',/,         
           16:C'* THAT THERE WAS A PROBLEM IN PREVIOUS           *',/,         
           16:C'* PRODUCTION PROCESSING OR A PROBLEM WITH THE    *',/,         
           16:C'* RJE TRANSMISSION.                              *',/,         
           16:C'* PLEASE VERIFY IF THE PREVIOUS PRODUCTION JOB   *',/,
           16:C'* RAN OKAY. IF SO PLEASE VERIFY THE INTERMEDIATE *',/,
           16:C'* HEADER TO SEE WHY IT IS NOT FLAGGED AS ENDEDD. *',/,
           16:C'* IF NECESSARY THE TRANSMISSION MIGHT NEED TO    *',/,
           16:C'* BE REDONE.                                     *',/,
           16:C'* CONTACT PRODUCTION PLANNING IF YOU NEED HELP!  *',/,
           16:C'*                                                *',/,
           16:C'**************************************************',/,
           16:C'*    WARNING WARNING WARNING WARNING WARNING     *',/,
           16:C'**************************************************')   
  END                                                                 
/*                                                                     

It will give RC=0 if the eyecatcher ENDEDD is found exactly two times, otherwise RC=4 is given and the Warning banner is shown.
Back to top
View user's profile Send private message
Rick Ryan

New User


Joined: 29 Apr 2020
Posts: 14
Location: USA

PostPosted: Sat Jun 27, 2020 12:40 am
Reply with quote

This works GREAT!!! How could I get it to return a 12? When I try to change
Code:
OUTFIL FNAMES=(CHECK),NULLOFL=RC4,REMOVECC,BUILD=(C'DONE.'),


TO

Code:
OUTFIL FNAMES=(CHECK),NULLOFL=RC12,REMOVECC,BUILD=(C'DONE.'),


I get a PARM error. It won't work if I change it to NULLOUT either. Any suggestions?

Thanks!
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1222
Location: Bamberg, Germany

PostPosted: Sat Jun 27, 2020 1:08 am
Reply with quote

You can make NULLOFL only end with RC0, RC4 or RC16 unfortunately. That's why I have chosen RC4 here. If you change it to RC16 it will work again and is perhaps more obvious for your desired purpose.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Sat Jun 27, 2020 2:17 am
Reply with quote

Joerg.Findeisen wrote:
You can make NULLOFL only end with RC0, RC4 or RC16 unfortunately. That's why I have chosen RC4 here. If you change it to RC16 it will work again and is perhaps more obvious for your desired purpose.

Unfortunately, NULLOFL=RC16 results not in RC=16, but in ABEND U0016.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1222
Location: Bamberg, Germany

PostPosted: Sat Jun 27, 2020 2:27 am
Reply with quote

sergeyken wrote:
Unfortunately, NULLOFL=RC16 results not in RC=16, but in ABEND U0016.

I usually only work with RC4 setting and wasn't aware of the difference for RC16 anymore. Thanks for another refresh, I really like your contributions. icon_smile.gif
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 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top