Page 1 of 1

TWO JOB PARMS IN ONE JCL

PostPosted: Mon Feb 16, 2009 8:17 pm
by suresh_83
Hi All,

Is that possible to give two job parms in same JCL such that i want one step to run in one region and other step to run other region.

Re: TWO JOB PARMS IN ONE JCL

PostPosted: Mon Feb 16, 2009 9:22 pm
by MrSpock
could you elaborate on what you mean by "TWO JOB PARMS"?

Re: TWO JOB PARMS IN ONE JCL

PostPosted: Mon Feb 16, 2009 9:55 pm
by suresh_83
Pls find the below example
                                                   
//*****************************************************************     
//*CREATES AN EMPTY FILE-01                                             
//*****************************************************************     
//STEP001  EXEC PGM=IEFBR14                                             
//GDGVERSN DD DSN=HLQ.MLQ.FILENAME,                                     
//         SPACE=(TRK,(1,0)),                                           
//         LRECL=604,RECFM=FB,
//         DISP=(,CATLG,DELETE)                                         
//*                                                                     
//*****************************************************************     
//*CREATES AN EMPTY FILE-01                                             
//*****************************************************************     
//   EXEC PGM=IEFBR14                                             
//GDGVERS1 DD DSN=HLQ.MLQ.FILENAME2,                                   
//         SPACE=(TRK,(1,0)),                                           
//         LRECL=604,RECFM=FB,
//         DISP=(,CATLG,DELETE)                                         
//*                                                                     

In the above STEP001 should execute in SYS2 and STEP002 should execute in SYS4.

Is that possible. If so pls help me in this

Thanks,
Suresh.D

Re: TWO JOB PARMS IN ONE JCL

PostPosted: Tue Feb 17, 2009 5:03 pm
by MrSpock
I'm not sure what I can tell you. Obviously, you need to include something in your job to indicate which step it needs to execute. Is this job processed by your job scheduling system? If so, I would think that your job scheduling system could make the determination as to which system the job will be initiated on, and then modify the job as-needed before it initiates it.

Otherwise, the only option I see is for you to add a step and use a program or utility that can determine the active system and set the Return-Code value based on which system the running job is active on. Then you'll have to include some IF/THEN/ELSE logic in your job to guide it through which step to run and which one to skip.

If you have DFSORT, something like this should work:

//STEP0000 EXEC PGM=ICETOOL                     
//TOOLMSG  DD   SYSOUT=*                         
//DFSMSG   DD   SYSOUT=*                         
//SYMNAMES DD   *                               
SYSID,S'&SYSNAME'                               
/*                                               
//IN       DD   *                               
                                                 
/*                                               
//T1       DD   UNIT=VIO                         
//OUT      DD   SYSOUT=*                         
//TOOLIN   DD   *                               
COPY FROM(IN) USING(CTL1)                       
COUNT FROM(T1) EMPTY RC4                         
/*                                               
//CTL1CNTL DD   *                               
  INREC FIELDS=(1:SYSID,80:X)                   
  OUTFIL FNAMES=T1,INCLUDE=(1,4,CH,EQ,C'SYS2')   
/*                                               
//*                                             
// IF (STEP0000.RC = 0) THEN                                       
//*****************************************************************
//*CREATES AN EMPTY FILE-01                                       
//*****************************************************************
//STEP001A EXEC PGM=IEFBR14                                       
//GDGVERSN DD DSN=HLQ.MLQ.FILENAME,                               
//         SPACE=(TRK,(1,0)),                                     
//         LRECL=604,RECFM=FB,                                     
//         DISP=(,CATLG,DELETE)                                   
//*                                                               
// ELSE         
//*                                                   
//*****************************************************************
//*CREATES AN EMPTY FILE-01                                       
//*****************************************************************
//STEP001B EXEC PGM=IEFBR14                                       
//GDGVERS1 DD DSN=HLQ.MLQ.FILENAME2,                               
//         SPACE=(TRK,(1,0)),                                     
//         LRECL=604,RECFM=FB,                                     
//         DISP=(,CATLG,DELETE)                                   
// ENDIF                                                           
//*