Previous Topic

Next Topic

Book Contents

Book Index

Boolean "IF" Logic Example 2

This example illustrates the use of Control-M’s conditional logic in conjunction with Control-M "INCLUDE" and "GO TO" logic.

//PDPA0001 JOB (......),BILL,CLASS=A
//*
//* %%IF %%WDAY NE 1
//*     %%GOTO RUN_DAILY
//* %%ELSE
//*     %%INCLIB CTM.LIB.COMJCL %%INCMEM MONTHLY
//* %%ENDIF
//*
//* %%LABEL RUN_DAILY
//STEPDAI   EXEC PGM=DAILY
...

//

The MONTHLY member in the CTM.LIB.COMJCL library contains:

//STEPMON   EXEC PGM=MONTHLY
...

On the first day of the month both the DAILY and MONTHLY programs run. The submitted JCL:

//PDPA0001 JOB (......),BILL,CLASS=A
//*
//* %%IF 1 NE 1
//* %%ELSE
//*     %%INCLIB CTM.LIB.COMJCL %%INCMEM MONTHLY
//STEPMON   EXEC PGM=MONTHLY
...
//* %%ENDIF
//*
//* %%LABEL RUN_DAILY
//STEPDAI   EXEC PGM=DAILY
...

//

On any other day of the month, only the DAILY program runs. The submitted JCL:

//PDPA0001 JOB (......),BILL,CLASS=A

//*

//* %%IF 2 NE 1

//*     %% GOTO RUN_DAILY

//* %%ELSE

//* %%ENDIF

//*

//* %%LABEL RUN_DAILY

//STEPDAI   EXEC PGM=DAILY

...

//

Parent Topic

Boolean "IF" Logic