Free-Form Statements
When the first line of the source contains **FREE, the source is fully free-form, and free-form statements can appear anywhere between column 1 and the end of the line. There is no limit on the length of the line.
Otherwise, the source is column-limited, and a free-form statement is coded in columns 8-80. Columns 6-7 must be blank.
In most cases, a free-form statement begins with an operation code, such as CTL-OPT, DCL-F, DCL-DS, READE, or DCL-PROC.
- In a calculation statement, the EVAL operation code and the CALLP operation code omitted as long as the first name in the statement is not the same an operation code supported in free-form calculations. For example, the EVAL operation code is required if the target of the assignment has the name READ.
- When defining a subfield, the DCL-SUBF operation code may be omitted as long as the name of the subfield is not the same as an operation code supported in free-form calculations.
- When defining a parameter, the DCL-PARM operation code may be omitted as long as the name of the parameter is not the as same an operation code supported in free-form calculations.
A free-form statement ends with a semicolon.
In general, all text following // on a free-form line is considered to be a comment. However, if // appears within a character literal, it is considered to be part of the literal. In the following example, 1 , 2 , 4 , and 6 are comments, but 3 and 5 are not comments because // appears within a literal.
3 is followed by + which indicates that the literal is continued on the next line. 5 is followed by a quotation mark which ends the literal, and the + indicates that the literal is concatenated with the literal on the next line.
// comment 1
DCL-S string // comment 2
CHAR(10);
string = 'abc // not-comment 3 +
def'; // comment 4
string = 'ghi // not-comment 5 ' +
'jkl'; // comment 6
...+... 1 ...+... 2 ...+... 3 ... // 7 ...+... 8 ...+... 9 ...+
1 a = 'abc'; // comment 1
2 b = 'abc' + // comment 1
3 'def'; // comment 1
4 c = 'abc + // comment 0
5 def'; // comment 1
For a list of operation codes supported in free-form calculations, see Operation Codes.