Hello,
yes, it's both possible!
A stored procedure can submit a batch job through the JES internal reader,
but you must provide a "//anyname DD SYSOUT=(,INTRDR)" - statement within
the DB2 Stored Procedure execution address space startup JCL (ssidSPAS or
any procname for WLM-managed address spaces). The Stored Procedure must
write the jobstream to this "anyname" file then. It can even read in the
jobstream from any JCL library before, if you provide a DD-statement there
for this library too.
I'm not that familiar with CICS, but DB2 V7+ provides even a dedicated and
very useful stored procedure called DSNACICS that can be used to invoke CICS
transactions and other things. This procedure is well documented in the DB2
z/OS Application Programming Guide
Cheers - Walter.
> Is it possible to invoke JCL or CICS from a stored procedure? I am
> working on a integration project in which I need one system to invoke
> another. The plan is to write data into tables in DB2 and then call
> existing programs to process the data. We don't have CICS TS or
> similar, so I need a way to trigger backend processing.
Dad - 27 Jun 2005 12:24 GMT
Walter, thank you for your reply. Do you happen to have a sample you
could send of a stored procedure calling JCL? Or will you direct me to
some documentation specific to this topic? I've searched through
developer guides at IBM.com and via google and have come up short.
Walter Schneider - 28 Jun 2005 11:23 GMT
Hi,
common samples of stored procedures are documented in the already mentioned
DB2 for z/OS Application Development Guide and executable samples are also
created during the DB2 installation process. All your desired procedure has
to do is to write the jobstream to a file which is associated with the JES
INTRDR within the DB2 stored procedure address space where it will be
executed then.
How your procedure writes to a file depends on the programming language you
use for writing it (PLI, COBOL, C, C++) and is documented in the affected
language's Programmer's Guide or Reference.
Manuals for DB2 for z/OS can be freely referenced or downloaded here
(depending on the version you will use):
http://www-3.ibm.com/software/data/db2/os390/v7books.html
http://www-3.ibm.com/software/data/db2/os390/v8books.html
Cheers - Walter SCHNEIDER.
> Walter, thank you for your reply. Do you happen to have a sample you
> could send of a stored procedure calling JCL? Or will you direct me to
> some documentation specific to this topic? I've searched through
> developer guides at IBM.com and via google and have come up short.