I have a field from DB2 VarChar (500).
Have the definition with the level 49 fields, but don't know the proper definition for the XML layout
I am using the COBOL GENERATE command to create the XML output.
If I define the field in the XML layout as 500, but actual length is only 100, will the full 500 bytes be between the XML tags?
Do I have to define the XML fields as as table of 1 byte occuring 1 to 500 times depending on DB-FIELD-LEN?
Assuming the code would look something like the following:
05 DB-FIELD
49 DB-FIELD-LEN PIC S9(4) COMP
49 DB-FIELD-DATA PIC X(500)
01 XML-AREA.
05 DB2-varchar-field PIC X(???)
MOVE DB-FIELD-DATA(1:DB-FIELD-LEN) TO DB2-varchar-field.