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

How to find the existence of GDG base without creating it...


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

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Tue Sep 29, 2009 1:06 pm
Reply with quote

Hi.

I want to know whether the GDG base is already existing or not. Here i dont want to create if it is not present.

I tried the following with the existing GDG base. But it is throwing return code of 16.

Code:

/* REXX */                                     
X = LISTDSI("'DUR3.VBGA.ACTY.DBKEY.FILE'")     
SAY 'FUNCTION CODE FROM LISTDSI IS:     ' X   


Before that i tried using IDCAMS. But it creates the base if it is not present.
Code:

/* REXX */                                                     
X = OUTTRAP(N.)                                                 
"DEFINE GDG (NAME('DUR3.VBGA.ACTY.DBKEY.FILE1') LIM(3) SCR)"   
X = OUTTRAP(OFF)                                               
DO I = 1 TO N.0                                                 
  ERR = POS("DUPLICATE DATA SET NAME",N.I)                     
 IF ERR <> 0 THEN SAY N.I                                       
END                                                             
EXIT 0                                                         


Any body please share your thoughts...

Thanks
R KARTHIK
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Sep 29, 2009 1:47 pm
Reply with quote

LISTCAT
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Tue Sep 29, 2009 2:50 pm
Reply with quote

Hi,

Thanx expat.

I tried the following and it is working.

Code:

/* REXX */                                             
"LISTCAT ENT('"DUR3.VBGA.ACTY.DBKEY.FILE"') GDG ALL"   


Thanks
R KARTHIK
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 To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Creating Unix Directory using COBOL i... COBOL Programming 2
No new posts Creating Report using SORT DFSORT/ICETOOL 7
No new posts Creating CSV file from Variable recs ... DFSORT/ICETOOL 11
Search our Forums:

Back to Top