MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Adding a new step at the beginning of the jobs using REXX

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
yrcreddy
Beginner


Joined: 28 Dec 2005
Posts: 27
Topics: 12

PostPosted: Thu May 24, 2007 11:15 pm    Post subject: Adding a new step at the beginning of the jobs using REXX Reply with quote

Hi,

We have 500 jobs in a Library.We need to add the delete step in the beginning of the every job for to delete all the datasets that are created in that specific job.

The following step is need to be added in the jobs:

//STEP01 EXEC PGM=IDCAMS
//*-----------------------
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
DEL DATA-SET NAME
SET MAXCC=0
/*

Please let me know,how to achieve the above scnario using REXX tool.
_________________
Thanks,
Ramachandra Reddy
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri May 25, 2007 12:49 am    Post subject: Reply with quote

Code:

//STEP01 EXEC PGM=IDCAMS
//*-----------------------
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *

Putting the above code into a PDS member would a starting point. This can then be included into each member of your PDS using an EDIT MACRO, and placed before the first EXEC statement.

So how are you going to determine the datasets to be deleted in each seperate member ?
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri May 25, 2007 1:36 am    Post subject: Reply with quote

you may also have to renumber the following steps.
Are there multiple steps in the job? For efficiency you should have a delete before EACH step. That delete step would be the restart point.
If you are doing it by Rexx and not a Rexx macro you would:
    Use library services to access each member of your PDS one at a time
    Read through the member until you found the point where your step is to be inserted
    Insert the step
    continue reading
      at each step change the step number
      create delete records for the dataset names being created
      write out the delete member

    at end - save

_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12373
Topics: 75
Location: San Jose

PostPosted: Fri May 25, 2007 8:31 am    Post subject: Reply with quote

Quote:

We have 500 jobs in a Library.We need to add the delete step in the beginning of the every job for to delete all the datasets that are created in that specific job.


Your schdelur package should have 1 to delete the dataset created. CA-11 is an add on utility for CA-7

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri May 25, 2007 12:08 pm    Post subject: Reply with quote

I do in principle agree with Nic
( But I would do as he has invited me to his BBQ Mr. Green )

But the practicalities are a real PITA.

The code below is an ISPF edit macro, butchered from my new site JCL setup suite, that will insert a given member of a PDS before the first EXEC statement in a member of the same PDS - As I said above to use the basic IDCAMS JCL as an insert member.

All it needs now is for the OP to determine the logic for identifying the dataset names to be deleted, and off we go ...............

Code:

 /* REXX *** BUILD JCL LIBRARY TO NEW SITE CONFIGURATION              */
 
 ADDRESS TSO
 "ISREDIT    MACRO"

 "ISREDIT F 'EXEC' FIRST"
 IF RC <> 0 THEN EXIT

 "ISREDIT (CRSLINE,CRSCOL) = CURSOR"

 "ISREDIT COPY xxxxxx BEFORE "CRSLINE
 "ISREDIT END"


So over to Dick for his PDF Mr. Green Mr. Green Mr. Green
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri May 25, 2007 12:16 pm    Post subject: Reply with quote

Thanks for the invite expat, but I would not ever need it; I only work at sites that have enough budget for a decent scheduler.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri May 25, 2007 2:30 pm    Post subject: Reply with quote

Dick, exactly my point. You could use it to insert the CA-11 steps at the start of each job Mr. Green
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group