Page 1 of 1

Parameter for XML Output File Path

Posted: Wed Jan 14, 2009 12:37 am
by bikan
Hi All,

I am creating a XML file using XML Output Stage.

The Output XML file is successfully getting created in path mentioned in "Stage\Options" tab of XML Output Stage.
The value given currently in this tab is something like
"/data/ds/server1/targets/sampleout.xml"

I would like to parameterize the Unix Path where XML file is getting generated.
The Expected value is something like "#prmTargets#/sampleout.xml"

There is no facility of adding parameter in "Stage\Options" tab.

Does anyone know how to give parameter for filepath in XML output stage?

Thanks in advance.

Posted: Wed Jan 14, 2009 4:36 am
by shaonli
Still there is no option to insert parameter value but if u give #prmTargets#/sampleout.xml the target file name will be parameterized.

I have done in this way.It works.

Thanks
Shaonli

Posted: Wed Jan 14, 2009 5:58 am
by eostic
The proprety for the filename is just a string, and like most blank string properties of that type in DS, you can use a Job Parameter freely.

However, unless you are "bursting" your output into many smaller documents based on some key value (XMLOutput does this automatically if desired), I would recommend that you send the resulting xml to a follow-on downstream Stage. Do this by adding an output link, and then in that output link, have one single column. Give it any name, such as myXMLContent, a longvarchar datatype and some length, like 999999. Put a single '/' in the Description.

Now you have a single column containing your complete xml document. You can send this to a Sequential stage with no formatting ("none" for quotes and delimieter) to write it to a file, or to a column in an rdbms table, or to a message queue, etc..... your XMLOutput Stage will always remain the same.

Ernie

Posted: Wed Jan 14, 2009 8:49 am
by chulett
In other words, the short answer is "just type it in". :wink:

Posted: Wed Jan 14, 2009 6:15 pm
by mgarg24
Specify a dummy file name in the xml output stage: say(temp_xml) and in the After job subroutine call mv command with the parameters values so as to rename dummy file with the parameterized value.

Posted: Wed Jan 14, 2009 6:34 pm
by chulett
No need, just use the parameter(s) directly in the stage.

Posted: Fri Jan 16, 2009 5:49 am
by bikan
Thank you All!!!

I have to type in the parameter name in XML output stage to achieve desired result. I wonder why it did not cross my mind initially.

Thank you once again for your valuable inputs and time.

Resolving the topic.