REXX code to create GDG Bases



IBM's Command List programming language & Restructured Extended Executor

REXX code to create GDG Bases

Postby ravitejaintel » Wed Nov 05, 2014 7:33 am

Hi,

I need a Rexx code which scans the jcl and identify the GDG's and then create respective GDG base.

For example, i opened a member TEST.REXX1.SAMPLE(MEMBER1),
when i enter any command in command line like ''GDGBASE" then press enter.. it should scan the opened member and identify the jcls and create the GDG bases.
ravitejaintel
 
Posts: 4
Joined: Wed Nov 05, 2014 7:24 am
Has thanked: 0 time
Been thanked: 0 time

Re: REXX code to create GDG Bases

 

Re: REXX code to create GDG Bases

Postby vern » Wed Nov 05, 2014 1:06 pm

Just curious .. can you explain why you have JCLs which reference GDGs but you don't already have the GDG bases ?
vern
 
Posts: 14
Joined: Fri Oct 24, 2014 12:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: REXX code to create GDG Bases

Postby ravitejaintel » Wed Nov 05, 2014 3:39 pm

Hi vern,

Thank you for your interet.

My scenario is to scan the job and to create GDG base if it doesn't have already a GDG base.
ravitejaintel
 
Posts: 4
Joined: Wed Nov 05, 2014 7:24 am
Has thanked: 0 time
Been thanked: 0 time

Re: REXX code to create GDG Bases

Postby vern » Wed Nov 05, 2014 4:13 pm

Ok. So someone created a load of JCL referencing GDGs which has never run because the GDGs don't exist ? That just seems really strange.

I doubt very much that anyone will give you any ready-made code to do this. If you don't have any tools like JCLCHECK then you'll have to write something yourself and it won't be easy. You could scan your JCL library and look for strings identifying a GDG reference ( +1, -2 and so on) and extract the dataset name. But quite likely the JCL will call PROCs and they may use GDGs, but you won't see them in the library scan.
And how do you know what LIMIT(nn) value is required for this gdg ?
It would help if you said WHY you want to do this, then maybe you'll get good advice about the best way of achieving it (which may be different to what you say you want)
vern
 
Posts: 14
Joined: Fri Oct 24, 2014 12:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: REXX code to create GDG Bases

Postby ravitejaintel » Wed Nov 05, 2014 11:35 pm

i am not expecting the ready made code.. Since i am a rexx beginner, i need the experts or experienced persons in the way of approach to achieve the target. i know its difficult, but we should do the impossible tasks also, right!!

I need this to automate the system which reduces the manual effort in creating the GDG's always.

I have hope that this forum will helps.
ravitejaintel
 
Posts: 4
Joined: Wed Nov 05, 2014 7:24 am
Has thanked: 0 time
Been thanked: 0 time

Re: REXX code to create GDG Bases

Postby NicC » Thu Nov 06, 2014 12:18 am

Actually, the IDCAMS control cards to set up the GDG base should be a documented project deliverable and should be done before the JCL is created.

You could do it as amacro or you could read the JCL, procedure or otherwise, into your program. Scan each line looking for '(+', '(-', '(0'. Get the dataset name from the same line. Generate the IDCAMS statements. Store/write.

After that you will have to check the generated statements looking for duplicates - probably OK to use your sort product to remove them. Then manually adjust the statements to the requirements of each dataset - number of generations, what to do with them when they roll off etc.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: REXX code to create GDG Bases

Postby vern » Thu Nov 06, 2014 12:52 pm

@ravitejaintel, sure, projects which are difficult are often the most rewarding and the ones where you learn the most ! What Nic says above is correct but you must also look for JCL which is not visible in the member because it is
(a) in a proc, i.e. // EXEC PROCNAME,..
(b) included with a // INCLUDE

One thing you might consider is submitting each job with a //TYPRUN=SCAN. The job won't run, but you will be able to see all the resolved JCL including (a) and (b). If you can get that into a dataset, you can scan it with a REXX program
Good Luck
vern
 
Posts: 14
Joined: Fri Oct 24, 2014 12:40 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post