XL Fortran for AIX 8.1

Language Reference



The INCLUDE compiler directive inserts a specified statement or a group of statements into a program unit.


            '-(--name--)------------'  '-n-'

name, char_literal_constant (delimiters are optional)
specifies filename, the name of an include file

Under the AIX operating system, it need not specify the full path of the desired file, but it must specify the file extension if one exists.

name must contain only characters allowable in the XL Fortran character set. See Characters for the character set supported by XL Fortran.

char_literal_constant is a character literal constant.

is the value the compiler uses to decide whether to include the file during compilation. It can be any number from 1 through 255, and cannot specify a kind type parameter. If you specify n, the compiler includes the file only if the number appears as a suboption in the -qci (conditional include) compiler option. If you do not specify n, the compiler always includes the file.

A feature called conditional INCLUDE provides a means for selectively activating INCLUDE compiler directives within the Fortran source during compilation. You specify the included files by means of the -qci compiler option.

In fixed source form, the INCLUDE compiler directive must start after column 6, and can have a label.

You can add an inline comment to the INCLUDE line.


An included file can contain any complete Fortran source statements and compiler directives, including other INCLUDE compiler directives. Recursive INCLUDE compiler directives are not allowed. An END statement can be part of the included group. The first and last included lines must not be continuation lines. The statements in the include file are processed with the source form of the including file.

If the SOURCEFORM directive appears in an include file, the source form reverts to that of the including file once processing of the include file is complete. After the inclusion of all groups, the resulting Fortran program must follow all of the Fortran rules for statement order.

For an INCLUDE compiler directive with the left and right parentheses syntax, XL Fortran translates the file name to lowercase unless the -qmixed compiler option is on.

The AIX file system locates the file specified by filename as follows:


INCLUDE '/u/userid/dc101'     ! full absolute file name specified
INCLUDE '/u/userid/dc102.inc' ! INCLUDE file name has an extension
INCLUDE 'userid/dc103'        ! relative path name specified
INCLUDE (ABCdef)              ! includes file abcdef
INCLUDE '../Abc'              ! includes file Abc from parent directory
                              ! of directory being searched

Related Information

"-qci Option" in the User's Guide

[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]