View previous topic :: View next topic
|
Author |
Message |
shantipriya
New User
Joined: 16 Jul 2007 Posts: 8 Location: chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
shantipriya
New User
Joined: 16 Jul 2007 Posts: 8 Location: chennai
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
shantipriya
New User
Joined: 16 Jul 2007 Posts: 8 Location: chennai
|
|
|
|
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 |
|
|
|