IBM Support

PI76099: FF PI57768 TO DB2 12: INVALID HEX STRINGS PASSED TO DSNREXX ARE NOT VALIDATED AND INCORROUT WILL OCCUR

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • FF APAR PI57768 to DB2 12: There are three errors being reported
    1. When a hex value with a lower case hex character is passed,
    ie aa or ff, the translation results in x'00'.
    2. When an invalid character is passed as part of a hex string,
    ie x'0123Y-', the invalid characters are converted to x'00'.
    3. When an invalid length hex string is passed, ie x'123', the
    value is not being marked invalid and incorrect conversion
    results.
    

Local fix

  • Validate hex strings before passing to DSNREXX
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * All DB2 12 for z/OS users who use DB2 REXX                   *
    * Language support (DSNREXX) to process                        *
    * SQL statements that contain character data                   *
    * in hexadecimal format.                                       *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * Incorrect output can occur in three                          *
    * different ways when using DSNREXX to                         *
    * process an EXECUTE USING or OPEN                             *
    * USING request that supplies a hex                            *
    * string:                                                      *
    * (1) Valid lower case letters in a hex                        *
    *     string cause the containing byte                         *
    *      to be converted to null.  For                           *
    *     example, x'abCDeF' is converted                          *
    *     to x'00CD00'.                                            *
    * (2) Characters other than '0' - '9'                          *
    *     or 'A' - 'F' in a hex string cause                       *
    *     the containing byte to be                                *
    *     converted to null.                                       *
    *     For example, 'ABC-EF' is converted                       *
    *      to x'AB00EF'.                                           *
    * (3) Incomplete (odd-numbered length)                         *
    *     hex strings are misinterpreted.                          *
    *     For example, x'AABCDE7' is                               *
    *     converted to x'ABCDE7'.                                  *
    * No error or warning is given in any                          *
    * of these cases.                                              *
    *                                                              *
    * Additional Keywords: SQLINCORROUT                            *
    *                                                              *
    * This problem is resolved by APAR                             *
    * PI57768 in DB2 10 (PTF UI44551)                              *
    * and DB2 11 (PTF UI44552).                                    *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Apply corrective PTF when available                          *
    ****************************************************************
    Character data in SQL statements can be expressed in
    hexadecimal format.  For example, these statements
    are equivalent:
    
      SELECT '1' FROM SYSIBM.SYSDUMMY1;
    
      SELECT X'F1' FROM SYSIBM.SYSDUMMY1;
    
    As noted in the Problem Description section, DSNREXX currently
    has problems handling both valid hex strings (those that
    contain 'a' - 'f' in place of 'A' - 'F') and invalid hex
    strings (those that have inappropriate characters or an
    odd-numbered length). These problems occur when DSNREXX
    processes an EXECUTE USING or OPEN USING statement that
    supplies a hex string.  For example, the following code shows
    how problem (3) can occur when using the EXECUTE USING
    statement to insert a row of data:
    
      STMT = "INSERT INTO MYTAB(MyVarcharColumn) VALUES(?)";
      "EXECSQL PREPARE S1 INTO :OUTSQLDA FROM :STMT";
      HEXSTRING = "X'1234567'";
      "EXECSQL EXECUTE S1 USING :HEXSTRING'
    
    ==> Result: MyVarcharColumn contains x'234567'.
    

Problem conclusion

  • In response, this APAR corrects DSNREXX to handle hex strings
    with valid lower-case letters, 'a' - 'f', correctly.  It also
    modifies DSNREXX to reject hex strings that have an odd-
    numbered length or that contain invalid characters with
    SQLCODE -110.
    ---------------------------------------------------------------
    ATTENTION for customers who bind DSNREXX with an application
    encoding scheme for Japanese Extended Katakana:
    CCSID 930, 1390, or 5026.
    ---------------------------------------------------------------
    When DSNREXX runs with a package that was bound with a CCSID
    setting of 930, 1390, or 5026, any SQL statements that express
    hexadecimal characters in lower case, 'a' - 'f', are not
    supported and will be rejected with SQLCODE -104 or SQLCODE
    -110.  That is necessary because in CCSID 290 (the single-byte
    character set associated with 930, 1390 and 5026), lower case
    latin characters, including 'a' - 'f', do not reside at the
    standard code points for such characters.  Therefore, letters
    in hex characters must be in upper case, 'A' - 'F'.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI76099

  • Reported component name

    DB2 OS/390 & Z/

  • Reported component ID

    5740XYR00

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2017-02-06

  • Closed date

    2017-07-17

  • Last modified date

    2017-08-02

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    UI48845

Modules/Macros

  • DSNTZUSI
    

Fix information

  • Fixed component name

    DB2 OS/390 & Z/

  • Fixed component ID

    5740XYR00

Applicable component levels

  • RC10 PSY UI48845

       UP17/08/01 P F707

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEPEK","label":"Db2 for z\/OS"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}},{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.0","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
02 August 2017