Altering the SQL text

The parse exit common area contains a pointer to the SQL text area. The text area consists of the SQL text preceded by a 2-byte SQL length field, which provides the number of bytes in the SQL text. (The SQL length field does not include the 2 bytes for the length field itself.)

If your exit routine changes the length of the SQL text, it must also change the value in the 2-byte length field.

NoteAs you code your exit routine to alter the SQL text, be aware that AMD2 does not modify the SQL text after your routine is executed. Therefore, the SQL statements must be in the DB2 syntax before the parse exit routine returns to AMD2.