IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 7312
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 User


Joined: 01 Sep 2015
Posts: 397
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: 692
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: 2206
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

Active Member


Joined: 29 Apr 2008
Posts: 877
Location: Maryland

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: 8566
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 User


Joined: 01 Sep 2015
Posts: 397
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

Active Member


Joined: 29 Apr 2008
Posts: 877
Location: Maryland

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 User


Joined: 01 Sep 2015
Posts: 397
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 All times are GMT + 6 Hours
Forum Index -> CLIST & REXX
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts Calling Assembler from REXX PL/I & Assembler 5
No new posts REXX/CLIST tool for BCSR and EDSR CLIST & REXX 2
No new posts Calling Rexx program from Cobol CLIST & REXX 12
No new posts REXX script to beautify XML CLIST & REXX 1
No new posts TWS PIF (EQQYCOM) Rexx - Occurrence S... IBM Tools 0

Back to Top