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

Rexx to submit job

3,468 views
Skip to first unread message

Betsy Jeffery

unread,
Apr 8, 2010, 2:19:11 PM4/8/10
to
I'm looking for a rexx sample of submitting a batch job. Does anyone have a
snippet of code they can share?
TIA,
Betsy Jeffery

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to list...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

McKown, John

unread,
Apr 8, 2010, 2:35:46 PM4/8/10
to
> -----Original Message-----
> From: IBM Mainframe Discussion List
> [mailto:IBM-...@bama.ua.edu] On Behalf Of Betsy Jeffery
> Sent: Thursday, April 08, 2010 1:19 PM
> To: IBM-...@bama.ua.edu
> Subject: Rexx to submit job
>
> I'm looking for a rexx sample of submitting a batch job.
> Does anyone have a
> snippet of code they can share?
> TIA,
> Betsy Jeffery

Well, that is sort of vague. The simpliest way that I know if would be to have the JCL in a stem variable. JCL.0 would contain the number of "cards". They would be, in order, in JCL.1, JCL.2, ... , JCL.n . Use either BPXWDYN or ALLOCATE to allocate an INTRDR, the EXECIO to write the "cards".

rc=BPXWDYN("ALLOC RTDDN(DDNAME) SYSOUT WRITER(INTRDR)")
IF RC<>0 THEN
SAY "CANNOT ALLOCATE INTERNAL READER"
EXIT 16
END
"EXECIO * DISKW "DDNAME"(STEM JCL. FINIS"
"FREE DDN("DDNAME")"

--
John McKown
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john....@healthmarkets.com * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM

Hayim Sokolsky

unread,
Apr 8, 2010, 2:39:03 PM4/8/10
to
Betsy,

The following excerpts are from a REXX exec I run under ISPF edit, but
would work outside of ISPF as well.

The first version used the SUBMIT command, which has the advantage of
capturing the submitted jobname and jobnumber. It echoes back to the
persons submitting under ISPF using message "ISRZ001" where the text is
set in variable "zedlmsg".

submit_job:
temp_dsn = "'"userid()".TEMPDSN.D"date('J')".T"hhmmss".CNTL'"

call tso_cmd "FREE FILE($REXXSUB)"
call tso_cmd "ALLOCATE FILE($REXXSUB) DSN("temp_dsn") NEW DELETE",
"UNIT(SYSDA) SPACE(5 5) TRACK",
"RECFM(F B) LRECL(80) BLKSIZE(1600)"
call tso_cmd "EXECIO" job.0 "DISKW $REXXSUB (STEM JOB. FINIS"
call tso_cmd "SUBMIT" temp_dsn

zedsmsg = ''
zedlmsg = msg.1
address ISPEXEC "SETMSG MSG(ISRZ001)"

call tso_cmd "FREE FILE($REXXSUB) DELETE"
return

tso_cmd:
procedure expose rc msg. job. cmd.
parse arg command
msg.0 = 0
x = outtrap('msg.','*')
command
x = outtrap('OFF')
return rc

The second version does not obtain the job information. Instead it
directly writes to the internal reader (and doesn't require ISPF or the
SUBMIT command)...
Note that you can probably eliminate the whole tso_cmd routine if you
don't care about return codes or trapping any results...

submit_job:
call tso_cmd "FREE FILE($REXXSUB)"
call tso_cmd "ALLOCATE FILE($REXXSUB) SYSOUT(A) WRITER(INTRDR) REUSE",
"RECFM(F B) LRECL(80) BLKSIZE(1600)"
call tso_cmd "EXECIO" job.0 "DISKW $REXXSUB (STEM JOB. FINIS"

call tso_cmd "FREE FILE($REXXSUB) DELETE"
return

tso_cmd:
procedure expose rc msg. job. cmd.
parse arg command
msg.0 = 0
x = outtrap('msg.','*')
command
x = outtrap('OFF')
return rc


Hayim
_____________________________________
Hayim Sokolsky, CISSP
Mainframe Security Architect
DTCC Corporate Information Security
18301 Bermuda Green Dr, MS 1-CIS
Tampa FL 33647-1760

Tel. (813) 470-2177

Betsy Jeffery <betsy_...@MGIC.COM>
Sent by: IBM Mainframe Discussion List <IBM-...@bama.ua.edu>
2010.04.08 14:18
Please respond to
IBM Mainframe Discussion List <IBM-...@bama.ua.edu>


To
IBM-...@bama.ua.edu
cc

Subject
Rexx to submit job

<BR>_____________________________________________________________
<FONT size=2><BR>
DTCC DISCLAIMER: This email and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email
in error, please notify us immediately and delete the email and any
attachments from your system. The recipient should check this email
and any attachments for the presence of viruses. The company
accepts no liability for any damage caused by any virus transmitted
by this email.</FONT>

Scott Ford

unread,
Apr 8, 2010, 3:20:08 PM4/8/10
to
Like Hayim and John i submitted jobs via TSO and Netview using
Betsy,

Like Hayim and John i submitted jobs via TSO and Netview using the SUBMIT command as well as the
Intrdr example, both work well.
 
Scott J Ford
 


________________________________
From: Hayim Sokolsky <hsok...@DTCC.COM>
To: IBM-...@bama.ua.edu
Sent: Thu, April 8, 2010 2:38:25 PM
Subject: Re: Rexx to submit job

Paul Gilmartin

unread,
Apr 8, 2010, 3:48:47 PM4/8/10
to
On Thu, 8 Apr 2010 12:19:16 -0700, Scott Ford wrote:

>Like Hayim and John i submitted jobs via TSO and Netview using
>Betsy,

Like Hayim and John i submitted jobs via TSO and Netview using the SUBMIT command as well as the
Intrdr example, both work well.
 
Scott J Ford
________________________________
From: Hayim Sokolsky <hsok...@DTCC.COM>
To: IBM-...@bama.ua.edu

submit_job:


  temp_dsn = "'"userid()".TEMPDSN.D"date('J')".T"hhmmss".CNTL'"

A lot of needless work when DYNALLOC can generate a DSNAME for you.

There's also:

5.20 "z/OS V1R10.0 Using REXX and z/OS UNIX System Services"
___________________________________________________________________

5.20 submit()

________________________________________________________________________
| |
| >>__submit__(__stem.__)_____________________________________________>< |
| |
|________________________________________________________________________|

Function

Submits a job to the primary subsystem (JES), returning the job ID
of the submitted job.

May require Unix System Services, but has no need for ISPF or TSO.

Alas, AFAIK, all methods except RYO INTRDR truncate your input to
80 columns.

-- gil

Ted MacNEIL

unread,
Apr 8, 2010, 5:09:51 PM4/8/10
to
/* REXX */
address "TSO"
"SUBMIT" job

------Original Message------
From: Betsy Jeffery
Sender: IBM Mainframe Discussion List
To: IBM Mainframe Discussion List
ReplyTo: IBM Mainframe Discussion List
Sent: Apr 8, 2010 14:18
Subject: Rexx to submit job

I'm looking for a rexx sample of submitting a batch job. Does anyone have a
snippet of code they can share?
TIA,
Betsy Jeffery

----------------------------------------------------------------------


For IBM-MAIN subscribe / signoff / archive access instructions,
send email to list...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


-
Too busy driving to stop for gas!

Peter Nuttall

unread,
Apr 9, 2010, 4:12:36 AM4/9/10
to
The question is a little vague and Ted has answered in the simplest form
... Here's a snippet using File tailoring (Skeletons) :

address 'ISPEXEC'
"FTOPEN TEMP"
if rc<>0 then call ExitWithError 'Could not start file tailoring'
"FTINCL AMBSKL"
if rc<>0 then,
call ExitWithError 'Could not tailor skeleton AMBSKL'
"FTCLOSE"
if rc<>0 then call ExitWithError 'Could not end file tailoring'

"VGET ZTEMPF"
address 'TSO' "SUBMIT '"ZTEMPF"'"

Obviously, you would have to create the skeleton to go with this code ...

Cheers,
Peter

"Ted MacNEIL" <eama...@YAHOO.CA>

Sent by: "IBM Mainframe Discussion List" <IBM-...@bama.ua.edu>

08/04/2010 11:09 PM


Please respond to
"IBM Mainframe Discussion List" <IBM-...@bama.ua.edu>


To
IBM-...@bama.ua.edu
cc

Subject


Re: Rexx to submit job

