View previous topic :: View next topic
|
Author |
Message |
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Guest
|
|
|
|
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
|
|
|
|
Hi Devil13,
Thanks for the help.
It really gave me a support to move a head one step. |
|
Back to top |
|
|
Guest
|
|
|
|
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 |
|
|
|