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
 

 

To write OUTTRAP data into local dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: To write OUTTRAP data into local dataset
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

Site Director


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

PostPosted: Thu Oct 30, 2008 6:54 am    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Oct 30, 2008 7:15 am    Post subject: Reply to: To write OUTTRAP data into local dataset
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    Post subject:
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    Post subject: Re: Reply to: To write OUTTRAP data into local dataset
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: 73
Location: Mysore

PostPosted: Thu Oct 30, 2008 11:32 am    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Oct 30, 2008 12:57 pm    Post subject:
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    Post subject:
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    Post subject:
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    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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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