ExecCommand

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

Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

ExecCommand

Post by Raftsman »

We have multiple environments. I would like to use the Exec Command stage to execute a BAT file. The problem is, I would like to change the directory structure to point to the Environment where the BAT file resides. I tried the following

ExecCommand: D:\DataStage\

Parameter: #ENV#\Test.bat

Because D:\Datastage\ isn't a command, it fails. Is there a prefix I can add to make it a command.

Thanks
Jim Stewart
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

In DOS? Hmmm....

Maybe using 'start'? Or perhaps a generic batch file in a fixed location that does a 'call' to the correct batch file?

Really getting into the WABAC Machine for that stuff. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

Yes, but what are my other alternatives on a Windows box. Can I create a UNIX script and call it. Would this work with the MKS Toolkit.
Jim Stewart
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure, if you have the MKS Toolkit then you have alot of other options, including scripting something.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

Hi Craig,

If I am not wrong. MKS ToolKit is installed by default on all windows installations of Datastage.
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

Minhajuddin wrote:Hi Craig,

If I am not wrong. MKS ToolKit is installed by default on all windows installations of Datastage.
You are wrong. I have worked in various versions, the latest being 7.5.1A (DS Server ed. on Windows) and MKS ToolKit was not included. I think it has been made available in 7.5.2 Windows Ed.
gateleys
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

My bad :oops:

I should have said Datastage "Enterprise Edition"
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

Even if you don't have MKS ToolKit, you could install Cygwin to provide you with the Unix layer. It comes free.
gateleys
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

From what I understand - yes, it does come 'free' with EE. Someone may have chosen not to install it. Or, as noted, there are other alternatives.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

D:DataStage can never be a command, I don't care how many prefixes you add to it. It's a Folder, pure and simple.

What precisely are you trying to achieve?

The best practice with scripts (or BAT files) is to use full pathnames. If you can't do that, use CD commands to get you where you need to be - and, if necessary, capture the current working directory's pathname before you do, so you can CD back again.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Post by jdmiceli »

Also, if you have parameterized your paths for job control, then you can refer to the parameter using the standard #parametername# notation.
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

Ray,

But if we don't want a common directory to store script, is there a way to distinguish the directory path where the script resides.

I have been trying to use the CMD command and concatinate the parameter line. It's not working. Now I am trying to use the sh -c command. Still having problems with this.

Hopefully, I figure it out.
Jim Stewart
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

Why not use a Before/After job/stage subroutine 'ExecDOS' to call the bat with the required parameter?
OR
Use a CommandStage (not ExecuteCommand in job sequence) within a job.
gateleys
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

OK, then start is a good suggestion on Windows (like source would be on UNIX).

The start command has plenty of useful options, too. Get to a CMD shell and type HELP START to get more information.

You can then put the entire command line that you actually want to execute into the Parameters field of the Execute Command activity.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Forgot to mention that part - just 'start' as the command and everything else in the Parameter box. Thanks.

The biggest thing to realize with that stage is you can't put "half" of the command in one box and the other half in the second box as, when they are combined to be executed, a space is left between the two. That was your original problem, Raftsman.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply