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

purge jobs with return code 0 and retain jobs with RC>0


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

New User


Joined: 15 Dec 2024
Posts: 4
Location: Iran

PostPosted: Tue Dec 24, 2024 11:38 am
Reply with quote

Hi,
How can I write a JCL that purges the job if it returns RC=0 and does not purge it if RC>0?

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

Senior Member


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

PostPosted: Tue Dec 24, 2024 1:56 pm
Reply with quote

Have a look at JES OUTPUT OUTDISP parameters. It works Ok when you let ABEND the successful jobs. So a two step solution should do your task.

PS: I tried it just now, and it's fine for me.
Back to top
View user's profile Send private message
me.batenipour

New User


Joined: 15 Dec 2024
Posts: 4
Location: Iran

PostPosted: Tue Dec 24, 2024 2:34 pm
Reply with quote

Thank you, but that’s not what I meant. I want the job to be completely purged if RC=0; otherwise, it should remain in JES.
We do this by MSGCLASS but it purges both RC=0 and RC>0 jobs
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Tue Dec 24, 2024 2:39 pm
Reply with quote

Check what I have written, it's independent of the MSGCLASS parameter you have set.
Back to top
View user's profile Send private message
me.batenipour

New User


Joined: 15 Dec 2024
Posts: 4
Location: Iran

PostPosted: Tue Dec 24, 2024 2:48 pm
Reply with quote

Can you give me a small jcl example?
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 767
Location: Whitby, ON, Canada

PostPosted: Wed Jan 01, 2025 4:06 am
Reply with quote

I use the ISFREXX interface for this purpose. SDSF has a Rexx interface that is rich in features. It can even generate skeleton Rexx programs for you that you can modify for your needs. You can use it to examine the contents of a ST panel and take action depending on the job RC or any other field.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Wed Jan 01, 2025 1:56 pm
Reply with quote

If MAXCC is NonZero in this sample, the Output is kept, otherwise purged.

Code:
//ODEF     OUTPUT OUTDISP=(PURGE,WRITE),JESDS=ALL,DEFAULT=YES
//IDCAMS   EXEC PGM=IDCAMS                                   
//SYSPRINT DD SYSOUT=*                                       
//SYSIN    DD *                                               
  SET MAXCC=4                                                 
/*                                                           
//ABEND806 EXEC PGM=ABEND806,COND=(0,EQ,IDCAMS)
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 SFTP Return Codes TSO/ISPF 0
No new posts SAVEPOINT ON ROLLBACK RETAIN CURSORS ... DB2 1
No new posts How to turn off 'ACTION' SDSF output ... TSO/ISPF 2
No new posts Finding and researching jobs All Other Mainframe Topics 0
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top