System i Resources
enskill.com

 

Onsite Classes
Expert System i training comes to you! RPG, SQL, WDSc and more.
 

DVD Training
Self-paced RPG IV classes and labs on your schedule.
 

System i Books
from leading System i authors.
 

e-Learning
Live instructor, no travel. Attend from your office or home.
 

Compiler Directives

Directives Used with Free Format Calculations

/FREE
/END-FREE
Begin/end free format calculation block

Directives to Copy Code at Compile Time

/COPY {{library/}file,}member
/COPY {path/}file
Copies code from another source file or IFS file into compile process
/INCLUDE {{library/}file,}member
/INCLUDE {path/}file
Copies code from another source file or IFS file into compile process.

For embedded SQL, /INCLUDE will not be effective unless you compile with CRTSQLRPGI … RPGPPOPT(*LVL2)

Conditional Compilation Directives

/DEFINE condition-name Defines a condition, and adds it to the list of currently defined conditions
/EOF End of file. Compiler ignores the subsequent lines
/ELSE If the previous /IF or /ELSEIF was not true, the compiler reads the subsequent lines until /ENDIF
/ELSEIF {NOT} DEFINED (condition-name
| *CRTBNDRPG |*CRTRPGMOD | *VxRxMx
| *ILERPG)
If the previous /IF or /ELSEIF was not true, but the current condition is true, the compiler reads the subsequent lines until /ELSE, /ELSEIF or /ENDIF
/IF {NOT} DEFINED (condition-name
| *CRTBNDRPG |*CRTRPGMOD | *VxRxMx
| *ILERPG)
If the condition is true, the compiler reads the subsequent lines until /ELSE, /ELSEIF or /ENDIF
/UNDEFINE condition-name Removes a condition from the list of currently defined conditions

Directives Used with Embedded SQL

/EXEC SQL
/END-EXEC
Begin/end SQL statement in fixed format calculations.
EXEC SQL Begins SQL statement in free format calculations. SQL statement ends with semicolon (;)

Directives Affecting Compiler Listing

/EJECT Listing skips to next page
/SPACE number Listing spaces 1-112 lines
/TITLE title-information Specifies title information for each page of compiler listing

Index | HomePage | Programming | RPG IV | Compiler Directives