Labeling Workload Automation Programming Language statements

To control the flow of the Workload Automation Programming Language statements, or make key statements easier to identify in the job output, you can label individual Workload Automation Programming Language statements.

You label the statement by inserting a user-defined label before the statement, followed by a colon:
CHKJOB: LISTSTAT CPOP JOBNAME(WLSCCPEX) IA(&OYMD1.1200)

The label can be up to 16 alphanumeric characters, excluded the underscore character. The label must begin with an alphabetic character to avoid clashing with internal Workload Automation Programming Language labels, which are 8-character numeric fields.

The label allows other conditional processing functions to reference this statement directly, for example, IF @CMD(CHKJOB.EQ.4) THEN.

The label also allows you to reference a command directly, as long as it is in scope, with the GOTO command or run it as a subroutine with the CALL command.

The label assigned to each statement is shown in the messages 200 and 299 that record the running of each command, and can also be displayed by issuing the SHOW RC command.

The label does not need to be on the same line as the command to which it belongs, but each label must always be followed by a command. You cannot have two consecutive labels without a command associated to each. If you need two labels to the same location, add the NOACT statement after the first label, then add the actual statement after the second label, as shown in the following example:
ENTRY_1: NOACT
ENTRY_2": DISPLAY "Good morning"