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

Batch REXX to launch COBOL/DB2 application programs

228 views
Skip to first unread message

Pete Wirfs

unread,
May 6, 2000, 3:00:00 AM5/6/00
to
Our production JCL runs TSO with these instream commands for each
COBOL/DB2 batch application:

//SYSTSIN DD *
DSN SYSTEM(<system>)
RUN PROGRAM(<program>) -
PARMS('<parm>') -
PLAN(<plan>)

I would really like to run a REXX that then launches the program. I
have been fairly close, and here is my JCL:

//STEP01 EXEC PGM=IKJEFT1B,

// PARM='%myrexx <system> <program> <plan> <parm>'

//SYSEXEC DD DSN=SDEV.PETWIR.REXX,DISP=SHR

//STEPLIB DD <lots_of_datasets>

//SYSPRINT DD SYSOUT=*

//SYSTSPRT DD SYSOUT=*

//SYSTSIN DD DUMMY


WHY AM I DOING THIS?
=======================
My goal is to set it up so that items like <system> would only have to
be coded once per job stream.
e.g. // SET SYSTEM=<system>
// SET PLAN=<plan>

("SET" variables can not be used by non-JCL cards.)


THE PROBLEM WITH MY SOLUTION IS:
==============================================
When the REXX issues the "RUN PROGRAM..." instruction, I get RC=0012
back and it doesn't work. My software support staff tell me that I
won't be able to accomplish this without purchasing a 3rd party vendor
product, like SmartCAF.


MY QUESTION IS:
===================================
Does anyone out there have a way to launch a COBOL/DB2 batch program
without using SYSTSIN cards to TSO?

Johnnie Hougaard Nielsen

unread,
May 7, 2000, 3:00:00 AM5/7/00
to
Pete Wirfs wrote:
> I would really like to run a REXX that then launches the program. I
> have been fairly close, and here is my JCL:
>
> //STEP01 EXEC PGM=IKJEFT1B,
> // PARM='%myrexx <system> <program> <plan> <parm>'

Looks feasible.

> When the REXX issues the "RUN PROGRAM..." instruction, I get RC=0012
> back and it doesn't work.

As RUN is a subcommand of the DSN command, you cannot issue RUN directly.

> My software support staff tell me that I
> won't be able to accomplish this without purchasing a 3rd party vendor
> product, like SmartCAF.

To me it sounds as if they assume that you want to EXEC PGM=<program>
without a Rexx driver program.

> Does anyone out there have a way to launch a COBOL/DB2 batch program
> without using SYSTSIN cards to TSO?

Something like this:

/* Rexx: Run DB2 program in batch */
Parse upper arg DB2ssid ProgName PlanName ProgParm
Address MVS "NEWSTACK"
Queue "RUN PROGRAM("ProgName") PLAN("PlanName") PARMS('"ProgParm"')"
Queue "END"
Address TSO "DSN SYSTEM("DB2ssid")"
DsnRC=RC
If DsnRC<>0 then
Say "DSN command failed RC="DsnRC
Address MVS "DELSTACK"
Exit DsnRC

Above code not tested, but I have used the queue technique for entering
subcommands several times.

The NEWSTACK/DELSTACK combo shout not be really needed in this short
program; but I prefer to code them whenever my Rexx programs use the
stack for own purposes.

Regards, Johnnie


Roland Schiradin

unread,
May 7, 2000, 3:00:00 AM5/7/00
to
Pete,

there is a good assembler sample in the DB2 books.
Unfortunally you have to use DSNALI (Caf) as the DB2 interface/stub.

If you like to pass LE runtime options you need to a simple Cobol as the
first program

If you need a sample let me know

Roland


Pete Wirfs

unread,
May 9, 2000, 3:00:00 AM5/9/00
to
This is my preferred method of solution, but I have been unable to get
it to work. I will e-mail Johnnie directly and see if he can help me
work out the bugs.

Pete

0 new messages