Hello again everyone,
I have been trying to use the new JSON PARSE statement and I am having a
little difficulty in understanding what is really needed.

I have a JSON document that looks something along the lines of:
{"httpHeaders":{"traceID":"my trace id data","spanID":"my spanid data"}}

I pass this to my CICS COBOL PROGRAM, where I have a working storage area
like this:
05  WS01-CONTEXT-HEADERS.
      10  WS01-CH-TRACE-DATA PIC X(36).
      10  WS01-CH-SPAN-DATA PIC X(36).

In the program I have a JSON PARSE statement like this:
JSON PARSE my input UTF8 data
        INTO  WS01-CH-CONTEXT-HEADERS
        WITH DETAIL
        NAME OF WS01-CONTEXT-HEADERS is 'httpHeaders'
                         WS01-CH-TRACE-DATA is 'traceID'
                         WS01-CH-SPAN-DATA is 'spanID'
END-JSON

Yes, I also have on exception ....

In any event, when I run this, it does what I want it to do, specifically,
that WS01-CH data fields have the data I want after the PARSE completes.
However, since I have WITH DETAIL specified, I can see a few things in the
CICS Region logs.
A few IGZ0321I messages..... IGZ0321I During execution of the JSON PARSE
statement on line 16801 of program MYPROGR, no JSON name/value TRACEID,
which was thus not modified.

huh?
I think this means that the JSON object did not contain a name/value pair
for "TRACEID".
Which is what is expected because I specified "NAME OF" in the parse
statement.
So is this just to inform me things were done as I requested?

I realize this is just an FYI, and it will disappear when I get rid of
"WITH DETAIL".
I explicitly said I had other variables I wanted to use.
The program ran and did what I wanted.
What if anything, can I do to remove this Informational message?

Last question, because I am curious.
This is an http CONTEXT Header coming in over a z/OS Connect POST CICS
Container request.
Can I modify anything in the Context Header in my COBOL program, and have
it returned to z/OS Connect outside of the actual Response Message
Container that goes back?
Somehow it just seems wrong to think about that. The CONTEXT HEADERS are
likely read only.
But I don't know enough yet to understand this.
And I am having way too much fun.........

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to