To generate output xml file
i/p
ip_finename.txt
dob_year,dob_month,dob_date,name,emp_no
1985,10,05,Kannan,1000
1985,10,05,ram,1001
1985,10,05,a,1002
1985,10,05,b,1003
.
.
.
10 records
o/p file generation condition: the o/p xml shold contain only 4 employee details per xml, so here
10 i/p records will go to 4,4,2 as 3 xml o/p files.
kep points:
1. the noOfemployees value should be generated dynamically.
2. tomorrow the no of i/p may be 50 records then the job should generate 13 files.
3. Also the noOfemployees value may be parameterised.
so for 50 records i/p, if this value passed as 10 then ths job should generate 5 o/p files only.
o/p file format:
<Employees noOfemployees="4">
<Emp>
<Topic>Employee Information detail</Topic>
<dob_year value="1985" />
<dob_month value="10" />
<dob_date value="05" />
<name>Kannan</name>
<emp_no="1000" />
</Emp>
<Emp>
....
</Emp>
<Emp>
....
</Emp>
XML
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 12
- Joined: Fri Apr 12, 2013 7:12 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Do feel free to experiment, as you seem to have done (because you've marked this thread as Resolved). One convention we have at DSXchange is to make a post indicating HOW a thread was resolved. You might help some other newbie.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hmmm... not Resolved and I don't recall it ever being set. So...
chaithanya - you may be new to DataStage and that's fine. We're perfectly happy to help anyone and have been doing so for years. But that help generally involves answering questions when people have problems or hints when people get stuck, not handing out complete solutions on a silver platter - I usually get paid to do that.
At a high level you need to read the source file with the Sequential File stage like normal and then write out XML with either the XML Output stage or the new XML Assembly if available in your version. Do you have an xsd for the target file? The XML Output stage would be easier for a newbie, both can use the xsd to derive the XPath Expressions needed but the new XML stage will require it, from what I recall. And read about the 'trigger column' option to see how to switch output files dynamically.
A more important thing for us to know is do you have any XML experience? The DataStage part is pretty easy, it's the XML that gets tricky if you've never worked with it before and are unfamiliar with the concepts and terminology.
chaithanya - you may be new to DataStage and that's fine. We're perfectly happy to help anyone and have been doing so for years. But that help generally involves answering questions when people have problems or hints when people get stuck, not handing out complete solutions on a silver platter - I usually get paid to do that.
At a high level you need to read the source file with the Sequential File stage like normal and then write out XML with either the XML Output stage or the new XML Assembly if available in your version. Do you have an xsd for the target file? The XML Output stage would be easier for a newbie, both can use the xsd to derive the XPath Expressions needed but the new XML stage will require it, from what I recall. And read about the 'trigger column' option to see how to switch output files dynamically.
A more important thing for us to know is do you have any XML experience? The DataStage part is pretty easy, it's the XML that gets tricky if you've never worked with it before and are unfamiliar with the concepts and terminology.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers