Include CL Source (INCLUDE)
The Include CL Source (INCLUDE) command includes external text into the source program being compiled. The external text must be valid CL commands that are valid in a compiled CL program. These commands can be declare statements (like DCLFCLF, DCLF, or DCL), control flow statements (like IF or SELECT), or regular CL commands (like OPNFCLF, READRCDCLF, or CRTLIB). However, the included text cannot cause a declare command to appear after non-declare commands.
Restrictions:
- The INCLUDE command is valid only within a CL program.
- This function can only be used in a CL program that is created using a CLF precompiler command. The CLF precompiler commands are CRTBNDCLF, CRTCLFMOD, and CRTCLFPGM.
- The CRTBNDCLF, CRTCLFMOD, and CRTCLFPGM commands support a maximum of 5 nested INCLUDE commands.
- You must have use (*USE) authority to the file specified for the Source file (SRCFILE) parameter, and execute (*EXECUTE) authority to the library that contains the source file.
| Keyword | Description | Choices | Notes |
| SRCMBR |
Source member |
Name |
Optional, Positional 1 |
| SRCFILE |
Source file |
Qualified object name |
Optional |
| Qualifier 1: Source file |
Name, *INCFILE |
| Qualifier 2: Library |
Name, *LIBL, *CURLIB |
Source member (SRCMBR)
Specifies the source that contains the CL program source to be included.
This is a required parameter.
- name
- Specify the name of the source member.
Source file (SRCFILE)
Specifies the source file that contains the source member to be included.
Single Values: Source file
- *INCFILE
- The file specified for the INCLUDE file (INCFILE) parameter of the CRTBNDCLF, CRTCLFMOD, or CRTCLFPGM command is used.
Qualifier 1: Source file
- name
- Specify the name of of the source file.
Qualifier 2: Library
- *LIBL
- All libraries in the library list for the current thread are searched until the first match is found.
- *CURLIB
- The current library for the thread is used to locate the source file. If no library is specified as the current library for the thread, the QGPL library is used.
- name
- Specify the name of the library to be searched.
Examples for INCLUDE
Example 1: Simple Command Example
Include SrcMbr(GENVC2DPT)
This command includes the source statements found in member GENVC2DPT of the file specified by the INCFILE parameter of the CRTBNDCLF, CRTCLFMOD, or CRTCLFPGM command. By default this file would be the same source file that contains the source program currently being compiled.
Error messages for INCLUDE
*ESCAPE Messages
- VC25057
- The &1 command is intended only for CLF precompiler support.
|