The Pre-processor

<< Click to Display Table of Contents >>

Navigation:  Reference > Pre-processor >

The Pre-processor

The CL pre-processor (PP) reads the CL script and interprets special commands, enclosed in square brackets, for text substitution, insertion and repeat processing.

The Pre-processor can be run without compiling the syntax using run control parameter PPONLY in which case it generates an expanded "PPP" file. The Pre-processor is incorporated into the compiler and is invoked every time the compiler is run. In this case, the pre-processing occurs as each line of a CL script is read, and it is the post-processed result that is passed to the compiler and listed in the Listing file.

All PP commands and their surrounding square brackets are removed from the output. If this means that a line of the CL script becomes blank, then it is not output. Lines in which PP commands were embedded are condensed. A new line is output wherever it appeared in the script (except where lines are empty, or in the case of insertion from *DATA sets). If a command causes text to be inserted into a line, this may increase the length of the line. If the output line is more than the setting of RCP MAXPPOUT, it is split into two or more output lines.

The PP *INSERT command allows you to build a CL script from two or more files. You can break a script into logical parts, reuse code by inserting it more than once or build general-purpose script files for use with different analysis projects.

Excel spreadsheets and Access tables (using ODBC 3.0) and CSV files can be accessed by the pre-processor.

IMPORTANT: there is no PP comment command. Lines beginning with ! (the standard comment for the compiler) are processed by PP. You can, however, use the PP *SKIP command to bypass PP commands.

For more information on Pre-processor:

Tips on using PP

Syntax

Indices

Recommended names

Substitutions

[+index] Add 1 and output value

Spreadsheet cell references

Data set references

Compiler variable and table size references

Subroutines

Nested PP commands

*ASK

*BLOCK

*DATA

*DBCLOSE

*DBCOLUMN

*DBEND

*DBFINDROW

*DBLINES

*DBLOOP

*DBOPEN

*DO

*DSEP

*END

*FOR

*HOLD

*INSERT

*LINES

*LAST

*POP

*PUSH

*SET

*SKIP

*label

Error handling

See also Run Control Parameters:

PP

PPONLY

NOPPINDB (deprecated)