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
 

 

Checking for the presence of a particular member in a PDS

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

New User


Joined: 16 Jun 2008
Posts: 40
Location: bangalore

PostPosted: Thu Jun 26, 2008 7:42 pm    Post subject: Checking for the presence of a particular member in a PDS
Reply with quote

How to check whether a particular member is present in a PDS.

I checked in the forum and I got that we need to check return value of SYSDSN(pdsname(member)) for the answer.

But SYSDSN() give the return value "DATASET NOT FOUND" for all the members irrespective of their presence.

(note : SYSDSN(pdsname) works well to find whether the PDS is catalogued or not )
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 Jun 26, 2008 7:49 pm    Post subject: Reply to: Checking for the presence of a particular member i
Reply with quote

Hmm. Works for me.
Code:

/* REXX */
retcode = SYSDSN('''MY.PDS(MEMBER1)''')
Say retcode
retcode = SYSDSN('''MY.PDS(MEMBER2)''')
Say retcode


If only MEMBER1 is in the PDS, I get
OK
MEMBER NOT FOUND
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 Jun 26, 2008 7:57 pm    Post subject: Reply to: Checking for the presence of a particular member i
Reply with quote

Using ISPF Library Management (LM) Services also works well.
Code:

/* REXX */
"ISPEXEC LMINIT DATAID(did) DATASET('MY.PDS') ENQ(SHR)"
"ISPEXEC LMOPEN DATAID("did") OPTION(INPUT)"
"ISPEXEC LMMFIND DATAID("did") MEMBER(MEMBER1) STATS(YES)"
Say rc
"ISPEXEC LMMFIND DATAID("did") MEMBER(MEMBER2) STATS(YES)"
Say rc
"ISPEXEC LMCLOSE DATAID("did")"


If only MEMBER1 is in the PDS, I get
0
8
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Fri Jun 27, 2008 1:48 am    Post subject:
Reply with quote

ssk,
enclose 'pdsname(member1)' in quotes otherwise it prepends your userid!
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2033
Location: Silicon Valley

PostPosted: Fri Jun 27, 2008 4:52 am    Post subject: Reply to: Checking for the presence of a particular member i
Reply with quote

Regarding a previous example:
Code:
/* REXX */
retcode = SYSDSN('''MY.PDS(MEMBER1)''')


The use of multiple single quotes is a source of confusion for some. I like using double quotes to define the constant and then use single quotes within, such as:
Code:
/* REXX */
retcode = SYSDSN("'MY.PDS(MEMBER1)'")
Back to top
View user's profile Send private message
ssk1711

New User


Joined: 16 Jun 2008
Posts: 40
Location: bangalore

PostPosted: Mon Jun 30, 2008 10:23 am    Post subject:
Reply with quote

thanks. It working now.
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 Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am
No new posts Bind plan as a member to another bind... rexx77 DB2 0 Thu Feb 16, 2017 2:02 am
No new posts Checking Current date vickey_dw DFSORT/ICETOOL 1 Wed Feb 08, 2017 11:14 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


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