This topic describes the differences between the SQL preprocessors from the new and the old compiler.
The V4R2 compiler dropped support for the following SQL preprocessor options:
The SQL preprocessor no longer supports the LOB option. If your program relies on how LOBs are represented in the code that is generated by the SQL preprocessor, you must change the program.
You can now use SQL TYPE anywhere other PL/I data attributes can be used. Therefore, you can eliminate any dependency on how the preprocessor translates LOB declarations in your code, and thus write simpler and cleaner code.
For instance, the variable XML_DOC_STRUC in the following example depends on a particular implementation of the CLOB type. Therefore, the compiler cannot compile the code if you use the SQL preprocessor from V4R2.
DCL
1 DOCM_STRUC,
2 MODEL_EXECN_ID_STRUC FIXED BIN(31),
2 DOCM_TYPE_CD_STRUC CHAR(1),
2 XML_DOC_STRUC,
3 XML_DOC_ARRY_LENGTH FIXED BIN(31),
3 XML_DOC_ARRY_DATA,
4 XML_DOC_DATA1(3) CHAR(32767),
4 XML_DOC_DATA2 CHAR(4099);
DCL MODEL_EXECN_ID_ARRY(5) FIXED BIN(31);
DCL DOCM_TYPE_CD_ARRY(5) CHAR(1);
DCL XML_DOC_ARRY(5) SQL TYPE IS XML AS CLOB(100K);
EXEC SQL FETCH NEXT ROWSET FROM DOCM_CSR FOR 5 ROWS
INTO :MODEL_EXECN_ID_ARRY
,:DOCM_TYPE_CD_ARRY
,:XML_DOC_ARRY;
XML_DOC_STRUC = XML_DOC_ARRY(I);
You can change the code in the previous example to the following code by using SQL TYPE. The compiler can compile it with the SQL preprocessor or the precompiler from V4R2, but you cannot compile it with the preprocessor from V4R1 or earlier releases.
DCL
1 DOCM_STRUC,
2 MODEL_EXECN_ID_STRUC FIXED BIN(31),
2 DOCM_TYPE_CD_STRUC CHAR(1),
2 XML_DOC_STRUC SQL TYPE IS XML AS CLOB(100K);
DCL MODEL_EXECN_ID_ARRY(5) FIXED BIN(31);
DCL DOCM_TYPE_CD_ARRY(5) CHAR(1);
DCL XML_DOC_ARRY(5) SQL TYPE IS XML AS CLOB(100K);
EXEC SQL FETCH NEXT ROWSET FROM DOCM_CSR FOR 5 ROWS
INTO :MODEL_EXECN_ID_ARRY
,:DOCM_TYPE_CD_ARRY
,:XML_DOC_ARRY;
XML_DOC_STRUC = XML_DOC_ARRY(I);
The new SQL preprocessor flags with warning messages the following two kinds of invalid host variable references that the old preprocessor did not flag:
dcl 1 A(<bounds>), 2 B <data-type>; dcl 1 A, 2 B (<bounds>) <data-type>;If you use A as a host reference, the old SQL preprocessor would accept the reference as valid. However, the new SQL preprocessor flags it with a warning message. The reference should be changed to A.B.
dcl 1 X, 2 X, 3 Y <data-type>, 3 Z <data-type>, ... /* and no other level-2 items */If you use X as a host reference, the old SQL preprocessor would accept it as valid. The new SQL preprocessor flags it with a warning message. The reference should be changed to X.X.
Before Enterprise PL/I for z/OS V4R2, the facility ID was SQL for messages that were produced by the back end of the SQL preprocessor. You could use the IBM supplied compiler user exit (IBMUEXIT) to suppress these messages or to change the severity of them.
As of V4R2, the facility ID of all messages is IBM, and you cannot change the severity of these messages by using the IBM supplied IBMUEXIT.
However, you can change the severity of DB2 messages or suppress them entirely by modifying IBMUEXIT. For details on how to do this, see Chapter 22. Using user exits in the Enterprise PL/I for z/OS V4R2 Programming Guide.