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

GDG base need to create by scanning the Jobs


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

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Fri Nov 26, 2010 5:47 pm
Reply with quote

Hi All,

I have a PDS which contains all the jobs. (For e.g let it contain only 10 nos)

My requirement is to get the PDS name from the user and do the Scan of all the jcl's present in the PDS and get the list of GDG base that needs to be created and put it into a PS file.

I wrote the code to read the GDG names from the PS and create the GDG.

Could anyone please provide me any sample of the code to scan and place the GDG base name into the PS.

Thanks in advance.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Nov 26, 2010 6:09 pm
Reply with quote

Why create a PS when you can do the following in one step
a) Find the GDG base name
b) Check to see if the GDG bases exist already
c) Create any GDG bases that are missing

How would you identify the GDG base manually
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Fri Nov 26, 2010 6:22 pm
Reply with quote

Hi Expat,

Thanks for your reply.

We are not going to find out the GDG base manually instead i am looking for tht only.

we can do a TYPRUn= SCAN in all the jobs programmatically and can get the list of the GDG base. Am i correct ???

Or do we have any approach to get the GDG base required for the JCL's.

I hope i m clear.

Could you please suggest me some ,ore light on this area to make it done.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 26, 2010 6:51 pm
Reply with quote

You will need to parse all the DD statements in Your library,
find out if it is a gdg pattern aaa.bbb.ccc(<numeric expression>)
and process accordingly

for an example on how to parse jcl look here
ibmmainframes.com/viewtopic.php?t=32494
it will parse any correct jcl regardless of the <coding> style and keyword position
Back to top
View user's profile Send private message
Guest







PostPosted: Mon Dec 06, 2010 12:33 pm
Reply with quote

Hi Niki,
you can use the below code to get the GDG bases from a meber. After receiving the GDG base you can decide to either create the base or write the same into a fle using the DISKW command:
Code:

  SAY 'ENTER DATASET NAME HAVING LIST OF FILES:'
  PULL JOBFL                                   
 "ALLOC F(INPT) DA('"JOBFL"') SHR REUSE"       
 "EXECIO * DISKR INPT (FINIS STEM INPT."       
 "FREE F(INPT)"                                 
  j = 1                                         
 DO I=1 TO INPT.0                               
    if pos('DSN',inpt.i) > 0 then do           
       parse var inpt.i x '=' dsnme ',' junk   
       if pos('(',dsnme) > 0 then do           
          parse var dsnme dsnme '(' num ')' junk
          str = datatype(num)                   
          if str = "NUM" then do               
            gdg.j = dsnme                       
            j= j + 1                           
          end                                   
       end                                     
    end                                         
 END                                           
 do m = 1 to j                                 
   say gdg.m                                   
 end                                           
 exit                                           
Back to top
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Mon Dec 06, 2010 6:32 pm
Reply with quote

Hi Devil13,

Thanks for the help.

It really gave me a support to move a head one step.
Back to top
View user's profile Send private message
Guest







PostPosted: Mon Dec 06, 2010 7:06 pm
Reply with quote

Hi Niki,
The following piece of code gives the name of members in a PDS the same can be combined with my previous post to meet your requirement:
Code:

say 'enter dsn'                       
pull dsn                             
 x = OUTTRAP(listds.)                 
 Address TSO "LISTDS '"dsn"' MEMBERS"
 x = OUTTRAP('OFF')                   
 Do i = 7 to listds.0                       
 say listds.i           
/*call the previous code here after moving the "dsn(listds.i)" into jobfl*/
 End                                 
 exit         
 


the variable listds.i has the member name in the given PDS.
Please let me know if your requirement is met.
Back to top
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 Finding and researching jobs All Other Mainframe Topics 0
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Help in Automating Batch JCL jobs mon... JCL & VSAM 3
No new posts Submit multiple jobs from a library t... JCL & VSAM 14
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
Search our Forums:

Back to Top