Document Templates : DGL Statements : Output Statements : INCLUDE Statement

INCLUDE Statement

Statement Syntax:

INCLUDE (file_description [, status]);

where file_description is either a file-name or an identifier of type FILE.

This statement copies the text of a specified file to an output segment file. The text is passed to the file verbatim and may contain formatting commands for the format processor that is used to produce the formatted document.

When the file_description is a file_name. It can be any string expression; it may be a literal string inside quotes (e.g. ‘ABC’) or an evaluated expression that produces a file name (e.g., a variable that contains a file name).

Note: The file_name may include the directory pathname of the file, using the file name conventions of the host operating system. If you do not specify the pathname, the Workarea is searched for the file.When the file_description is of type FILE, the file from which you are copying text must first be opened with an OPEN statement in OUTPUT mode.

When using the INCLUDE statement you may optionally include the status function code status which, upon successful execution of the statement, returns a value of stm_success.