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

verify if lib exists


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

New User


Joined: 01 Apr 2009
Posts: 33
Location: Rome - Italy

PostPosted: Wed Nov 04, 2009 6:21 pm
Reply with quote

hi all.

i have a clist that modify the members of a lib...
it's all ok but i have only a little problem:
first, my clist asks the name of lib... if it exists it's ok, but if it not exists the clist goes abend...
In this case i don't want end the clist but i want open another lib...

There is a command to verify if a lib exist first to open it?

EXCUSE ME FOR MY ENGLISH...
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Nov 04, 2009 6:35 pm
Reply with quote

Take a look at SYSDSN
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Nov 04, 2009 6:35 pm
Reply with quote

Hi,

LISTDSI should be able to help you,
check the variable X. if 0 continue processing, if 16 skip to next dataset.

Code:
/*REXX*/                                                         
VAR1="XK89.DREAM.CNTL4"                                         
VAR4 = STRIP("'"VAR1"'")                                         
X = LISTDSI(VAR4)                                               
SAY 'X IS 0 IF DATASET EXISTS, 16 IF ITS NOT FOUND. X IS' X     
EXIT     


Hope this helps icon_biggrin.gif

Thanks & Regards,
Back to top
View user's profile Send private message
Seppe

New User


Joined: 01 Apr 2009
Posts: 33
Location: Rome - Italy

PostPosted: Wed Nov 04, 2009 6:38 pm
Reply with quote

can i use this command in clist?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Nov 04, 2009 6:42 pm
Reply with quote

Hi,

Oops I did not notice that you mentioned CLIST in the initial post.
I am not aware if it can be used in CLIST.

I think it will work I guess,

A google of CLIST + LISTDSI gives,

publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.ikjb800/a26230.htm

Regards,
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 do i verify the char field is hav... PL/I & Assembler 1
No new posts Start CICS but A STORAGE SHORTAGE EXISTS CICS 2
No new posts Verify WITH UR present inside program... CLIST & REXX 23
This topic is locked: you cannot edit posts or make replies. How to verify Retention of a Vsam dat... JCL & VSAM 4
No new posts TAPE VERIFY utility?? JCL & VSAM 3
Search our Forums:

Back to Top