Parameter for XML Output File Path

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
bikan
Premium Member
Premium Member
Posts: 128
Joined: Thu Jun 08, 2006 5:27 am

Parameter for XML Output File Path

Post 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.
shaonli
Participant
Posts: 80
Joined: Tue Nov 28, 2006 6:52 am

Post 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
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post 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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

In other words, the short answer is "just type it in". :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
mgarg24
Participant
Posts: 5
Joined: Mon Nov 10, 2008 3:44 pm
Location: noida

Post 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.
MG
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No need, just use the parameter(s) directly in the stage.
-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 »

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.
Post Reply