                         S U B J O B



      Batch utility SUBJOB in MVS environment can Submit JOBs from
PDS libraries, with expansion of possible /INCLUDE statements, that
recall others jobs; in others words, is a program that permit to do
jobs that submits others jobs.
      In PARM= option of EXEC statement, is specified full phisical name
of member to submit, in the form:

      pds.library.name(member)

and program do a dynamic allocation both of member to submit and SYSOUT
redirected to internal reader, on which it writes to submit job.
It is necessary specify only //SYSPRINT DD  on which are traced both
of job submission and  /INCLUDE expanded.

      It is possible submit many jobs, writing them one after other
in PARM, dividing with a semicolon; is possible to do console commands
starting with a ' /*'; finally is possible do a short wait (useful
between two submissions) writing /nn, where nn is number of seconds
to wait: this pause guarantee that jobs are submitted in the correct
order.
      /INCLUDE in job to submit can be written in two different forms:

      /INCLUDE  pds.library.include(member)

in which after keyword "/INCLUDE" (that must always start from column 1)
must be written full phisical name of member to expand;
or is possible write:

      /INCLUDE  member

in which library name where members are searched is omitted: in this case
is necessary to specify in PARM parameter DDINCL=ddname, in which
"ddname" is logical name of DD statement allocating this library;
program will search members to expand only in this library.
Note: in this DD is not possible to write a set of linked libraries; only
one library is permitted, so all /INCLUDE members must be in this library.
In the same job can be mixed together both types of /INCLUDE.

Others optional parameters are:

      DDIN=ddname         in which ddname is about member to submit;
                          in this way member can be a PS (sequential)
                          file; in this way program don't make a
                          dynamically allocation.

      DDOUT=ddname        in which ddname is about output file where
                          job deck is submitted: in this way program don't
                          make dynamic allocation of SYSOUT and don't 
                          redirect it to internal reader. In this way
                          output deck can be printed or can be written
                          in a file, instead of submitted.

Restrictions: nested /INCLUDE are permitted, but only up to third level,
that is recalled member can contain an /INCLUDE, and this can in turn
contain an /INCLUDE, but this cannot.
All libraries and files involved must have record length equal to 80
bytes.
All parameters  DDIN=, DDOUT=, DDINCL= must be specified in PARM= before
/INCLUDE that use this DD.
If member in an /INCLUDE don't exist, program is abended.


      Examples:

//SUBMIT  EXEC PGM=SUBJOB,PARM='library.job(myjob)'
//SYSPRINT DD SYSOUT=*

      this is the most simple example of a job submit with SUBJOB.



//SUBMIT  EXEC PGM=SUBJOB,
//  PARM='DDIN=MYLIB;/60;NAME.LIBRARY(JOB2)'
//MIALIB   DD DSN=PROD.LIB.JCL(JOB1),DISP=SHR
//SYSPRINT DD SYSOUT=*

      in this case first is submitted JOB1 without dynamic allocation,
then program wait for a minute and submit JOB2 from an other library
with dynamic allocation.


//STEP01  EXEC PGM=SUBJOB,
//  PARM='DDOUT=READER;DDINCL=LIBINCL;NAME.LIBRARY(JOBPROD)'
//LIBINCL  DD DSN=PROD.LIB.PARAM,DISP=SHR
//READER   DD SYSOUT=(A,INTRDR)
//SYSPRINT DD SYSOUT=*

      in this examle JOBPROD is submitted using library PROD.LIB.PARAM 
to expand implicit /INCLUDE (that is library phisical name is not written
in the same /INCLUDE statement); moreover dynamic allocation is not used
for internal reader.


//COMMAND EXEC PGM=SUBJOB,
//  PARM='/*$S MYPROC;/10;/*$VS,''D A,L'''
//SYSPRINT DD SYSOUT=A

      here two console command are executed with ten seconds between
each other; first is Jes command that start MIAPROC, second is the MVS
command that display active address spaces.
Note the use of '$VS' to give not Jes commands and the use of double 
quotation marks ('') to write a single quotation mark inside PARM.



