Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
OUTTRAP Equivalent function in CLIST

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
upendrasri

New User


Joined: 28 Sep 2017
Posts: 99
Location: India

PostPosted: Thu Mar 12, 2020 12:12 pm    Post subject: OUTTRAP Equivalent function in CLIST
Reply with quote

Hi All,

Am using below CLIST to get LISTCAT details of a dataset
Code:

PROC 1 FOO                 
LISTCAT ENTRIES(&FOO) ALL   
END                         


The above CLIST works fine but output populated in mainframe screen. I want to capture the output in a file.

I know in REXX we can do that using OUTTRAP Function. Do we have any equivalent function in CLIST?

Thanks!
Back to top
View user's profile Send private message

enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10662
Location: italy

PostPosted: Thu Mar 12, 2020 1:27 pm    Post subject: Reply to: OUTTRAP Equivalent function in CLIST
Reply with quote

the chances of getting help on CLIST issues are pretty slim,
when using rexx is a better alternative
Back to top
View user's profile Send private message
upendrasri

New User


Joined: 28 Sep 2017
Posts: 99
Location: India

PostPosted: Thu Mar 12, 2020 1:54 pm    Post subject:
Reply with quote

Hi Enrico,

Yes.. Am totally agree with you. Since we have old CLIST's in our environment and some times we may have to modify them as per the new requirements .
So thought of grabbing some knowledge on CLIST.

Thanks!
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 147
Location: Germany

PostPosted: Thu Mar 12, 2020 3:50 pm    Post subject:
Reply with quote

@upendrasri: Have a look here to get a clue https://stackoverflow.com/questions/3479772/can-clist-access-pds-member-and-gdg-file
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 795
Location: The Universe

PostPosted: Thu Mar 12, 2020 8:00 pm    Post subject:
Reply with quote

Yes, there is an OUTTRAP idea in CLIST to spool command output in storage. It works much the same as in Rexx; you specify you want it done; run your command, and then you can retrieve the lines.

Regardless of Rexx or CLIST, OUTTRAP only works when the output is coming directly from the command using standard TSO services. LISTCAT works well because it's a TSO command writing output to the terminal using TSO services rather than lower level services.

Look in z/OS TSO/E CLISTs for your z/OS release. Try this link.

For example -
Code:
00100 PROC 0
00200 CONTROL LIST
00300 SET &SYSOUTTRAP = 500
00400 LISTC LE(XXX.ZJ)
00500 SET SYSOUTTRAP = 0
00600 SET J = &SYSOUTLINE
00700 WRITE J = &J
00800 IF &J > 0 THEN +
00900  DO &I = 1 TO &J BY 1
01000   SET Z = &STR(&&SYSOUTLINE&I)
01100   WRITE &STR(&Z)
01200  END

Rexx - not that I'm a big fan of Rexx - is usually better than CLIST for this type of stuff. It took me far too long to create the example by cribbing from the example in the manual. The SET Z = &STR(&&SYSOUTLINE&I) line is far from intuitive!
Back to top
View user's profile Send private message
upendrasri

New User


Joined: 28 Sep 2017
Posts: 99
Location: India

PostPosted: Thu Mar 12, 2020 10:09 pm    Post subject:
Reply with quote

Hi Joerg and Steve,

Thank you for your time and suggestions. Above code is exactly working as expected.

Thanks!
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 Rexx STRIP Equivalent function in CLIST upendrasri CLIST & REXX 5 Mon Mar 16, 2020 9:57 pm
No new posts Dynamically adding CLIST Library to e... upendrasri TSO/ISPF 12 Sat Mar 14, 2020 4:33 pm
No new posts Love it here, But what is the equival... karthik_sripal General Talk & Fun Stuff 1 Fri Jan 24, 2020 11:59 pm
No new posts ADDMONS function - conclusion after o... sergeyken SYNCSORT 1 Tue Nov 12, 2019 9:54 pm
This topic is locked: you cannot edit posts or make replies. ADDMONS function rnimmala SYNCSORT 24 Fri Nov 08, 2019 8:55 pm

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