

Reporting Facility Rules for Coding › Labels
Labels
The Reporting Facility provides the ability to attach a label to certain commands. You can conditionally or unconditionally branch to the commands.
This technique directs the program flow and determines which commands will be executed and under what circumstances they will be executed. For the Reporting Facility to recognize your intentions, you must follow certain label coding rules:
- Apply labels only to these commands:
|
ADD PROC COMPUTE CONTINUE DECODE
|
DECREMENT DIVIDE ENDPROC GET GOTO
|
INCREMENT MOVE MULTIPLY SET SUBTRACT
|
- Labels must begin with an alphabetic character (A—Z) and all other characters must be in the range of A—Z, 0—9, or be a – (dash) or an _ (underscore). No other special characters are allowed in a label specification.
- The last character of the label must not be a – (dash) or an _ (underscore).
- Labels cannot exceed 71 characters and must be terminated by a colon.
- The Reporting Facility automatically defines four labels that take on special meaning. They are ABORT, EOJ, START, and TEST. You can branch to these labels, but you cannot define them.
- If you use duplicate labels in a single run, an error condition occurs.
Valid Labels
- THIS-IS-A-SAMPLE-OF-A-VALID-LABEL-IN-A-PROGRAM:
- THIS_IS_TOO:
- THISISTOO:
- PROG123:
- ABC:
Invalid Labels
The following entries result in the described error conditions:
- 123:
-
First character is not A—Z.
- THIS-IS-AN-INVALID-LABEL
-
Terminating colon is missing.
- SO_THIS_IS_#1:
-
Special character is present.
- INVALID-LABEL-SPEC-:
-
Last character before the colon is a dash.
- START:
-
Predefined, reserved label.
Copyright © 2014 CA.
All rights reserved.
 
|
|