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

Pass Return code of a JCL if JCL abends


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
usharaniA

New User


Joined: 22 Jan 2008
Posts: 85
Location: India

PostPosted: Thu Jun 04, 2009 12:48 pm
Reply with quote

Hi,

I want to set the Return code of a step when the JCL abends,
From the forum i found that it is not posiible to set the RC once it is executed.

But i want to pass a parm to a Rexx code if the JCL abends .
Can you please tell me how to do that .
For eg. if my Jcl is ,

Code:
//STEP2 EXEC PGM=COBPGM1                             
//STEPLIB DD DISP=SHR,DSN=Userid.LOADLIBV.VALIDTR   
//DD1 DD DISP=SHR,DSN=Userid.A1.PS                   
//DD2 DD DISP=SHR,DSN=Userid.TOOLS.VALIDTR.TEMP     
//SYSPRINT DD SYSOUT=*                               
//SYSOUT DD SYSOUT=*                                 
//TEST2  IF (ABEND | STEP2.RC > 8 | RC < 8) THEN     


If the Job abends should i use any SET statement and pass it to REXX code.
If so how to do that.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jun 04, 2009 12:53 pm
Reply with quote

use an if group only for the abend
Back to top
View user's profile Send private message
usharaniA

New User


Joined: 22 Jan 2008
Posts: 85
Location: India

PostPosted: Thu Jun 04, 2009 1:05 pm
Reply with quote

can you please elaborate.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jun 04, 2009 1:12 pm
Reply with quote

Can you please go to the JCL reference manual by using the "IBM Manuals" button at the top of any page, and read all about it.
Back to top
View user's profile Send private message
usharaniA

New User


Joined: 22 Jan 2008
Posts: 85
Location: India

PostPosted: Thu Jun 04, 2009 3:30 pm
Reply with quote

can you please tell me how to code If... else... in the SYSIN statement,
Because its giving me the following error in the SPOOL.
Code:
READY                                               
   IF (STEP2.ABEND | STEP2.RC > 8 | RC < 8) THEN   
IKJ56500I COMMAND IF NOT FOUND                     
READY                                               
   ISPSTART CMD(%JUA2  08) NEWAPPL(BAT)             


My JCL SYSIN statement is:
Code:
//SYSTSIN  DD   *                                     
   IF (STEP2.ABEND | STEP2.RC > 8 | RC < 8) THEN       
   ISPSTART CMD(%JUA2  08) NEWAPPL(BAT)               
   ELSE ISPSTART CMD(%JUA2  00) NEWAPPL(BAT)           
   ENDIF                                               
                                                       
/*                                                     
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jun 04, 2009 3:38 pm
Reply with quote

expat wrote:
Can you please go to the JCL reference manual by using the "IBM Manuals" button at the top of any page, and read all about it.

These are JCL statements, not REXX or TSO ...........................
Back to top
View user's profile Send private message
usharaniA

New User


Joined: 22 Jan 2008
Posts: 85
Location: India

PostPosted: Thu Jun 04, 2009 3:47 pm
Reply with quote

Sorry i got the ouput I coded as follows,
Code:
//TEST2   IF (ABEND | STEP2.RC > 8 | RC < 8) THEN       
//LASTSTEP EXEC PGM=IKJEFT01,COND=EVEN                 
//ISPPROF  DD DSN=&&ISPPROF,DISP=(,PASS),               
//            UNIT=SYSDA,SPACE=(CYL,(1,1,10),RLSE),     
//            RECFM=FB,LRECL=80                         
//ISPPLIB  DD   DSN=ISP.SISPPENU,DISP=SHR               
//ISPMLIB  DD   DSN=ISP.SISPMENU,DISP=SHR               
//ISPSLIB  DD   DSN=ISP.SISPSENU,DISP=SHR               
//ISPTLIB  DD   DSN=ISP.SISPTENU,DISP=SHR               
//SYSEXEC  DD   DISP=SHR,DSN=U162936.TOOLS.VALIDTR.PDS 
//SYSTSPRT DD   SYSOUT=*                               
//SYSTSIN  DD   *                                       
   ISPSTART CMD(%JUA2  12) NEWAPPL(BAT)                 
/*                                                     
//         ELSE                                         
//LASTSTEP EXEC PGM=IKJEFT01,COND=EVEN                 
//ISPPROF  DD DSN=&&ISPPROF,DISP=(,PASS),               
//            UNIT=SYSDA,SPACE=(CYL,(1,1,10),RLSE),     
//            RECFM=FB,LRECL=80                         
//ISPPLIB  DD   DSN=ISP.SISPPENU,DISP=SHR               
//ISPMLIB  DD   DSN=ISP.SISPMENU,DISP=SHR               
//ISPSLIB  DD   DSN=ISP.SISPSENU,DISP=SHR               
//ISPTLIB  DD   DSN=ISP.SISPTENU,DISP=SHR               
//SYSEXEC  DD   DISP=SHR,DSN=U162936.TOOLS.VALIDTR.PDS 
//SYSTSPRT DD   SYSOUT=*                               
//SYSTSIN  DD   *                                       
   ISPSTART CMD(%JUA2  0) NEWAPPL(BAT)         
                                               
/*                                             
//ENDTEST2 ENDIF                               
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top