How to submit a batch job from CICS, Spool routing

Submitting a JOB from Online, Extra Partition TDQs,routing output to Spool

There are two ways that a job can be submitted from online.

1. Using Extra partition TDQs
2. Using the Spool Files

1.Using Extra partition TDQs

TDQs are generally used to submit the jobs in batch from Online. JOB cards and required steps are written to an extra partition TDQ. These Ext. Partition TDQs definition should include a DDName which refers to a data set defined in the startup JCL.

That DDname in the CICS startup JCL includes an Internal reader (INTRDR) as its SYSOUT. INTRDR option will route the output to the JES input queue.

JESRDR DD SYSOUT=(E,INTRDR)

When the writing the job cards in to TDQ is done and it is closed then the system will read and process the contents just as if it were a submitted job.

An extra partition queue is an MVS™ sequential data set (or a spool file). Extra partition queues are not subject to ATI.

2.Using the Spool Files

Second method of submitting a batch job from CICS can be achieved by using the spool files concept which has been introduced as part of CICS/ESA 3.1. Now a days this method is widely used to display the messages in spool or to submit the jobs from online environment.

CICS provides an interface to JOb Entry Subsystem(JES) to create and retrieve spool files. Basically there are 3 spool commands to Open, write and close these files. In write command, required JCLs to be submitted can be populated in the online COBOL program.

Open–>

EXEC CICS SPOOLOPEN OUTPUT
NODE (WK-NODE)
USERID (WK-USERID)
TOKEN (WK-TOKEN)
NOHANDLE
RESP (WS-RESPONSE)
RESP2 (WS-RESPONSE2)
END-EXEC.

Node – This is a node that system spooler uses to route the file. Generally we code it as NODE(*) to enable the OUTDESCR operand which sends files to local spool.

Useid – Destination user ID. It can also be given as USERID(*)

Write–>

In JCL-CARD, jcl statements that are to be executed or submitted can be given.

EXEC CICS SPOOLWRITE
TOKEN (WK-TOKEN)
FROM (JCL-CARD)
FLENGTH (WK-LENGTH)
NOHANDLE
RESP (WS-RESPONSE)
RESP2 (WS-RESPONSE2)
END-EXEC.

Close–>

EXEC CICS SPOOLCLOSE
TOKEN (WK-TOKEN)
KEEP
NOHANDLE
RESP (WS-RESPONSE)
RESP2 (WS-RESPONSE2)
END-EXEC.

References for further read:

Spool Output – IBM ref-1

IBM ref-2

TDQs      – IBM Ref-3

 

Add a Comment

Your email address will not be published. Required fields are marked *

Close Bitnami banner