Xml file to Flat file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
bkar
Participant
Posts: 14
Joined: Thu May 19, 2011 7:19 am

Xml file to Flat file

Post by bkar »

I need to transform a XML file data into a flat file. 1st step I did is craeted XML table definition using XML metadata importer.

Then I have taken a XML input stage and sequential file stage and loaded columns from table definition to XML input.

what input I should give to XML input? I'm doing it on parallel job.

worth mentioning I'm new to Datastage and need a detailed steps.

Thanks
bicap
Premium Member
Premium Member
Posts: 95
Joined: Mon May 03, 2010 10:22 pm
Location: India
Contact:

Re: Xml file to Flat file

Post by bicap »

Seq-file ===> XML input stage ===> Seq-file

1) Seq file stage- reading each xml input record in a single colunm. pass this to next stage.

2) XML input stage --

Stage tab :
Transformations output : check Repetation element required and Replace NULL with emty values.
Input tab :
XML Source : provide input column name which contains xml record.
Coulnm Content : Check XML document

Output tab :
Transformations output : check Inherit stage properties.
Columns : Import metadata created from XSD or XML data file using XML metadata parser.

3) Seq -file - Your output. Check output you find the values as NULL for those columns whose respective tagnames were missing in input xml file.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Don't use a Sequential File stage to read XML, too many possible issues there. Follow Ernie's advice here instead.
-craig

"You can never have too many knives" -- Logan Nine Fingers
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

chulett wrote:Follow Ernie's advice instead.
I did exactly that, and I had no difficulty getting it to work.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Ravi.K
Participant
Posts: 209
Joined: Sat Nov 20, 2010 11:33 pm
Location: Bangalore

Post by Ravi.K »

Refer the below thread which gives good idea.

viewtopic.php?t=138188&highlight=XML
Cheers
Ravi K
Post Reply