This e-mail message, including any attachments transmitted with it, is CONFIDENTIAL and may contain legally privileged information. This message is intended solely for the use of the individual or entity to whom it is addressed. If you have received this message in error, please notify us immediately and delete it from your system. Please visit our website to read the full disclaimer: http://www.euroclear.com/site/public/disclaimer

Donald Johnson

unread,
Apr 9, 2010, 9:03:12 AM4/9/10
to
I don't know if this is useful, or if it matches anything to help the OP,
but I use this Exec to submit my jobs from ISPF. It adds a comment block at
the beginning to help identify the origin of the jobs. I have changed the
command SUB to point to this Exec called SUBB:

/* REXX Exec to add filename, SYSID, Date and Time to JCL */

Trace o;

isr = "ISREDIT"; isrla = isr "LINE_AFTER"; isrdel = isr "DELETE";
isp = "ISPEXEC";

isr "MACRO ()";

isr "(DSN) = DATASET";
isr "(MEM) = MEMBER";
isp "VGET (ZSYSID)";
jcllib = dsn"("mem")";
data = "Was submitted from" Left(zsysid,4) "on",
Date("N") "at" Time("C");

box.1 = "//* +" || Copies('-',62) || "+ *//";
box.2 = "//* |" || Center(jcllib,62) || "| *//";
box.3 = "//* |" || Center(data,62) || "| *//";
box.4 = box.1;
box.0 = 4;

Do dest = 1 to box.0; isrla dest "= '"box.dest"'"; End;

isr "SUBMIT";

Do box.0; isrdel 2; End;

Return 00;

On Fri, Apr 9, 2010 at 4:11 AM, Peter Nuttall
<Peter....@euroclear.com>wrote:

Wayne Bickerdike

unread,
Apr 11, 2010, 6:37:21 PM4/11/10
to
This is very simple,

QUEUE,
"//JOBNAME JOB 'MYJOB',MSGCLASS=X,NOTIFY="US",CLASS=4, "
QUEUE,
"// SCHENV=XXXX,TIME=1440 "
QUEUE,
"//********************************************************************""
QUEUE,
"//* JCL COMMENT "
QUEUE,
"//********************************************************************""
QUEUE,
"$E "
"SUBMIT * END($E)"

If I want a quick way to cut and paste JCL into this type of REXX
code, I CUT a member "A" which has QUEUE, as the text, copy in the
JCL, Shift right 1 char, copy overlay a line with quotes in cc1 and
cc79 over the shifted JCL. &PASTE A before each line. Good for a quick
and dirty...

If you already have a member with the JCL:

subdsn = "'MYJCL(MEMBER)'"
"SUBMIT ('"subdsn"') "

--
Wayne V. Bickerdike

McKown, John

unread,
Apr 12, 2010, 8:39:55 AM4/12/10
to
> -----Original Message-----
> From: IBM Mainframe Discussion List
> [mailto:IBM-...@bama.ua.edu] On Behalf Of Wayne Bickerdike
> Sent: Sunday, April 11, 2010 5:37 PM
> To: IBM-...@bama.ua.edu
> Subject: Re: Rexx to submit job
>
> This is very simple,
>
> QUEUE,
> "//JOBNAME JOB 'MYJOB',MSGCLASS=X,NOTIFY="US",CLASS=4, "
> QUEUE,
> "// SCHENV=XXXX,TIME=1440
> "
> QUEUE,
> "//***********************************************************
> *********""
> QUEUE,
> "//* JCL COMMENT
> "
> QUEUE,
> "//***********************************************************
> *********""
> QUEUE,
> "$E "
> "SUBMIT * END($E)"
>
<snip>
>
> --
> Wayne V. Bickerdike

Super neat! I didn't know it was possible to do a SUBMIT * in REXX. I've done it in CLIST. Many thanks!

--
John McKown
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john....@healthmarkets.com * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM

----------------------------------------------------------------------

Hunkeler Peter , KIUP 4

unread,
Apr 12, 2010, 9:00:51 AM4/12/10
to
> [snip]

> QUEUE,
> "$E "
> "SUBMIT * END($E)"
>

As an alternative, simply queue an emtpy element ( queue "" ) and SUBMIT

will stop reading w/o the need for the "END($E)"

--
Peter Hunkeler
Credit Suisse

Marc Pierre

unread,
May 5, 2023, 1:14:17 PM5/5/23
to
thanks
0 new messages