2.3 Source Forms

Within a program, source code can be in free, fixed, or tab form. Fixed or tab forms must not be mixed with free form in the same source program, but different source forms can be used in different source programs.

All source forms allow lowercase characters to be used as an alternative to uppercase characters.

Several characters are indicators in source code (unless they appear within a comment or a Hollerith or character constant). The following are rules for indicators in all source forms:

Table 2-2 summarizes characters used as indicators in source forms:

Table 2-2 Indicators in Source Forms

Source Item  Indicator[1]  Source Form  Position 
Comment  All forms  Anywhere in source code 
Comment line  Free  At the beginning of the source line 
  !, C, or *  Fixed  In column 1 
    Tab  In column 1 
Continuation line[2]  Free  At the end of the source line  
  Any character except zero or blank  Fixed  In column 6 
  Any digit except zero  Tab   After the first tab 
Statement separator  All forms  Between statements on the same line 
Statement label  1 to 5 decimal digits  Free  Before a statement 
    Fixed  In columns 1 through 5 
    Tab  Before the first tab 
A debugging statement[3]   D   Fixed  In column 1  
    Tab  In column 1  

[1] If the character appears in a Hollerith or character constant, it is not an indicator and is ignored.
[2] For all forms, up to 511 continuation lines are allowed.
[3] Fixed and tab forms only.

Source code can be written so that it is useable for all source forms (see Section 2.3.3).

Statement Labels

A statement label (or statement number) identifies a statement so that other statements can refer to it, either to get information or to transfer control. A label can precede any statement that is not part of another statement.

A statement label must be one to five decimal digits long; blanks and leading zeros are ignored. An all-zero statement label is invalid, and a blank statement cannot be labeled.

Labeled FORMAT and labeled executable statements are the only statements that can be referred to by other statements. FORMAT statements are referred to only in the format specifier of an I/O statement or in an ASSIGN statement. Two statements within a scoping unit cannot have the same label.

For More Information:

For details on labels in free source form, see Section 2.3.1; in fixed or tab source form, see Section 2.3.2.

Previous Page Next Page Table of Contents