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

To ensure whether a PDS Member exists or not


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

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Wed Aug 26, 2009 2:31 pm
Reply with quote

Hi
I used the below to ensure whether a PDS member exists or not.
Code:
address ispexec                                 
"Browse Dataset('LQ.SLQ.TLQ(Sample)') "


I just want to ensure, need not take control there, if the member is not there how to handle that case?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Aug 26, 2009 2:47 pm
Reply with quote

Use this
Code:

ISOK=SYSDSN('LQ.SLQ.TLQ(SAMPLE)')     
IF ISOK = "OK" THEN   
address ispexec                                 
"Browse Dataset('LQ.SLQ.TLQ(Sample)') "
Back to top
View user's profile Send private message
craig2020

New User


Joined: 30 Jan 2007
Posts: 7
Location: Chennai

PostPosted: Wed Aug 26, 2009 4:41 pm
Reply with quote

Hi,
I used the below method to check if a PDS exist or not.

copy_library = 'USERID.COPYLIB.PDS'
copybook='MEMBER'
a=sysdsn("'"copy_library"("copybook")'") /*statement 1 */
b=sysdsn('USERID.COPYLIB.PDS(MEMBER)') /*statement 2 */
c=sysdsn('USERID.COPYLIB.PDS'||'('||'MEMBER'||')') /*statement 3 */


Though I am pointing to the same PDS member in all the above 3 statements, only the value of a is 'OK', but for b and c, I am getting MEMBER SPECIFIED, BUT DATASET IS NOT PARTITIONED.

Could you tell me if I am making any systax error in statement 2 & 3. Also what does the error message signfies. Thanks.

P.S I did not create a new thread as I felt this thread is open and also relevant to my question.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 26, 2009 4:53 pm
Reply with quote

Try running with TRACE I and following the flow to see if that fgives you a clue.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 26, 2009 5:07 pm
Reply with quote

Since you can not bother reading the manual or tracing your script:

Rexx Ref Manual for SYSDSN wrote:
Code:
You can specify the dsname in any of the following ways:

Fully-qualified data set name — The extra quotation marks prevent TSO/E from adding your prefix to the data set name.
x = SYSDSN("'sys1.proj.new'")
x = SYSDSN('''sys1.proj.new''')

Non fully-qualified data set name that follows the naming conventions — When there is only one set of quotation marks or no quotation marks, TSO/E adds your prefix to the data set name.
x = SYSDSN('myrexx.exec')
x = SYSDSN(myrexx.exec)

Variable name that represents a fully-qualified or non fully-qualified data set name — The variable name must not be enclosed in quotation marks because quotation marks prevent variable substitution.
variable = "exec"
x = SYSDSN(variable) /* looks for 'userid.exec' */
y = SYSDSN('variable') /* looks for 'userid.variable' */
z = SYSDSN("'"variable"'") /* looks for 'exec' */


so, try: b=sysdsn('''USERID.COPYLIB.PDS(MEMBER)''')
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 How to copy the -1 version of a membe... TSO/ISPF 4
No new posts Searching for a member but don't know... TSO/ISPF 6
No new posts Looking For a PDS Member Without Open... PL/I & Assembler 10
No new posts Library member auto insert option TSO/ISPF 3
No new posts DataSet member creation failed with B... Java & MQSeries 15
Search our Forums:

Back to Top