convert xml to flat file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

convert xml to flat file

Postby k singh » Thu Jan 15, 2015 3:04 am

hi
I need some help. through xmlgen I have created a xml file which looks like this
<?xml version="1.0"?>
<FILE DSN="XXXXXXXXX">
<ksingh RECORD="00001">
<AA>2008</AA>
<BB>LL</BB>
<CC>002</CC>
<DD>03</DD>
<ksingh>
<ksingh RECORD="00001">
<AA>2009</AA>
<BB>EL</BB>
<CC>001</CC>
<DD>04</DD>
<ksingh>

I want to convert it to something like this
2008,LL,002,03
2009,EL,001,04

please help me on this one. thanks a lot
k singh
 
Posts: 22
Joined: Fri Nov 21, 2014 8:38 pm
Has thanked: 9 times
Been thanked: 0 time

Re: convert xml to flat file

Postby NicC » Thu Jan 15, 2015 3:41 am

You cannot do this using JCL - although you may need JCL to execute the program that will do this. So - are you wanting to write a program (which language) or see if there is a utility program that can be utilised to do this for you?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: convert xml to flat file

Postby k singh » Thu Jan 15, 2015 3:52 am

I can write a program in java or perl to do so
I was just curious if there is some jcl or utility program to do it.
this xml was created from flat file using xmlgen so I thought may be there is some way to reverse it
k singh
 
Posts: 22
Joined: Fri Nov 21, 2014 8:38 pm
Has thanked: 9 times
Been thanked: 0 time

Re: convert xml to flat file

Postby NicC » Thu Jan 15, 2015 5:13 pm

The PL/1 and COBOL languages both ahve XML facilities. IT is possible that the sort utilities could extract the data you want. I will move to DFSort and maybe someone there will be able to give you clues as to how to go about it.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
k singh (Fri Jan 30, 2015 2:28 am)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post