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

To write OUTTRAP data into local dataset


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

New User


Joined: 17 Oct 2008
Posts: 18
Location: USA

PostPosted: Thu Oct 30, 2008 6:46 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Oct 30, 2008 6:54 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Oct 30, 2008 7:15 am
Reply with quote

The REXX code beyond the LISTCAT command is completely wrong. Do you know how to write programs in REXX?
Back to top
View user's profile Send private message
Selva0202

New User


Joined: 17 Oct 2008
Posts: 18
Location: USA

PostPosted: Thu Oct 30, 2008 7:15 am
Reply with quote

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
View user's profile Send private message
Selva0202

New User


Joined: 17 Oct 2008
Posts: 18
Location: USA

PostPosted: Thu Oct 30, 2008 7:20 am
Reply with quote

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
View user's profile Send private message
rexx77

New User


Joined: 14 Apr 2008
Posts: 78
Location: Mysore

PostPosted: Thu Oct 30, 2008 11:32 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Oct 30, 2008 12:57 pm
Reply with quote

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
View user's profile Send private message
Selva0202

New User


Joined: 17 Oct 2008
Posts: 18
Location: USA

PostPosted: Thu Oct 30, 2008 4:38 pm
Reply with quote

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
View user's profile Send private message
Selva0202

New User


Joined: 17 Oct 2008
Posts: 18
Location: USA

PostPosted: Thu Oct 30, 2008 4:41 pm
Reply with quote

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
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 Store the data for fixed length COBOL Programming 1
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top