Command reference / CL

INCLUDE

Include CL Source

Includes external text into the source program being compiled. The external text must be valid CL commands for a compiled CL source, such as declare statements (DCL or DCLF), control flow statements (IF or Select), or regular CL commands. The included text cannot cause declare commands to appear after non-declare commands.

Allowed environments: *BPGM, *IPGM. Use within a CL program. Positional parameters: 2.

Restrictions

Parameters

SRCMBR Source member

Specifies the source member that contains the CL program source to be included.

Type
*NAME
Required
No
Length
10
Case
Uppercase

SRCFILE Source file

Specifies the source file that contains the source member to be included.

Type
*QUAL
Required
No
Default
*INCFILE
Case
Uppercase

Suggested / special values: *INCFILE

*INCFILE
The file specified for the INCLUDE file (INCFILE) parameter on the CL command used to invoke the CL compiler is used.
*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. If no current library is set, QGPL is used.
Qualified parts (object, then library; write LIBRARY/OBJECT)

Source file Source file

Type
*NAME
Required
No
Length
10
Case
Uppercase

Library Library

Type
*NAME
Required
No
Default
*LIBL
Length
10
Case
Uppercase

Suggested / special values: *LIBL, *CURLIB

SRCSTMF Source stream file

Specifies the path name of the stream file containing the CL source to be included. An absolute path name starts with '/'. A relative path name is resolved by prepending the searched including directory, which is the source directory first and then the directories specified in INCDIR.

Type
*PNAME
Required
No
Length
5000
Case
Uppercase

Examples

INCLUDE SRCMBR(DCLSET1) SRCFILE(*INCFILE)

Includes the CL program source in member DCLSET1 at compile time. The member must be in the file specified for INCFILE on the CL command that invoked the compiler.

INCLUDE SRCSTMF('/dir/pay_data.cl')

Includes the CL program source in stream file /dir/pay_data.cl at compile time.

IBM command documentation

Generated from os/cl/catalog/INCLUDE.json and os/cl/help/INCLUDE.json.