Hi ,
My requirement is need to append XML tags and then send data.
I have defined a copybook with required field tags. I use XML GENERATE to generate the tags in xml format in cobol (i.e) this will append start and end tags as per copybook defined variable.
for example
Copybook field name :side
Output after using XML generate: <side>2</side>
But, for few field, i dont want the same start tag to be appended at end.
like,
currently using the above mentioned logic fileds are populated as below,
<reference-id1-type>ABCD</reference-id1-type>
<reference-id1>123456</reference-id1>
<reference-id2-type>EFGH</reference-id2-type>
<reference-id2>12345677</reference-id2>
<reference-id3-type>IJKL</reference-id3-type>
<reference-id3>12345667</reference-id3>
<reference-id4-type>MNOP</reference-id4-type>
<reference-id4>1111111</reference-id4>
<reference-id5-type>RSTU</reference-id5-type>
<reference-id5>1234455678</reference-id5>
but i want it to be populated in below way.....
<referenceIDGroup>
<referenceID referenceIDType="ABCD">123456</referenceID>
<referenceID referenceIDType="EFGH">12345677</referenceID>
<referenceID referenceIDType="IJKL">12345667</referenceID>
<referenceID referenceIDType="MNOP">1111111</referenceID>
<referenceID referenceIDType="RSTU">1234455678</referenceID>
</referenceIDGroup>
is there any way to populate it this way? pls let me know your suggestions.
Thanks
XML GENERATE TAGS
-
- Posts: 35
- Joined: Wed Jan 16, 2013 4:05 pm
- Skillset: COBOL
- Referer: Google
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: XML GENERATE TAGS
pls let me know your suggestions.
start posting to the right forum section COBOL in this case

cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Global moderator
- Posts: 3805
- Joined: Tue Jan 25, 2011 12:02 am
- Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
- Referer: Google
Re: XML GENERATE TAGS
Your topic will be moved to the Cobol part of the forum once you reply.
Why do you want to do that? Can something which "understands" XML still read a file like that?
Why do you want to do that? Can something which "understands" XML still read a file like that?
-
- Posts: 35
- Joined: Wed Jan 16, 2013 4:05 pm
- Skillset: COBOL
- Referer: Google
Re: XML GENERATE TAGS
Sorry fir posting in wrong section. Pls move .
i guess it will understand. Even i am not sure abt that.
i guess it will understand. Even i am not sure abt that.
-
- Global moderator
- Posts: 3805
- Joined: Tue Jan 25, 2011 12:02 am
- Skillset: Easytrieve Plus, Cobol, Utilities, that sort of stuff
- Referer: Google
Re: XML GENERATE TAGS
Well, "guessing" isn't much use with computers. If you "guess" you can waste a lot of effort only to discover that what you have achieved is pointless.
Paste your example into something which can "understand" XML and see if you get what you expect.
Paste your example into something which can "understand" XML and see if you get what you expect.
-
- Posts: 341
- Joined: Thu Feb 24, 2011 12:05 am
- Skillset: 30 years on IBM mainframes
- Referer: Searched for Frank Yeager
Re: XML GENERATE TAGS
Part of the XML GENERATE statement is the 'WITH ATTRIBUTES' parm. It MIGHT do what you need. You would certainly need to change the copybook though.
One link I found showed a work-around that used a table with one occurrence along with 'WITH ATTRIBUTE' to get the desired results.
One link I found showed a work-around that used a table with one occurrence along with 'WITH ATTRIBUTE' to get the desired results.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 3
- 1781
-
by Blackthorn
View the latest post
Fri Mar 05, 2021 9:34 pm
-
-
REXX call RACF service IRRSPK00 to generate Pass Tickets
by VladGoodman » Mon Feb 27, 2023 1:11 am » in CLIST & REXX - 4
- 2399
-
by Pedro
View the latest post
Fri Mar 17, 2023 11:40 pm
-