INCLUDE "fid-str" [,options]* or INCLUDE : fid-param [,options]*
include "myumc/common" include "debugcode",multiple parameter (fid="yyy") include : fid
The Fortran 77 compiler supports a source "include" facility. The INCLUDE statement either directly names a GCOS file to be included, or gives a name (fid) which is resolved according to a set of search rules.
If the "fid" does not contain any slashes, the text to be included is found by a search process involving a set of "search rules". In batch, a search rule is specified as a record in file code SR. In TSS, a search rule is specified with the Search= option of the F77 command. Search rules are processed in the order given until a match for the name is found. If no match is found, the compiler will give an appropriate error message.
There are three possibilities for a search rule. It can be a full GCOS pathname of a sequential file, where the final element (i.e. the filename under the last subcatalog) matches the include name (fid) we are looking for. It can be a full pathname of a source library file (SRCLIB) whose members are to be considered candidates for inclusion. Finally, it can be a catalog pathname with a trailing slash (e.g. "myuser/includes/"), where the sequential files under that catalog are candidates for inclusion.
When sequential files are included (i.e. when the text does not come from a SRCLIB library), they must be the same format as the file including them. In other words, both must be ASCII or both BCD. Similarly, attributes such as line numbering and formatting must match. The usual practice of keeping all source files as ASCII files with proper Fortran formatting will save many headaches. If you are compiling in batch, refer to your source with a $PRMFL card instead of a $$SELECT.
INCLUDE statements are NOT part of the ANSI standard for Fortran-77. They are, however, part of a set of extentions defined by a U.S. military standard (MIL-STD-1753), and so will be found in Fortran compilers from most of the major manufacturers. Naturally, absolute pathnames are NOT portable. The Unix 4.2 BSD compiler does NOT support options on the INCLUDE statement.
Included text may contain at most one subprogram. If it contains an END statement, it must be the last line of the included text.
Copyright © 1996, Thinkage Ltd.