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

REXX help

7 views
Skip to first unread message

Manning, Rick F.

unread,
Feb 20, 2001, 3:21:57 PM2/20/01
to
I am fairly new to REXX. I am trying to call a user written program, and
trap the output. The program processes commands. In this case, I am
listing jobs in the JES2 input queue for class 'O'. I must pass a parm to
the program indicating the command. Below is an example of the JCL to run
the program in batch.

//JS010 EXEC PGM=COMMAND,ACCT=4CMC7D,
// PARM='$DN,Q=XEQO'
//STEPLIB DD DSN=SYS1.IPC.AUTHLIB,DISP=SHR
//SYSPRINT DD SYSOUT=Y
//SYSOUT DD DISP=SHR,DSN=IMSVSPA.MPRLIST
//*

Is there an easy was to code a REXX to call the program, pass a parm, and
finally trap the output in a sequential or PDS member?.

Any input would be appreciated.

Rick Manning
OTS - Mainframe Platform IMS Support
(972) 604-5359 (8-834)
rickf....@eds.com

Jeremy C B Nicoll

unread,
Feb 20, 2001, 3:52:43 PM2/20/01
to
On 20 Feb, "Manning, Rick F." <rickf....@EDS.COM> wrote:
> I am fairly new to REXX. I am trying to call a user written program,
> and trap the output. The program processes commands. In this case, I
> am listing jobs in the JES2 input queue for class 'O'. I must pass a
> parm to the program indicating the command. Below is an example of the
> JCL to run the program in batch.

> //JS010 EXEC PGM=COMMAND,ACCT=4CMC7D,
> // PARM='$DN,Q=XEQO'
> //STEPLIB DD DSN=SYS1.IPC.AUTHLIB,DISP=SHR
> //SYSPRINT DD SYSOUT=Y
> //SYSOUT DD DISP=SHR,DSN=IMSVSPA.MPRLIST
> //*

> Is there an easy was to code a REXX to call the program, pass a parm,
> and finally trap the output in a sequential or PDS member?.

> Any input would be appreciated.

This is the sort of thing usually done by the mainframe automation team
(or whoever). they can issue operator commands and trap (and act on) the
response. For a program that does it, SVC 34 is not enough, you have to
provide a virtual (subsys) console for the response to be displayed
in/on. IBM's SA390 (AOC etc) code basically works that way - or uses the
MVS SSI to see commands & responses. Most manufacturers products do the
same sort of thing - eg B&B IMF has auto-ops features.

You might be able to do it under TSO using the TSO CONSOLE command (which
dynamically defines a tso terminal as a console - but it might be
disabled at your site).

--
Jeremy C B Nicoll - my opinions are my own.

Schwarz, Barry A

unread,
Feb 20, 2001, 4:27:22 PM2/20/01
to
You can try something like the following:
address tso
"alloc fi(sysprint) ..." /* vio would do nicely */
"alloc fi(sysout) da('imsvspa.mprlist') old" /* don't write to shr */
"call 'sys1.ipc.authlib(command)' '$dn,q=xeqo'

Based on your dsn, I would expect you may need to update the AUTHPGM or AUTHTSF parameters in SYS1.PARMLIB(IKJTSOxx).

When the program returns to your rexx, you can scan the sysprint for error messages or whatever and then process the sysout data.


Barry Schwarz
OS/390 Systems Programmer
Phone: 253-773-4221
Fax: 253-773-2099
Mail stop: 80-JC
e-mail: barry.a...@boeing.com


> ----------
> From: Manning, Rick F.[SMTP:rickf....@EDS.COM]
> Reply To: TSO REXX Discussion List
> Sent: Tuesday, February 20, 2001 12:11 PM
> To: TSO-...@VM.MARIST.EDU
> Subject: REXX help


>
> I am fairly new to REXX. I am trying to call a user written program, and
> trap the output. The program processes commands. In this case, I am
> listing jobs in the JES2 input queue for class 'O'. I must pass a parm to
> the program indicating the command. Below is an example of the JCL to run
> the program in batch.
>
> //JS010 EXEC PGM=COMMAND,ACCT=4CMC7D,
> // PARM='$DN,Q=XEQO'
> //STEPLIB DD DSN=SYS1.IPC.AUTHLIB,DISP=SHR
> //SYSPRINT DD SYSOUT=Y
> //SYSOUT DD DISP=SHR,DSN=IMSVSPA.MPRLIST
> //*
>
> Is there an easy was to code a REXX to call the program, pass a parm, and
> finally trap the output in a sequential or PDS member?.
>
> Any input would be appreciated.
>

Ben Cowan

unread,
Feb 20, 2001, 4:35:23 PM2/20/01
to
> > Is there an easy was to code a REXX to call the program, pass a parm,
> > and finally trap the output in a sequential or PDS member?.
>
> > Any input would be appreciated.
>
>

I wrote this before we had automation, to start a packet trace because
I couldn't remember all the commands!

It issues commands and answers replies assuming you have CONSOLE
setup...


//PTSTART JOB (SCS),MSGCLASS=X
//STEP1 EXEC PGM=ICEGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
/* REXX */

TRACE('E')

DSN="'ASYTCPP.PTRACE.DATA'"
IF (SYSDSN(DSN) == OK) THEN DELETE DSN

