Question & Answer
Question
Why are the JSON fields are being shortened by 1? I am running z/OS Connect Enterprise Edition (zCEE) on z/OS 2.2 at this level:
WebSphere Application Server 17.0.0.2, WAS FOR Z/OS 17.0.0.2, z/OS
Connect 03.00.04 (wlp-1.0.17.cl170220170523-1818)
I am setting up an example to show zCEE doing an API call to a C program in CICS Transaction Server for z/OS (CICS TS).
I created a simple C program that I can run in CICS TS V5.3, that takes a CommArea as input.
This shows the C structure that maps the CommArea for output:
struct outputCommarea_v1 {
char ca_output_field_1[10];
char ca_output_field_2[20];
int ca_output_number_1;
long ca_output_number_2;
char ca_cics_tran_id[4];
char ca_userId[8];
char ca_jobname[8];
char ca_distributedName[246];
char ca_realm[255];
}output ;
Note for example this field - char ca_jobname[8];
I ran job to generate the sar file and in the generated JSON the above field is defined this way:
"ca_jobname":{
"type":"string",
"maxLength":7
}
You can see from above, that in the C code the field is defined as length of 8 bytes, but the JSON field is defined with max length of 7 bytes.
The result is that my code sets this field to the jobname of the CICS region, for example, CICS1234, but the resulting JSON output for this field is truncated to CICS123.
This same shortening of all character fields by one happens for all such fields.
Log InLog in to view more of this document
Product Synonym
CICS/TS CICSTS CICS TS CICS Transaction Server
zCEE
Was this topic helpful?
Document Information
Modified date:
14 February 2023
UID
dwa1434192