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

Check existance for GDG Base using LISTDSI


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

New User


Joined: 16 Jul 2007
Posts: 8
Location: chennai

PostPosted: Tue Jul 17, 2007 4:17 pm
Reply with quote

I have problem for checking existance for GDG Base using LISTDSI

I gave If LISTDSI(GDGBASE name) = 'ok' for checking the existance

Even though my base exists , its not satisfying the above condition

B = "userid.SH'"
C = LISTDSI(B) ----------> RC for C is 16
IF LISTDSI(B) = 'OK' THEN ----------> This condition is not satisfied
SAY 'OK'
ELSE
SAY 'NOT OK'

Please help me in this regard
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jul 17, 2007 5:09 pm
Reply with quote

Issue the same commands that you would use with IDCAMS, but don't forget to enclose it all in nice double quotes.
Back to top
View user's profile Send private message
shantipriya

New User


Joined: 16 Jul 2007
Posts: 8
Location: chennai

PostPosted: Tue Jul 17, 2007 6:47 pm
Reply with quote

Following are the set of command I use for creating GDG Base using IDCALMS in Rexx.

So when the Base already exists , I thought of trapping the error messages issued by the IDCAMS and check for duplicate error - This would indicate if Base already exists

But OUTTRAP is not working when I issue in the following way to trap the messages

"ALLOC DD(SYSPRINT) DA(*) REU"
"ALLOC DD(SYSIN) NEW REU"
CALL OUTTRAP 'STEM.', 1000
QUEUE " DEFINE GDG(NAME(IUAXQQQ.PR) LIM(3) SCR)"
"EXECIO "QUEUED()" DISKW SYSIN (FINIS"
"CALL *(IDCAMS)"
"FREE DD(SYSPRINT SYSIN)"
CALL OUTTRAP 'OFF'

Please guide me how i could trap the duplicate error message issued
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Jul 17, 2007 7:53 pm
Reply with quote

Odd. It worked for me:

Code:

/* REXX */                                   
x = Outtrap(n.)                             
"DEFINE GDG (NAME('IUAXQQQ.PR') 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                                       
Back to top
View user's profile Send private message
shantipriya

New User


Joined: 16 Jul 2007
Posts: 8
Location: chennai

PostPosted: Tue Jul 17, 2007 10:01 pm
Reply with quote

Thanks a lot,

I was using below lines for creating GDG Base using call IDCAMS . For this , OUTTRAP is not working . Anyway thanks, what you provided is useful to me and i am able to trap the error message.

X = OUTTRAP(N.)
"ALLOC DD(SYSPRINT) DA(*) REU"
"ALLOC DD(SYSIN) NEW REU"
QUEUE " DEFINE GDG(NAME('IUAXQQQ.PR') LIM(3) SCR)"
"EXECIO "QUEUED()" DISKW SYSIN (FINIS"
"CALL *(IDCAMS)"
"FREE DD(SYSPRINT SYSIN)"
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
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 SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts How to check whether who renamed the ... JCL & VSAM 3
No new posts No ++JCLIN, APPLY CHECK job JCL & VSAM 1
No new posts EMPTY file check scenario JCL & VSAM 6
Search our Forums:

Back to Top