I am getting very strange scenario. I have one array defined in my COBOL pgm.
05 A-TABLE.
10 A-TABLE-LIST OCCURS 10 TIMES INDEXED BY A-IDX.
15 FILLER PIC X(7) VALUE '<TEST>'.
15 A-LIST-VALUE PIC X(30).
15 FILLER PIC X(8) VALUE '</TEST>'.
I am setting A-IDX=1 and moving ‘XYZ’ to A-LIST-VALUE(A-IDX).
While displaying A-TABLE, it is showing as
XYZ——————————
and all spaces… 🙁
I am not getting what is the issue here?
Can anyone help me to resolve this?
Regards,
Saisha.
You cannot set values for a table that way. One way to set values in a table is to use a REDEFINES and a separate data area.
That is pretty cumbersome. Another method is to MOVE the data in at runtime in an initialisation paragraph.
I didn’t try compiling any of these, this is just freehand.
As a side note, if you are using Enterprise COBOL version 3.2 or higher and you are trying to create XML in COBOL, there exists an XML GENERATE statement.