Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

GDG base need to create by scanning the Jobs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Niki

Active User


Joined: 20 Sep 2008
Posts: 102
Location: Bangalore

PostPosted: Fri Nov 26, 2010 5:47 pm    Post subject: GDG base need to create by scanning the Jobs
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: 8593
Location: Back in jolly old England

PostPosted: Fri Nov 26, 2010 6:09 pm    Post subject:
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: 102
Location: Bangalore

PostPosted: Fri Nov 26, 2010 6:22 pm    Post subject: Reply to: GDG base need to create by scanning the Jobs
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Fri Nov 26, 2010 6:51 pm    Post subject: Reply to: GDG base need to create by scanning the Jobs
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
http://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    Post subject:
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: 102
Location: Bangalore

PostPosted: Mon Dec 06, 2010 6:32 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts How to show message using batch jobs madprasy TSO/ISPF 7 Fri Sep 09, 2016 6:55 pm
No new posts Don't allow CICS to submit batch jobs prino JCL & VSAM 5 Mon Jul 25, 2016 3:26 pm
No new posts Predicting jobs which are about to re... kpanchabhai85 DFSORT/ICETOOL 4 Thu Jun 30, 2016 7:51 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us