The 'out trap function' works for CLIST (originally) and for REXX. However, it can trap *only* PUTLINE messages. It cannot trap TPUT. Having written both, I can say that TPUT is simpler to code than PUTLINE, but result of TPUT is not trappable. Almost all 'traditional' IBM TSO commands use PUTLINE, but ISV and shareware commands may not. Certainly full/formatted screen output uses TPUT.
.
.
J.O.Skip Robinson
Southern California Edison Company
Electric Dragon Team Paddler
SHARE MVS Program Co-Manager
323-715-0595 Mobile
626-543-6132 Office ⇐=== NEW
robi...@sce.com
-----Original Message-----
From: TSO REXX Discussion List [mailto:
TSO-...@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Thursday, February 15, 2018 8:51 PM
To:
TSO-...@VM.MARIST.EDU
Subject: (External):Re: [TSO-REXX] [EXTERNAL] [TSO-REXX] Exec to write command output
On 2018-02-15, at 18:08:21, John McKown wrote:
>
> LISTC ENT(some.dsn) ALL OUTFILE(REPORT)
>
I suspect the OP wanted to do this for an arbitrary command, not only LISTCAT. And many commands, unlike LISTCAT, have no
OUTFILE() option.
There's OUTTRAP (Rexx only?) and TPUT may be harder to trap than PUTLINE. Don't know about PUTGET.
I avoid TSO as much as possible.
(Is LISTCAT a wrapper for an IDCAMS command?)
(UNIX is relatively nice. You can redirect almost anything. And it's not an option of the command but a facility of the monitor)
In Rexx under OMVS:
address TSO some-command
address TSO logoff
..while redirecting the output of the EXEC >REPORT
-- gil