Rational Developer for System z
Enterprise PL/I for z/OS, Version 4.2, Compiler and Run-Time Migration Guide

SQL preprocessor differences from Enterprise PL/I V4R1

Dropped SQL preprocessor options
Handling of LOB declarations
Invalid host variable references
Handling of SQL preprocessor messages

This topic describes the differences between the SQL preprocessors from the new and the old compiler.

Dropped SQL preprocessor options

The V4R2 compiler dropped support for the following SQL preprocessor options:

Handling of LOB declarations

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);                              
                                                 

Invalid host variable references

The new SQL preprocessor flags with warning messages the following two kinds of invalid host variable references that the old preprocessor did not flag:

Handling of SQL preprocessor messages

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.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)