A fix is available
APAR status
Closed as program error.
Error description
Some Unicode characters from range \u0000 to \u001F converted by BSON2JSON are neither printed correctly nor returned in their original input format like '\u001A'. BSON2JSON should return readable JSON output where Unicode characters are displayed in their original input format as is, for example "\u001A" will be displayed as "\u001A". Sample query: SELECT SYSTOOLS.BSON2JSON( SYSTOOLS.JSON2BSON('{"field1" : "\u001A"}') ) FROM SYSIBM.SYSDUMMY1; may return following row: {"field1":"\u001:"} ADDITIONAL SYMPTOMS: INCORROUT DB2INCORR/K SQLINCORR SQLINCORROUT JSON BSON2JSON
Local fix
Problem summary
**************************************************************** * USERS AFFECTED: * * All Db2 12 and 13 for z/OS users who work * * on JSON documents using Db2 provided UDF's * * (user-defined functions). * **************************************************************** * PROBLEM DESCRIPTION: * * This APAR addresses multiple problems * * that can occur while processing JSON * * documents when using the * * SYSTOOLS.JSON2BSON, and * * SYSTOOLS.JSON_TABLE function. * **************************************************************** * RECOMMENDATION: * * Apply corrective PTF when available * **************************************************************** (1) An unexpected result can be returned from SYSTOOLS.JSON2BSON when a JSON document contains a hex string between \u0000 and \u0020 and contains an alphabet character. Example ------- SELECT SYSTOOLS.BSON2JSON( SYSTOOLS.JSON2BSON('{"field1":"\u001a"}') ) FROM SYSIBM.SYSDUMMY1; This query was returning "field1":"\u001:" as SYSTOOLS.JSON2BSON function was not processing the hex string correctly. After the fix, this query returns {"field1":"\u001a"}. (2) When SYSTOOLS.JSON_TABLE processes JSON document containing nested array, it may not return the result set even if there exists JSON data that matches the JSON field specified in INELEM parameter. Example ------- SELECT X.VALUE FROM TABLE(SYSTOOLS.JSON_TABLE(SYSTOOLS.JSON2BSON( '{"json":{"obj1":{"obj2":[{"field1":123, "obj2": 456}] }}}'), 'json.obj1.obj2.0','s:30')) X;
Problem conclusion
Db2 provided UDF's (user-defined functions) for JSON support have been updated to address the two problems listed. Additional Keywords: SQLINCORR INCORROUT SQLINCORROUT DB2INCORR/K JSON SQLUDF
Temporary fix
********* * HIPER * *********
Comments
APAR Information
APAR number
PH46155
Reported component name
DB2 OS/390 & Z/
Reported component ID
5740XYR00
Reported release
420
Status
CLOSED PER
PE
NoPE
HIPER
YesHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2022-05-05
Closed date
2022-07-12
Last modified date
2024-01-11
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
UI81428
Modules/Macros
DSN5JSTA DSN5JSTB DSN5JSGP DSN5JVL DSN5JSUP DSN5JSTP DSN5JSBI DSN5JSBJ DSN5JSJB DSN5JSBT DSN5JSLN
Fix information
Fixed component name
JSON
Fixed component ID
JSON00001
Applicable component levels
R410 PSY UI81428
UP22/07/20 P F207 ¢
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":"BU011","label":"Systems - zSystems software"},"Product":{"code":"SG19M"},"Platform":[{"code":"PF054","label":"z Systems"}],"Version":"420"}]
Document Information
Modified date:
12 January 2024