XML Output Filenames

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
sydphi
Premium Member
Premium Member
Posts: 13
Joined: Thu Mar 20, 2008 3:03 pm

XML Output Filenames

Post by sydphi »

I've got a working parallel job that reads from Oracle and outputs using the XML Output stage to XML. It is set to create a new file on trigger column change. This all works great except that I can't find a way to control how it decides to name the files other than the base name. I want it to take the trigger column and use that in the file name instead of just a counter like it currently does.

Currently I get:
file.xml, file_1.xml, file_2.xml

I want:
file_S541.xml, file_S232.xml, file_S743.xml

There is no input buttons or anything for including a column name that I can find in the XML output options.
Is there any way to control the filenames like this?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No, there really isn't to the degree you are looking for. You can set the basename to whatever you like and it will automatically add a numeric suffix to any new files it creates as you've discovered.

What we do for our extracts where we create gobs of XML files that need specific filenames and date/time stamps is to generate them with a generic basename and then have a job that renames them 'properly' after they have been generated. You may be able to add another link to the job, write out 'driving' data with filename and column that you could leverage for this.

Hopefully others will have ideas to share as well.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sydphi
Premium Member
Premium Member
Posts: 13
Joined: Thu Mar 20, 2008 3:03 pm

Post by sydphi »

Thanks, that sums up exactly what I needed to know.
Just didn't want to add another step to the process if it wasn't necessary.
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

Post by bikan »

Hi,

We also are facing same scenario as described here.

Instead of starting new topic, I am adding my comments in the same link so that it will be easier for everyone.

I am a bit confused by Craig's comment and suggested solution.

Can Craig or anyone else please elaborate on the comment?

Thank you in advance.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Which part is unclear? Basically, all I was noting is what we are doing - building the XML files with what is in essence a static name and then renaming them afterwords to what we really want them to be. Part of the process writes out to a flat file (from the data) the information we need to do the rename, which the renaming process retrieves.

Does that help?
-craig

"You can never have too many knives" -- Logan Nine Fingers
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

Post by bikan »

Thanks Craig.

The confusion earlier was related to the Matching of "flat File" from the data part and the actual XML files created.
But now, it is clear and I can map your idea to my current process.

Thank you once again.
Post Reply