The END STEP statement terminates a processing step. END STEP is needed when a WRITE, SUMMARIZE, or SORT statement is IF-dependent.

END STEP.

Only one of these statements can follow an END STEP statement:

  • COMPUTE
  • CONTROL
  • DECODE
  • IF
  • IGNORE
  • PRINT
  • SELECT
  • SORT
  • STOP
  • END STEP

Example

Enter these statements to terminate the WRITE statement processing that was started by the IF statement:

IF FLAG1 HAS ANY BITS OFF '04'.
     WRITE VOLSER DSN LJOB.
     NEXT RECORD.
END IF.
END STEP.
SORT DSN WITHIN VOLSER.

The END STEP statement is followed by a SORT statement. The SORT statement in this example is not subject to conditional processing. Only those records that pass the conditional statement in the IF clause are subject to the SORT statement.