© robertzenuk@newsgroup

Hier wird eine auszuführende Job Control aus einer Datei gelesen und an den Internal Reader zur Ausführung übergeben.

/* REXX **************************************************************/
/* Purpose: Submit JCL in an existing PDS from the USS side          */
/*-------------------------------------------------------------------*/
/* Syntax: sub dsn mem                                               */
/* Parms:  dsn - PDS that hold the JCL member                        */
/*         mem - Member in the PDS that holds the JCL                */
/*********************************************************************/
/* Accept DSN and MEM                                                */
arg dsn mem
/*********************************************************************/
/* Format the DSN(MEM)                                               */
jcl = dsn'('mem')'
/*********************************************************************/
/* Allocate the PDS                                                  */
exitrc = bpxwdyn("alloc fi(jclpds) da('"jcl"') shr")
if exitrc <> 0 then say 'Allocate error on JCLPDS' jcl 'RC='exitrc
/*********************************************************************/
/* Allocate a INTRDR DD                                              */
exitrc = bpxwdyn("alloc dd(sub) sysout writer(intrdr)")
if exitrc <> 0 then say 'Allocate error on INTRDR RC='exitrc
/*********************************************************************/
/* Read the JCL into a stem                                          */
address mvs "execio * diskr jclpds (fini stem jcl."
exitrc = rc
if exitrc <> 0 then say 'EXECIO error on JCLPDS RC='exitrc
/*********************************************************************/
/* Write the stem to the INTRDR DD                                   */
address mvs "execio * diskw sub (fini stem jcl."
exitrc = rc
if exitrc <> 0 then say 'EXECIO error on INTRDR RC='exitrc
/*********************************************************************/
/* Free both DD's                                                    */
exitrc = bpxwdyn("free dd(jclpds)")
if exitrc <> 0 then say 'FREE error on JCLPDS' jcl 'RC='exitrc
exitrc = bpxwdyn("free dd(sub)")
if exitrc <> 0 then say 'FREE error on INTRDR' jcl 'RC='exitrc
/*********************************************************************/
/* Shutdown */
/*********************************************************************/
shutdown: exit(exitrc)
zurück zu REXX im Batch