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

finding JCL component inside a PDS


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

New User


Joined: 05 Nov 2008
Posts: 23
Location: delhi

PostPosted: Thu Jan 08, 2009 11:28 am
Reply with quote

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
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 78
Location: Mysore

PostPosted: Thu Jan 08, 2009 12:23 pm
Reply with quote

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
View user's profile Send private message
honestsoul

New User


Joined: 05 Nov 2008
Posts: 23
Location: delhi

PostPosted: Thu Jan 08, 2009 12:25 pm
Reply with quote

Thanx rexx77......
well do u have the rexx code doing the same?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Jan 08, 2009 2:12 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jan 08, 2009 5:38 pm
Reply with quote

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
View user's profile Send private message
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 VB to FB - Finding LRECL SYNCSORT 4
No new posts Finding Assembler programs PL/I & Assembler 5
No new posts calling a JCl inside a JCL JCL & VSAM 3
No new posts SRCHFOR ‘string’ command inside P... TSO/ISPF 14
Search our Forums:

Back to Top