The PL/I compiler allows you to select one or more of the
integrated preprocessors as required for use in your program. You
can select the include preprocessor, the macro preprocessor, the SQL
preprocessor, or the CICS® preprocessor—and you can select
the order in which you would like them to be called.
Each preprocessor supports a number of options to allow you to
tailor the processing to your needs.
- Include preprocessor
This allows you to incorporate external
source files into your programs by using include directives other
than the PL/I directive %INCLUDE (the %INCLUDE directive is used to
incorporate external text into the source program).
- Macro preprocessor
Macros allow you to write commonly used PL/I
code in a way that hides implementation details and the data that
is manipulated, and exposes only the operations. In contrast to a
generalized subroutine, macros allow generation of only the code that
is needed for each individual use.
- DB2 precompiler or DB2 coprocessor
In general, the structure
of your Pl/I program is the same whether or not you want it to access
a DB2 database. However, to retrieve, update, insert, and delete DB2
data, you must:
- Connect to a data server.
- Execute SQL statements. SQL statements must begin with EXEC SQL.
- Disconnect from the data server.
To prepare the program for execution, you follow one of
these procedures:
- Preprocess, precompile, compile, link, and bind the program.
- Preprocess, then compile the program with the SQL option, and
then link and bind the program.
Before you can take advantage of EXEC SQL support, you
must have authority to access a DB2® system.
Note
that the PL/I SQL Preprocessor currently does not support DBCS.
- CICS preprocessor
You can use EXEC CICS statements
in PL/I applications that run as transactions under CICS.
Related reading: For more information about using PL/1 on z/OS®,
see the IBM® publications Enterprise PL/I for z/OS V3R3
Language Reference, SC27-1460, and Enterprise PL/I for z/OS V3R3
Programming Guide, SC27-1457.