Ensuring ODBC Connection Compatibility

To ensure that you configure the DB2 ODBC initialization file correctly, follow the guidelines in the DB2 UDB for z/OS ODBC Guide and Reference manual. One important consideration is the coding of the open and close square brackets (the [ character and the ] character). The square bracket characters are "variant" characters that are encoded differently in different coded character set identifiers (CCSID), but must be of the IBM-1047 CCSID in the ODBC initialization file. DB2 ODBC does not recognize brackets of any other CCSID. Note the following:

  • The first (or open) bracket must use the hexadecimal characters X'AD' (0xAD).

  • The second (or close) bracket must use the hexadecimal characters X'BD' (0xBD).

To set the correct code for square brackets, use any of the following methods.

  • Use the hex command in OEDIT and change the hex code for each character appropriately.

  • Use the iconv utility to convert the ODBC initialization file. For example, to convert from CCSID IBM-037 to IBM-1047, use the following command:

    iconv -f IBM-037 -t IBM-1047 ODBC.ini > ODBC-1047.ini 
    mv ODBC-1047.ini ODBC.ini 
    
  • Change your terminal emulator or terminal configuration to use CCSID IBM-1047 when you create or alter the file.