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

REXX cdoe to purge a JOB from spool after successful Run.


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sulabh Agrawal

New User


Joined: 29 Sep 2016
Posts: 4
Location: India

PostPosted: Thu Mar 09, 2017 11:36 am
Reply with quote

Hi Group,....

I have requirement to check the SPOOL for a given JOB and purge it if the RC is 0.

I am planning to automate the above process using REXX.

If any of you aware about the approach and code for my requirement, please let me know, I would be greately thankful!!!

Regards
Sulabh
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Mar 09, 2017 11:59 am
Reply with quote

Talk to your Scheduler people.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Thu Mar 09, 2017 2:29 pm
Reply with quote

Or look at the REXX SDSF API.
Back to top
View user's profile Send private message
don.leahy

Active Member


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

PostPosted: Thu Mar 09, 2017 8:20 pm
Reply with quote

I can see a use for a tool like this in a Development environment but NOT in Production!

I already have a tool that we use (in Development only!) to archive job output to a PDS or PDSE using the REXX/SDSF interface. It also creates a log data set that can be used as input to another tool that purges the output.

If you are on z/OS 2.2 you can take advantage of the new RGEN command under SDSF. It generates skeleton Rexx/SDSF programs based on the SDSF screen you run it on. I have not yet had an opportunity to try it out because we just recently upgraded to 2.2 and the feature hasn't been turned on yet, but it looks very interesting.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2594
Location: Silicon Valley

PostPosted: Thu Mar 09, 2017 11:09 pm
Reply with quote

My site has a program called JOBPURGR (sorry, source is not available) which you would add as the last step of the job. And you would add JCL so that the last step only gets executed if RC=0.

The JOBPURGR program uses control blocks to determine the job number and issues a $PJxxxx operator command (or something like that).
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2145
Location: USA

PostPosted: Sun Mar 12, 2017 12:40 am
Reply with quote

Willy Jensen wrote:
Or look at the REXX SDSF API.


Also EJES EXECAPI interface could help with this issue.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Sun Mar 12, 2017 7:33 am
Reply with quote

Quote:
Also EJES EXECAPI interface could help with this issue.
IF the site has (E)JES -- as a vendor product, (E)JES is not installed at every site, so your suggestion has a good chance of being unusable.
Back to top
View user's profile Send private message
farhad_evan

New User


Joined: 30 Aug 2014
Posts: 24
Location: UK

PostPosted: Tue Mar 14, 2017 9:56 am
Reply with quote

i think you can use of appropriate JOB CLASS in your job. ( with DISP (PURGE,HOLD) )
in that case you don't need REXX or anything
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Tue Mar 14, 2017 4:39 pm
Reply with quote

Not JOBDEF, but OUTCLASS .. OUTDISP(PURGE,HOLD) might work. Though you must make sure the job abends for anything but RC=0, as OUTDISP is based on job abend:
OUTDisp=([normal][,abnormal])
normal Specifies the output disposition if the job does not abend.
abnormal Specifies the output disposition if the job abends[/quote]
Back to top
View user's profile Send private message
farhad_evan

New User


Joined: 30 Aug 2014
Posts: 24
Location: UK

PostPosted: Tue Mar 14, 2017 5:13 pm
Reply with quote

Quote:
i think you can use of appropriate JOB CLASS in your job


on SDSF you can run this command to find out disposition of job's out put:
Code:
$D JOBCLASS(*),OUTDISP

and find the job class with DISP (PURGE,HOLD) and in your JCL set MSGCLASS to it.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2145
Location: USA

PostPosted: Wed Mar 15, 2017 2:12 am
Reply with quote

Robert Sample wrote:
IF the site has (E)JES -- as a vendor product, (E)JES is not installed at every site, so your suggestion has a good chance of being unusable.

Agree.

As well as many other recommendations from this forum do refer to the tools not available in our environment. But I do not post objections on each of them.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Wed Mar 15, 2017 6:02 pm
Reply with quote

JOBDEF and OUTCLASS are JES2 definitions. Probably should have said so.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts purge jobs with return code 0 and ret... JCL & VSAM 4
No new posts Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
Search our Forums:

Back to Top