Command labels identify particular commands for branching purposes in a CL program. Labels can also be used to identify statements in CL programs that are being debugged. They can identify statements used either as breakpoints or as starting and ending statements for tracing purposes.
The label is typed just before the command name. The standard rules for specifying simple names (*SNAME) apply. The label is immediately followed by a colon. Blanks are allowed, though not required, between the colon and the command name. The label can contain as many as 10 characters, in addition to the colon. START: and TESTLOOP: are examples of command labels.
Command labels are not required, but a label can be placed on any command. For labels that are placed on commands that cannot be run (for example, the Declare CL Variable (DCL) command), when the program branches to that label, the next command following the label is run. If the command following the label cannot be run, the program will move to the next command that can be run. Similarly, you can specify only one label on a line. If a command is not located on that line, the program will jump to the next command that can be run.
To specify multiple labels, each additional label must be on a separate line preceding the command as shown:
LABEL1: LABEL2: CMDX
No continuation character (+ or -) is allowed on the preceding label lines.