Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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 ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts retrieving envelope information out o... VintageReceiver TSO/ISPF 6 Thu Aug 10, 2017 8:13 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us