FORTRAN Reference Manual
Compiler Directives
FORTRAN Reference Manual—528615-001
10-64
SOURCE Compiler Directive
•
You must write the SOURCE directive as the last directive if it appears on a line 
with other directives. You can continue the list of section names on subsequent 
lines. Each subsequent line must begin with a question mark (?) in column 1.
•
At the beginning of each section, the compiler sets the COLUMNS directive value 
to that specified by the last COLUMNS directive preceding the first SECTION 
directive in that file.
•
When all the specified sections are read, or the end of the file is reached, the 
compiler resets the COLUMNS directive value to what it was before encountering 
the SOURCE directive.
•
Before reading the first line from the file, and after reverting to the previous file, the 
compiler prints a line showing the ordinal, file name, and timestamp of the file 
currently being read. This line is suppressed by the NOLIST and SUPPRESS 
directives.
•
Do not use the SOURCE directive as the first line of an unnamed main program. 
Name the program using a PROGRAM statement, then write the SOURCE 
directive.
•
If the SOURCE directive does not include a list of section names, FORTRAN reads 
the entire file, regardless of whether the file contains SECTION directives.
If the SOURCE directive includes a list of section names, FORTRAN reads only 
those sections of the file delimited by SECTION directives within the file, and skips 
all other parts of the file. FORTRAN reads the specified sections in the order in 
which they physically occur in the file, which is not necessarily the same as the 
ordering of the section name list in the source directive.
For information about declaring sections in a source program, see the SECTION 
Compiler Directive on page 10-61.
Examples
The following directive reads the entire file NEWPROG:
?SOURCE newprog
The following directive reads sections A and C from the file ROUTINES:
?SOURCE routines(a,c)










