View previous topic :: View next topic
|
Author |
Message |
upendrasri
Active User
Joined: 28 Sep 2017 Posts: 124 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
the chances of getting help on CLIST issues are pretty slim,
when using rexx is a better alternative |
|
Back to top |
|
|
upendrasri
Active User
Joined: 28 Sep 2017 Posts: 124 Location: India
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
upendrasri
Active User
Joined: 28 Sep 2017 Posts: 124 Location: India
|
|
|
|
Hi Joerg and Steve,
Thank you for your time and suggestions. Above code is exactly working as expected.
Thanks! |
|
Back to top |
|
|
|