IF THEN in JCL Sort Card to Format Records

The below example says how to use IFTHEN in JCL sort card. IFTHEN will be used to reformat either INREC or OUTREC.

Using IFTHEN clauses, you reformat different records in different ways by specifying how BUILD or OVERLAY items are applied to records that meet given criteria.

How to Use IF THEN

IFTHEN clauses let you use sophisticated conditional logic to choose how different record types are reformatted. You can use any INCLUDE logical expression to specify the criteria. You can use any BUILD or OVERLAY items to reformat the records that
meet those criteria.

Dfsort examples

You can also apply BUILD or OVERLAY items to all records, or only to records that do
not meet any of the criteria.

Here’s an example of reformatting with INREC and IFTHEN clauses:


One of the interview question is, IFTHEN is used  for conditional logic.

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.

Comments are closed.