Derive the host name and project name dynamically

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
syang@collaborative.com
Premium Member
Premium Member
Posts: 33
Joined: Tue Sep 02, 2014 7:43 am

Derive the host name and project name dynamically

Post by syang@collaborative.com »

Hi guys,

I move Sequencer jobs from a Development ,to a Test, and to a Production environment constantly and sometimes forget to change the host name parameter.

I was wondering if there is a way to get the host name and project name dynamically in a Sequencer job?

Thanks.
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Well... not really sure why you want project name dynamically since it is typically required BEFORE you actually execute a job (as it is a required parameter to kick that sequencer off to begon with). Unless you are using the built in job scheduler of course.

as for hostname... try opening an execute stage and using the hostname shell command. trap that output.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

It seems like if you right click in any expression editor and choose DS Macro, there is one for project name.
Choose a job you love, and you will never have to work a day in your life. - Confucius
AshishDevassy
Participant
Posts: 32
Joined: Fri Nov 07, 2014 11:18 am

Post by AshishDevassy »

If I understand correctly -

You have a sequencer and one of the parameter variable you use is for hostname. And you want to avoid typing in Hostname again and again.

If that is the case I would suggest using Parameter set Value files then. you can create 3 value files (one for each environment Dev / test / prod ) With each value file containing the hostname of that env.
So when you run you can chose from a drop down box.
that's wierd ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There's no such thing as a Sequencer job. It's a Sequence job. A Sequencer is a component that can be used in a Sequence job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
syang@collaborative.com
Premium Member
Premium Member
Posts: 33
Joined: Tue Sep 02, 2014 7:43 am

Post by syang@collaborative.com »

Hi AshishDevassy,

I have also considered this, but I wanted to know if there were any other way to get the host name dynamically. Because the host name parameter is hard coded into every directory parameter, this would require me to change every job that uses a directory parameter.

Thanks for your input. I will look into it.
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

Because the host name parameter is hard coded into every directory parameter, this would require me to change every job that uses a directory parameter.
What???

Your directories have the hostnames in them???

IE: I'm executing my code on host mydevbox and you have a path coded as such:

/dev/mydevbox/data/something

?
Post Reply