View previous topic :: View next topic |
Author |
Message |
enge Beginner
Joined: 12 Oct 2004 Posts: 78 Topics: 39
|
Posted: Sat Oct 22, 2011 9:14 am Post subject: arrays and xml generate |
|
|
hello everyone,
i'll get to the point.
i have an array :
01 XML-OUTPUT PIC X(...).
01 XML-COUNTER PIC 9(...).
01 my-array.
03 my-array-elem occurs 10 times.
05 my-array-elem-field pic 9(05).
well , if i fill only 1-4 elements and then execute:
XML GENERATE XML-OUTPUT FROM my-array
COUNT XML-COUNTER
END-XML.
i obtain an xml :
<MY-ARRAY>
<MY-ARRAY-ELEM>
<MY-ARRAY-ELEM-FIELD>001</MY-ARRAY-ELEM-FIELD>
<MY-ARRAY-ELEM-FIELD>002</MY-ARRAY-ELEM-FIELD>
<MY-ARRAY-ELEM-FIELD>003</MY-ARRAY-ELEM-FIELD>
<MY-ARRAY-ELEM-FIELD>004</MY-ARRAY-ELEM-FIELD>
<MY-ARRAY-ELEM-FIELD>hex value</MY-ARRAY-ELEM-FIELD>
<MY-ARRAY-ELEM-FIELD>hex value</MY-ARRAY-ELEM-FIELD>
<MY-ARRAY-ELEM-FIELD>hex value</MY-ARRAY-ELEM-FIELD>
<MY-ARRAY-ELEM-FIELD>hex value</MY-ARRAY-ELEM-FIELD>
<MY-ARRAY-ELEM-FIELD>hex value</MY-ARRAY-ELEM-FIELD>
<MY-ARRAY-ELEM-FIELD>hex value</MY-ARRAY-ELEM-FIELD>
</MY-ARRAY-ELEM>
</MY-ARRAY>
now, do anybody can help me to obtain the same xml output without the tags with hex value? |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Sat Oct 22, 2011 10:58 am Post subject: |
|
|
suggest you change from a fixed length COBOL Internal Table to an ODO.
you do realize the XML-COUNTER field is populated by the XML GENERATE instruction.
you should spend some time reading the COBOL Programmers Guide - Producing XML output
specifically in section 5.2.4.1, the only examples of COBOL Internal Tables are allways ODO's
reason is probably, the length of the input area for the XML Generate
(if it can be variable)
can only be accomplished with ODO's and not fixed length COBOL Internal Tables.
by the way, arrays are DB2 Host Variables.
otherwise they are called COBOL Internal Tables (Fixed and Occurs Depending On) _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
enge Beginner
Joined: 12 Oct 2004 Posts: 78 Topics: 39
|
Posted: Sun Oct 23, 2011 7:53 am Post subject: |
|
|
thank you very much.... but ... odo does not work with nested tables,does it?
if i deal with with 2 tables :
01 my-outer-table.
01 my-outer-table-elems occurs 0 to 3 times depending on x
03 my-outer-table-elems-a pic ....
03 my-inner-table.
05 my-inner-table-elems occurs 0 to 2 times depending on y
07 my-inner-table-elems-a pic ...
i get an error from compiler ... therefore should i back to a normal declaration? and then .. what can i do to omit the hex value of 2 tables?
thank for your patience. |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Sun Oct 23, 2011 8:05 am Post subject: |
|
|
enge wrote: | i get an error from compiler . |
it is one thing not to bother reading the manuals,
or looking at websites such as ibmdeveloperworks.com,
But you really have to stop wasting our time with such useless posts as the one quoted
would not be suprised if it had something to do with 0 to 3
instead of 1 to 3. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
|
|