Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Check existance for GDG Base using LISTDSI

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Check existance for GDG Base using LISTDSI
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: 8593
Location: Back in jolly old England

PostPosted: Tue Jul 17, 2007 5:09 pm    Post subject:
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    Post subject: Re: Check existance for GDG Base using LISTDSI
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

Moderator Team Head


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

PostPosted: Tue Jul 17, 2007 7:53 pm    Post subject: Re: Check existance for GDG Base using LISTDSI
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    Post subject: Re: Check existance for GDG Base using LISTDSI
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Syntax to check the first 4 digits of... kshirabdhi DFSORT/ICETOOL 10 Tue May 03, 2016 12:21 pm
No new posts Check special resource availability w... pinimo JCL & VSAM 8 Fri Apr 15, 2016 8:18 pm
No new posts check nth row from a PS file bachi234 DFSORT/ICETOOL 2 Fri Feb 19, 2016 5:31 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us