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
 

 

finding JCL component inside a PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: finding JCL component inside a PDS
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: 74
Location: Mysore

PostPosted: Thu Jan 08, 2009 12:23 pm    Post subject:
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    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 992
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Jan 08, 2009 2:12 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Jan 08, 2009 5:38 pm    Post subject: Reply to: finding JCL component inside a PDS
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    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
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 6 Thu Oct 27, 2016 10:20 am
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am
No new posts Finding unreferenced datasets without... Alan Playford JCL & VSAM 5 Tue Jul 12, 2016 9:07 pm
No new posts Finding repetead surnames in differen... blackjack202 DFSORT/ICETOOL 7 Tue Jun 07, 2016 7:42 pm


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