Release the NEW Power of CL

Release the NEW Power of CL

Name:

Email:

Profile Manager

Stop spending time and money reinstating user profiles!

Try Profile Manager Today!

30 DAY FREE TRIAL

Learn More

Programming Services

Do you need a program written?

Bruce Vining Services can provide highly experienced IBM i developers to supplement your staff with short term contracts. If you are looking for custom solutions involving system functions such as communications, database, security, encryption, print, and work management you will find your answers at Bruce Vining Services.

PDF Print E-mail

Include CL Source (INCLUDE)

Where allowed to run:
  • Batch program (*BPGM)
  • Interactive program (*IPGM)
Threadsafe: Yes
Parameters
Examples
Error messages

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.
Top

Parameters

KeywordDescriptionChoicesNotes
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
Top

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.
Top

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.
Top

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.

Top

Error messages for INCLUDE

*ESCAPE Messages

VC25057
The &1 command is intended only for CLF precompiler support.
Top
 
Joomla 1.5 Templates by Joomlashack