View previous topic :: View next topic
|
Author |
Message |
HameedAli
Active User
Joined: 16 Apr 2009 Posts: 151 Location: India
|
|
|
|
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 |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Use this
Code: |
ISOK=SYSDSN('LQ.SLQ.TLQ(SAMPLE)')
IF ISOK = "OK" THEN
address ispexec
"Browse Dataset('LQ.SLQ.TLQ(Sample)') "
|
|
|
Back to top |
|
|
craig2020
New User
Joined: 30 Jan 2007 Posts: 7 Location: Chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Try running with TRACE I and following the flow to see if that fgives you a clue. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
|