----------------------------------------------------------------------
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
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
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>
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>
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
>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
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!
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>
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
/* 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:
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
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
----------------------------------------------------------------------
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