Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exec to write command output

128 views
Skip to first unread message

Jake Anderson

unread,
Feb 14, 2018, 3:08:16 PM2/14/18
to
Hi

Does anyone have a sample rexx exec which reads any command and writes to a
PS dataset temporarily ?

Like LISTC ENT(/) ALL being written to a PS

Jake

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Grinsell, Don

unread,
Feb 14, 2018, 3:11:23 PM2/14/18
to
Can you use outtrap to capture the command output into a stem and then execio to write that stem to a file?

--

Donald Grinsell, Systems Programmer
Enterprise Technology Services Bureau
SITSD/Montana Department of Administration
406.444.2983 (D)


"If you think training is expensive, try ignorance."
~ Peter Drucker

Dyck, Lionel B. , TRA

unread,
Feb 14, 2018, 3:14:53 PM2/14/18
to
Try this code http://lbdsoftware.com/tsotrap.zip

--------------------------------------------------------------------------
Lionel B. Dyck <sdg><
Mainframe Systems Programmer - TRA

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Jake Anderson
Sent: Wednesday, February 14, 2018 2:08 PM
To: TSO-...@VM.MARIST.EDU

Paul Gilmartin

unread,
Feb 14, 2018, 4:00:34 PM2/14/18
to
On 2018-02-14, at 13:10:01, Grinsell, Don wrote:

> Can you use outtrap to capture the command output into a stem and then execio to write that stem to a file?
>
Or, EXEC PGM=IKJEFT*, with SYSTSPRT allocated to a data set?

>> -----Original Message-----
>> From: Jake Anderson
>> Sent: Wednesday, February 14, 2018 1:08 PM
>>
>> Does anyone have a sample rexx exec which reads any command and writes to a
>> PS dataset temporarily ?
>>
>> Like LISTC ENT(/) ALL being written to a PS

-- gil

Patrick R Kirby/SCO

unread,
Feb 14, 2018, 4:15:53 PM2/14/18
to
If you are doing it in TSO you can use TSOV to put it into an ISPF
session. The script could also be modified to put the output into a
dataset. Or you could use cut and paste.



/* REXX TSOV */
/* */
/* AUTHOR: MARK ZELDIN */
/* external routines: alldSn - ALLOCATE A DDNAME TEMP */
/* DATASET */
/* */
/* TRACE ?I */
IF SYSVAR(SYSISPF) = "ACTIVE"
THEN NOP
ELSE
CALL ERROR
ARG TSOCMD
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"

ADDRESS TSO
/* */
ddnm = alldsn("SPACE=150,150")
/* */
/* */
/* ISSUE TSO COMMND(S) AND TRAP OUTPUT */
/* */
JUNK=OUTTRAP(LINE.)
TSOCMD
JUNK=OUTTRAP('OFF')
/* */
"EXECIO" LINE.0 "DISKW" DDNM "(STEM LINE. FINIS"
ADDRESS ISPEXEC "LMINIT DATAID(TEMP) DDNAME("||DDNM||")"
ADDRESS ISPEXEC "VIEW DATAID("||TEMP") MACRO(RESET) CONFIRM(NO)"
ADDRESS ISPEXEC "LMFREE DATAID("||TEMP")"
JUNK = MSG(OFF)
"FREE FI("||DDNM||")"
RETURN
/* --ERROR ------------------------------ */
ERROR:
SAY "* ---------------------------- *"
SAY "* INVALID ENVIRONMENT FOR TSOV *"
SAY "* ---------------------------- *"
EXIT 12



Patrick Kirby
Sr Systems Programmer
Idaho State Controllers Office
208-332-8760

Jake Anderson

unread,
Feb 15, 2018, 1:59:13 PM2/15/18
to
Hi Lionel

I got your tsotrap but how do I issue for a listcat ?

When I ran for tsotrap -b time

Line 104 routine not found

Jesse 1 Robinson

unread,
Feb 16, 2018, 11:07:59 AM2/16/18
to
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


James Campbell

unread,
Feb 16, 2018, 8:07:20 PM2/16/18
to
Not to disparage the other responses you have had, but LISTCAT (which you referred to
specifically) has an OUTFILE parameter which does this.

James Campbell

Paul Gilmartin

unread,
Feb 16, 2018, 8:34:23 PM2/16/18
to
On 2018-02-16, at 18:05:54, James Campbell wrote:

> Not to disparage the other responses you have had, but LISTCAT (which you referred to
> specifically) has an OUTFILE parameter which does this.
>
That's one. What about all the others?

> On 15 Feb 2018 at 1:37, Jake Anderson wrote:
>>
>> Does anyone have a sample rexx exec which reads any command and writes to a
>> PS dataset temporarily ?

-- gil
0 new messages