View previous topic :: View next topic
|
Author |
Message |
honestsoul
New User
Joined: 05 Nov 2008 Posts: 23 Location: delhi
|
|
|
|
I want to get all the JCL components inside a PDS, like inside a dataset there are JCL, PROC and control card components, I want a rexx code which will return only the JCL components present inside the dataset. |
|
Back to top |
|
|
rexx77
New User
Joined: 14 Apr 2008 Posts: 78 Location: Mysore
|
|
|
|
HI,
Open each member and check whether the first line has a JOB string, if yes then push the member name to JCLLIST Dataset.
Repeat the above opeartion till the last member of the PDS. |
|
Back to top |
|
|
honestsoul
New User
Joined: 05 Nov 2008 Posts: 23 Location: delhi
|
|
|
|
Thanx rexx77......
well do u have the rexx code doing the same? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
check whether the first line has a JOB string |
...won't necessarily get you all JCL components. What about PROCs without jobcards and JCL which is INCLUDEd in other JOBs/PROCs ???
Garry. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Code: |
/* REXX */
"PRINTDS DATASET('the.pds.name') TODATASET('seq.name')"
"ALLOC F(i) DA('seq.name') SHR REU DELETE"
"EXECIO * DISKR i (STEM rec. FINIS"
"FREE F(i)"
cntr = 0
Do Forever
cntr = cntr + 1
If cntr >= rec.0 Then Leave
Parse Var rec.cntr v1 v2 v3 v4 v5 .
If v4 = "MEMBER:" Then
Do
member = v5
cntr = cntr + 3
Parse Var rec.cntr first_two 3 jobname job therest
If (first_two = "//" & job = "JOB") The Queue member
End
End
"EXECIO "Queued()" DISKW out (FINIS"
Exit 0
|
OR
Code: |
/* REXX */
thepds = "the.pds.name"
x = Outtrap(ml.)
"LISTDS '"thepds"' members"
x = Outtrap(Off)
Do i = 7 To ml.0
Parse Var ml.i member .
"ALLOC F(pds) DA('"thepds"("member")') SHR REU"
"EXECIO 1 DISKR pds (STEM in. FINIS"
If in.0 > 0 Then
Do
Parse Var in.1 first_two 3 jobname job therest
If (first_two = "//" & job = "JOB") Then Queue member
End
"FREE F(pds)
End
"EXECIO "Queued()" DISKW out (FINIS"
Exit 0
|
OR
Code: |
/* REXX */
Address ISPEXEC
"LMINIT DATAID(did) DDNAME(pds) ENQ(SHR)"
"LMOPEN DATAID("did") OPTION(INPUT)"
Do Forever
"LMMLIST DATAID("did") OPTION(LIST) MEMBER(member)"
If rc <> 0 Then Leave
"LMMFIND DATAID("did") MEMBER("member")"
If rc = 0 Then
Do
"LMGET DATAID("did") MODE(INVAR) DATALOC(locvar)",
"DATALEN(lenvar) MAXLEN(80)"
Parse Var locvar first_two 3 jobname job therest
If (first_two = "//" & job = "JOB") Then Queue member
End
End
"LMCLOSE DATAID("did")"
"LMFREE DATAID("did")"
"EXECIO "Queued()" DISKW out (FINIS"
Exit 0
|
|
|
Back to top |
|
|
|