View previous topic :: View next topic
|
Author |
Message |
me.batenipour
New User
Joined: 15 Dec 2024 Posts: 4 Location: Iran
|
|
|
|
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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1379 Location: Bamberg, Germany
|
|
|
|
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 |
|
 |
me.batenipour
New User
Joined: 15 Dec 2024 Posts: 4 Location: Iran
|
|
|
|
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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1379 Location: Bamberg, Germany
|
|
|
|
Check what I have written, it's independent of the MSGCLASS parameter you have set. |
|
Back to top |
|
 |
me.batenipour
New User
Joined: 15 Dec 2024 Posts: 4 Location: Iran
|
|
|
|
Can you give me a small jcl example? |
|
Back to top |
|
 |
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 767 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1379 Location: Bamberg, Germany
|
|
|
|
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 |
|
 |
|