CART = TIME(S)
RC = MVSCMD("TRACE CT,WTRSTART=PTTCP,WRAP")
RC = MVSCMD("V TCPIP,,PKTTRACE,CLEAR")
RC = MVSCMD("V TCPIP,,PKTTRACE,FULL,IP=131.216.49.54")
RC = MVSCMD("TRACE CT,ON,COMP=SYSTCPDA,SUB=(TCPIP)")
RC = REPLY("WTR=PTTCP,END")
EXIT

MVSCMD:
PARSE ARG CMD
"CONSPROF SOLDISPLAY(NO) UNSOLDISPLAY(NO)"
"CONSOLE ACTIVATE CART('"CART"')"

"CONSOLE SYSCMD("CMD")"
CMDRC = RC
MC = GETMSG('MOUT.','SOL',CART,,5)
IF (MC == 0) THEN DO
DO I=1 TO MOUT.0
SAY MOUT.I
END
END

"CONSOLE DEACTIVATE"
"CONSPROF SOLDISPLAY(YES) UNSOLDISPLAY(YES)"
RETURN CMDRC

REPLY:
PARSE ARG RESPONSE
REPLY.1 = "ITT006A"
REPLY.1.RESPONSE = RESPONSE
REPLY.0 = 1

CMD = "D R,M,CN=(ALL)"
"CONSPROF SOLDISPLAY(NO) UNSOLDISPLAY(NO)"
"CONSOLE ACTIVATE CART('"CART"')"

"CONSOLE SYSCMD("CMD")"
MC = GETMSG('MOUT.','SOL',CART,,5)
IF (MC == 0) THEN DO
DO I=1 TO MOUT.0
PARSE VAR MOUT.I MSGNO R NNN MSGCODE MSGAPPL MSG .
IF (R = 'R') THEN DO
DO J=1 TO REPLY.0
IF (MSGCODE == REPLY.J) THEN DO
CMD = "R "||MSGNO||","||REPLY.J.RESPONSE
"CONSOLE SYSCMD("CMD")"
RPLYRC = RC
END
END
END
END
END

"CONSOLE DEACTIVATE"
"CONSPROF SOLDISPLAY(YES) UNSOLDISPLAY(YES)"
RETURN RPLYRC
//SYSUT2 DD DSN=&&REXX(CTRACE),DISP=(,PASS),
// UNIT=SYSDA,SPACE=(TRK,(3,3,3)),RECFM=FB,LRECL=80
//STEP2 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD DSN=USSRBC1.CTRACE.TEMP,DISP=(MOD,KEEP)
//SYSPROC DD DSN=&&REXX,DISP=(OLD,PASS)
//SYSTSIN DD *
%CTRACE

Jeremy C B Nicoll

unread,
Feb 20, 2001, 4:48:24 PM2/20/01
to
On 20 Feb, Ben Cowan <bco...@NEVADA.EDU> wrote:
> > > Is there an easy was to code a REXX to call the program, pass a
> > > parm, and finally trap the output in a sequential or PDS member?.
> >
> > > Any input would be appreciated.

[snip sample exec]

Just bear in mind that console authority is not given to many people at
most/some sites.

Jeremy C B Nicoll

unread,
Feb 20, 2001, 4:56:17 PM2/20/01
to
On 20 Feb, "Schwarz, Barry A" <Barry....@PSS.BOEING.COM> wrote:
> You can try something like the following:
> address tso
> "alloc fi(sysprint) ..." /* vio would do nicely */
> "alloc fi(sysout) da('imsvspa.mprlist') old" /* don't write to shr */
> "call 'sys1.ipc.authlib(command)' '$dn,q=xeqo'

Why would you expect to see any of the jes command response?

Manning, Rick F.

unread,
Feb 20, 2001, 6:05:14 PM2/20/01
to
I am trying to clean up duplicate jobs in the input queue before the JES2
initiators are started.

Rick Manning
OTS - Mainframe Platform IMS Support
(972) 604-5359 (8-834)
rickf....@eds.com

Ben Cowan

unread,
Feb 20, 2001, 6:30:23 PM2/20/01
to
Jeremy C B Nicoll wrote:

>
> Just bear in mind that console authority is not given to many people at
> most/some sites.
>
> --
> Jeremy C B Nicoll - my opinions are my own.

Exactly.

I didn't have it. That's why I had to put it in SYS1.PROCLIB
and submit it such that it ran under a user with CONSOLE
authority. Otherwise you don't need the JCL...

I agree with your first suggestion. Use a real automation tool.

Regards,

Ben Cowan

Jeremy C B Nicoll

unread,
Feb 20, 2001, 6:36:35 PM2/20/01
to
On 20 Feb, "Manning, Rick F." <rickf....@EDS.COM> wrote:
> I am trying to clean up duplicate jobs in the input queue before the
> JES2 initiators are started.

Why would you expect to see any of the jes command response?

No - what I meant is, why would you expect the batch pgm you are running
to receive command responses at all? I know perfectly well what the
command is for. In your case I assume IMS log archive jobs (we use
aoc to bin any duplicates as soon as such a job starts to run).

- -

unread,
Feb 21, 2001, 8:19:06 AM2/21/01
to
On Tue, 20 Feb 2001 at 16:24:28 -0600, rickf....@EDS.COM posted:

>I am trying to clean up duplicate jobs in the input
>queue before the JES2 initiators are started.

I haven't used it in years, but batch SDSF might work
better for you? Set a PREfix, set maximum lines per page,
and issue: IO
Parsing the output would be easy.

0 new messages