Conditional Statements IQ for Freshers


What do you mean by Condition checking in JCL?

Condition checking involves validating the execution status of a perticular step to decide the current step execution.

How many conditional statements available in JCL?

Three statements are available - IF, COND and RD parameters.

IF Statement -

What is the significance of IF statement?

"IF" statement is used to execute a step conditionally based on the condition coded. It defines a condition with the return code or condition code of the previous steps.

How may types of IF statements available?

IF statement has three types - Simple IF, IF...ELSE and nested IF...ELSE.

A JCL has 2 steps. How to code the JCL such that if step1 abends, then step2 runs. Else, job terminates with step1?

//IFSTEP IF STEP1.RC = 0 THEN //STEP2 EXEC .... //IFSTEPE ENDIF.

COND Parameter -

What is a COND parameter in JCL?

COND parameter is used to specify a condition under which a particular job step should be executed or skipped.

What happens when COND is coded in JOB statement and EXEC statement?

COND in JOB statement applies to each step of the JOB. COND in EXEC statement applies to the specific step.

What is COND=ONLY?

It is used to execute the current step when the previous step execution is unsuccessful.

What is COND=EVEN?

It is used to execute the current step when the previous step execution is successful or unsuccessful.

RD Parameter -

What is the significance of RD parameter?

RD stands for restart definition. RD parameter used to - allow JES to perform an automatic job restart after the job failure, allow the operator to perform an automatic job or a checkpoint restart if a job fails.

Frequently Asked Questions -

What is condition checking in JCL? Is this possible?
What is the concept of Condition checking in JCL?

Definition of COND parameter in JCL?
What is the use of COND parameter in JCL?

What is the meaning of the EXEC statement keyword, COND? What is its syntax?
Mention what happens when COND is coded in JOB statement and when COND is coded inside EXEC statement?

What do you mean by "Cond=even" and "Cond=only"?