View previous topic :: View next topic
|
Author |
Message |
Selva0202
New User
Joined: 17 Oct 2008 Posts: 18 Location: USA
|
|
|
|
Greetings
I had requirement to retrieve the list of generations available in a partifular GDG and write them on local dataset.
The following is the REXX code which I tried.
Code: |
/* REXX */
/* SAY TRACE('?I') */
ADDRESS TSO
"ALLOC DA('LOCAL.DSN.TEST') FILE(OUTDD) OLD REUSE"
"EXECIO * DISKR OUTDD (FINIS STEM OUT."
A = OUTTRAP("X.","*")
"LISTCAT ENTRIES('K.DB.DBP1.FDE2006D.CIN2006S.IC')"
CALL OUTTRAP "OFF"
DO L = 1 TO X.0
IF WORD(X.L,1) <> "NONVSAM" THEN ITERATE
OUT = RIGHT(X.L,40)
"EXECIO * DISKW OUTDD (FINIS STEM OUT."
SAY OUT
END |
OUTPUT
-------
Code: |
K.DB.DBP1.FDE2006D.CIN2006S.IC.G6087V00
K.DB.DBP1.FDE2006D.CIN2006S.IC.G6088V00
K.DB.DBP1.FDE2006D.CIN2006S.IC.G6089V00
K.DB.DBP1.FDE2006D.CIN2006S.IC.G6090V00
K.DB.DBP1.FDE2006D.CIN2006S.IC.G6091V00
K.DB.DBP1.FDE2006D.CIN2006S.IC.G6092V00
K.DB.DBP1.FDE2006D.CIN2006S.IC.G6093V00
K.DB.DBP1.FDE2006D.CIN2006S.IC.G6094V00
K.DB.DBP1.FDE2006D.CIN2006S.IC.G6095V00
K.DB.DBP1.FDE2006D.CIN2006S.IC.G6096V00 |
Problem in writing these output in the local dataset.
Can someone will help me in this?
- Selva
Edited: Please use BBcode when You post some code, that's rather readable...Anuj |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Problem in writing these output in the local dataset.
Can someone will help me in this? |
For us to be better able to help, you need to post what error(s) occurred or what else the problem is. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
The REXX code beyond the LISTCAT command is completely wrong. Do you know how to write programs in REXX? |
|
Back to top |
|
|
Selva0202
New User
Joined: 17 Oct 2008 Posts: 18 Location: USA
|
|
|
|
I get RC=0 and OUTPUT as expected.
But as I stated early not able to write these output in the local dataset.
Am not sure what kind of mistake I did in this code.
My requirement is to write these output of OUTTRAP needs to be written in the local dataset with the desired format.
Please let me know for any clarification
- Selva |
|
Back to top |
|
|
Selva0202
New User
Joined: 17 Oct 2008 Posts: 18 Location: USA
|
|
|
|
superk wrote: |
The REXX code beyond the LISTCAT command is completely wrong. Do you know how to write programs in REXX? |
Hi there,
Unfortunately, I didnt find anything wrong in that. Could you please correct that where am wrong?
-Selva |
|
Back to top |
|
|
rexx77
New User
Joined: 14 Apr 2008 Posts: 78 Location: Mysore
|
|
|
|
Selva,
i have modified your code little bit.. it is working fine for me. please check it out with below code
Code: |
/*REXX*/
TRACE I
USER = USERID()
ADDRESS TSO
"ALLOC DA(DSN.TEST) FILE(OUTDD) NEW REUSE LRECL(80) RECFM(F,B)"
A = OUTTRAP("X.","*")
"LISTCAT ENTRIES('GDG.DSN')"
CALL OUTTRAP "OFF"
I = 1
DO L = 1 TO X.0
IF WORD(X.L,1) <> "NONVSAM" THEN ITERATE
ELSE
DO
OUT.I= RIGHT(X.L,40)
I = I + 1
END
END
"EXECIO * DISKW OUTDD (FINIS STEM OUT."
EXIT 0
|
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Don't understand why people want to maintain counts of output stems when queue takes away that pain.
Code: |
DO L = 1 TO X.0
PARSE VAR X.L W1 W2 W3 .
IF W1 = "NONVSAM" THEN QUEUE W3
END
"EXECIO "QUEUED()" DISKW OUTDD (FINIS"
|
|
|
Back to top |
|
|
Selva0202
New User
Joined: 17 Oct 2008 Posts: 18 Location: USA
|
|
|
|
Quote: |
[quote="expat"]Don't understand why people want to maintain counts of output stems when queue takes away that pain. |
Yeah, it works too...!
Thanks for your attention in this
-Selva |
|
Back to top |
|
|
Selva0202
New User
Joined: 17 Oct 2008 Posts: 18 Location: USA
|
|
|
|
Quote: |
i have modified your code little bit.. it is working fine for me. please check it out with below code |
You the Man...!
It works fine for the me and thanks a lot for your help.
-Selva |
|
Back to top |
|
|
|