Creation of multiple XML files

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
jaysheel
Participant
Posts: 57
Joined: Mon Apr 07, 2008 1:54 am
Location: Bangalore

Creation of multiple XML files

Post by jaysheel »

Hi,

I am trying to create multiple XML files from a sequential file using the Trigger column method. My requirement is for every different value of a field an XML file has to be created. My design looks like this.

Seq file --> Transformer --> XML output --> Copy Stage

Here used the Trigger column option and used the filename as name%%.xml
But I got an error saying "Recieved Signal SIGSEGV"

But what I see in the path is one instance of the XML got created as name0.xml
Not sure whats the problem here. In my output tab I have only one column as XMLMessage with Varchar(99999) and the description has a '/'

I went through all the posts in the forum but Could not understand the actual process of generating multiple XML files. Can someone please help.
- Jaysheel -
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You've got the concept down - when the trigger values changes, a new file will be created with an incremented number added. Ditch the Copy stage, let the XML Ouput stage handle the file writing.
Last edited by chulett on Wed Jul 04, 2012 10:30 am, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jaysheel
Participant
Posts: 57
Joined: Mon Apr 07, 2008 1:54 am
Location: Bangalore

Post by jaysheel »

Craig,

I tried that. But my job is failing with a warning "Invalid filepath. Cannot use %%%% or %%@@ when the stage has no output link" and also an error "Error occured in call to ORPHCCallActivePluginInitialize()"

Thats why I have added the copy stage to get the output tab in the XML output stage.
- Jaysheel -
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The '%%' notation must be something new for 8.x, don't recall it being around when I was doing a ton of XML creation, most of it using the trigger column mechanism. I assume it allows you to control the format / placement of the numbering? Needs to go reads me some documentations, it would seem.

For grins, what happens if you remove them and simply go with "name.xml" as the filename? It should still work and give you files like:

name.xml
name_1.xml
name_2.xml

From what I recall. If that works then perhaps there is an issue with those characters in the stage and you should check with your official support provider. If you really need to use something else to write the files rather than the XML Output stage to leverage those options, then it seems to me that the Sequential File stage might be more appropriate.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jaysheel
Participant
Posts: 57
Joined: Mon Apr 07, 2008 1:54 am
Location: Bangalore

Post by jaysheel »

Craig,

I tried without the %% in the file name and it failed again because of XML validation. I unchecked the box and then it worked. Not sure why it failed for validation. I had imported the metadata by using a sample XML file.

Thanks.
- Jaysheel -
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Is that with or without a stage after the XML Output stage?

If you want to pursue the validation issue, please start a new topic so it doesn't get mixed up with all this 'multiple files' talk and we'll see if we can figure it out.

Still hoping Ernie might pop by and give us his thoughts on the original issue now that our mini mid-week US holiday is over. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
jaysheel
Participant
Posts: 57
Joined: Mon Apr 07, 2008 1:54 am
Location: Bangalore

Post by jaysheel »

Craig,

I took off the copy after the XML ouput and it worked without any other stage after XML output. I would start a new thread on the validation part again. Thanks for the help !! :)
- Jaysheel -
Post Reply