Question about SYSDSN



IBM's Command List programming language & Restructured Extended Executor

Question about SYSDSN

Postby anand4u237 » Fri Jun 28, 2013 12:44 am

Hey guys,

I came to know that SYSDSN can be used to verify whether a dataset can be existing or not. Can anybody explain a little about it and how can I use it in programming to find out a dataset is found or not.

Thanks
anand
anand4u237
 
Posts: 15
Joined: Mon May 17, 2010 12:05 pm
Location: India
Has thanked: 4 times
Been thanked: 0 time

Re: Question about SYSDSN

Postby Akatsukami » Fri Jun 28, 2013 1:01 am

SYSDSN is a Rexx TSO/E external function, and as such can be used in Rexx scripts running in the TSO environment (foreground or background). It returns a message describing the availability of the data set whose name is passsed to it as an argument. Read more about it, including all messages returned, here.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Question about SYSDSN

Postby NicC » Fri Jun 28, 2013 5:32 pm

I googled 'sysds' and the first page of results was full of links to the information that you need? So why did you post? After 2 years here you should know that the forum should be a place of 'last resort'.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Question about SYSDSN

Postby anand4u237 » Sun Jun 30, 2013 3:57 pm

Hi,

I am using the following code in my prog but it seems not working. Please help

Where &DSNAME = DATA.SET.LIB


IF &DATEFND = Y THEN +
IF SYSDSN("&DSNAME") # 'OK' THEN +
DO
SET &MESG = Dataset &DSNAME is not availabe for the mentioned date.


Thanks
Anand
anand4u237
 
Posts: 15
Joined: Mon May 17, 2010 12:05 pm
Location: India
Has thanked: 4 times
Been thanked: 0 time

Re: Question about SYSDSN

Postby NicC » Sun Jun 30, 2013 6:49 pm

You should know by now that "it is not working" means absolutely nothing unless you provide the information about HOW it is not working - syntax error, abending, wrong data returned or what.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Question about SYSDSN

Postby Akatsukami » Sun Jun 30, 2013 7:38 pm

Of course it is not working; the code you show is CLIST, and SYSDSN is a Rexx function. Learn the difference.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Question about SYSDSN

Postby steve-myers » Sun Jun 30, 2013 8:28 pm

Actually, it's not even proper CLIST. The topic starter should carefully read the topic for &SYSDSN (not SYSDSN) in TSO/E CLISTs for their z/OS release. I do not think # is a valid comparator in CLIST.

&SYSDSN returns text that can be used in a message. I would suggest something like this -

SET RC = &SYSDSN('&DSNAME')
IF &RC NE OK THEN +
WRITE &DSNAME: &RC

By using NE as a comparator the topic starter avoids the issue about the character set with his keyboard. Many 3270 emulators allow the ^ (Shift-6) character to be used in place of the EBCDIC ¬ character, but it may not be worth the effort.

These users thanked the author steve-myers for the post:
anand4u237 (Thu Jul 04, 2013 7:49 am)
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Question about SYSDSN

Postby steve-myers » Sun Jun 30, 2013 9:01 pm

For what it's worth, the wc3270 emulator is not a terminal emulator that let's you use the ^ character in place of the ¬ character, though it does display ¬ if it is present in data sent to it.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Question about SYSDSN

Postby anand4u237 » Thu Jul 04, 2013 7:52 am

Thanks a lot for the post Steve your solution works!
anand4u237
 
Posts: 15
Joined: Mon May 17, 2010 12:05 pm
Location: India
Has thanked: 4 times
Been thanked: 0 time

Re: Question about SYSDSN

Postby steve-myers » Thu Jul 04, 2013 9:45 am

Thanks for the update.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post