This is just silly, so be warned! Last week, I posted some JCL in a response which used 'COND=ONLY' to suppress execution of a JCL step. In this case, I knew it was OK because it was a simple test job, and if some previous step abended for some strange reason I could just throw the results away.
Paul Gilmartin suggested using COND=(0,LE) instead to suppress execution of a step as a general principal. I was just playing, and tried this: //jobname JOB (acct),'BSquare',CLASS=X,MSGCLASS=X,NOTIFY=&SYSUID //* // IF FALSE THEN // EXEC PGM=KLUGE,COND=ONLY // ENDIF //* // IF (U0100 = U0140) THEN //YES1 EXEC PGM=IEFBR14 //NO1 EXEC PGM=IEFBR14 // ELSE //YES2 EXEC PGM=IEFBR14 // ENDIF where KLUGE is a program that does not exist in the standard search order. OK, that works (KLUGE is not attempted, YES1 and NO1 are flushed and YES2 is executed). Add ',COND=(0,LE)' to YES2. Funny - YES2 is still executed! Hmm... get rid of the COND=ONLY on the unnamed KLUGE execution. Wait... I got an S806. What happened to the 'IF FALSE'? Well... IF (cond) THEN [whatever] [ELSE whatever] ENDIF is only evaluated after the 1st step of a job (even if that step does not execute). So the 1st 'IF FALSE' is completely useless in this job. The 'IF (U0100 = U0140) THEN' (which could just as easily have been 'IF FALSE THEN') works as expected to flush YES1 and NO1 whether the unnamed KLUGE step is 'executed' or not. This is true even if a valid program is called. The COND=(0,LE) was not effective on YES2 because no previous steps had been executed. Unlike the 'IF FALSE' test, COND=(0,LE) doesn't work if all previous steps were flushed (say, because of COND=ONLY). The only way I know to suppress execution of a step that 'always' works on any step of a job is // IF FALSE THEN //job step to flush...,COND=ONLY ... the rest of the job step DDs, etc. // ENDIF ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

