XML to seq (flat file)

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
troywinston
Participant
Posts: 42
Joined: Sun Jul 03, 2005 4:22 pm
Location: NY

XML to seq (flat file)

Post by troywinston »

Guys doing an xml source file to convert to seq (flat file). This is my design
seq ->xmlinput->transformer->seq.

Validation OK, but I get this message when I run
"Cannot find mandatory property "xml_source_column". "
Any suggestions, I know it is refferin to XMP input stage under input then under XML source column but I have no idea what to put for the XML source column?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Umm... what happened to the Folder stage up front? I really don't think you can feed an XML Input stage from a Sequential File stage...

What does your metadata in the Sequential File stage look like? One big column?
-craig

"You can never have too many knives" -- Logan Nine Fingers
troywinston
Participant
Posts: 42
Joined: Sun Jul 03, 2005 4:22 pm
Location: NY

Post by troywinston »

I did try the folder stage before. But I was getting other problems such as Unable to open folder containing teh file xx. Also with the foder stage I was unable to even get it validated.
tried the
seq and at minimum I got it validated, just having this final problem about XML source column.
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

Hi,
Put your sequential stage's column name in the XML source column of the XML Source tab.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

chulett wrote:What does your metadata in the Sequential File stage look like? One big column?
Survey says?

Try bringing in the entire XML record in as one field and hooking them together as noted by lstsaur, let us know how that goes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dprasanth
Charter Member
Charter Member
Posts: 90
Joined: Fri Oct 07, 2005 7:55 am

Post by dprasanth »

troywinston wrote:I did try the folder stage before. But I was getting other problems such as Unable to open folder containing teh file xx. Also with the foder stage I was unable to even get it validated.
tried the
seq and at minimum I got it validated, just having this final problem about XML source column.
Even I had the problems like what you mentioned in the folder stage, but got it resolved as follows.The first stage you should have is the folder stage.
In the OUPUT tab of the FOLDER stage, you will have three tabs. The last tab is the columns.
Add these two columns namely
FILENAME (DEFINE it as a key with SQLtype VARCHAR)
RECORD(Define it as SQLtype LONGVARCHAR with length like 99999999)

Now the second stage after the folder stage should be the XML Input stage. In the Input tab, you will have a tab called XML Source.Here define the XML source column as RECORD(which was defined in the FOLDER stage. You will have that as a drop down list).Then in the COLUMNS tab , again define the columns as FILENAME and RECORD

In the output tab you can define the actual XML columns. I did it this way and it worked. Hope it helps u out.

Cheers
troywinston
Participant
Posts: 42
Joined: Sun Jul 03, 2005 4:22 pm
Location: NY

Post by troywinston »

Sorry for the hold up guys.
With the Seq file stage it worked but I also had to do put in that "FILENAME" & "RECORD" info. I have not yet re-attempted with the folder stage I will do so and let u guys know teh results.
thanks again.
troywinston
Participant
Posts: 42
Joined: Sun Jul 03, 2005 4:22 pm
Location: NY

Post by troywinston »

Yes it also does work from the folder stage!!
msarkar00
Participant
Posts: 16
Joined: Fri Aug 18, 2006 3:22 am

Post by msarkar00 »

troywinston wrote:Sorry for the hold up guys.
With the Seq file stage it worked but I also had to do put in that "FILENAME" & "RECORD" info. I have not yet re-attempted with the folder stage I will do so and let u guys know teh results.
thanks again.
Hi,

We have created a job with an seq file followed by a xml input stage..then a copy stage and finally the data will be written into a seq file...

the xml structure is
<?xml version="1.0" ?>
- <customers>
- <customer id="55000">
<name>Charter Group</name>
- <address>
<street>100 Main</street>
<city>Kolkata</city>
<state>WB</state>
<zip>700091</zip>
</address>
</customer>
- <customer id="66000">
<name>Tata Group</name>
- <address>
<street>Park Street</street>
<city>Kolkata</city>
<state>WB</state>
<zip>700091</zip>
</address>
</customer>
</customers>

We want to convert this into a seq file. We have loaded the metadata using the xml_data_definations into the seq file and selected id as the key field. The key field is id and it is a decimal.

Now when we run the job we get an error saying:

Sequential_File_34: At field "id": When validating import/export function: APT_GFIX_Decimal::validateParameters: Decimal "text" format is variable length and no external length is specified. Possibly you should specify an appropriate "width" property? External format: {text, padchar=32, nofix_zero, precision=10, scale=5, round=trunc_zero, ascii}

Could u Pls help??
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:!: You've not only posted your problem in someone else's thread, but mixed a PX job problem in with a Server one. Best if you repost this in a new thread in the PX forum. That way we also know what your version number and O/S platform is, right now we'd have to guess.
-craig

"You can never have too many knives" -- Logan Nine Fingers
msarkar00
Participant
Posts: 16
Joined: Fri Aug 18, 2006 3:22 am

Post by msarkar00 »

chulett wrote::!: You've not only posted your problem in someone else's thread, but mixed a PX job problem in with a Server one. Best if you repost this in a new thread in the PX forum. That way we also know what your version number and O/S platform is, right now we'd have to guess.
I am really sorry to do so..I was browsing thru and saw a similar thread so posted it here..Thanx for ur advice,
Post Reply