Parameters in Command Stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

Not sure if its the same thing (as my one was in Parallel and on unix), but when I was trying to execute commands it kept trying to look in the root directory rather than in the parameterised file directory and file pattern. It was only when I placed the parameters in single quotes that it recognised the path.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Probably not, as we're talking specifically about the Execute Command stage in a Sequence job, so... ah... hmm...

You may very well need quotes here because of the 'long filename' you are using, specifically the directory name with the spaces in it. So sometimes you need to put single quotes around the entire path so the spaces don't confuse it, or switch it to the original recipe DOS 8.3 short name, which is probably "datato~1". Either that or (if possible) rename any subdirectories so they don't have spaces in them. As a test at the very least.

Still, doesn't really explain why it works hard-coded. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

chulett wrote:Probably not, as we're talking specifically about the Execute Command stage in a Sequence job, so... ah... hmm...
...
Actually so am I, I use an execute command stage to call a unix script to which I pass several parameters. All the other parameters worked fine it was only the file pattern that had an issue. As soon as I used *.csv it started looking in the root directory but if I passed '*.csv' it worked fine. (or rather i passed '#File_Pattern#')
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... you mentioned 'Parallel' which I assumed meant something other than a Sequence job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
BIuser
Premium Member
Premium Member
Posts: 238
Joined: Thu Feb 02, 2006 4:03 am
Location: South Africa

Post by BIuser »

Thanks for the replies - I'm going to give the single quotes a try and then I'll post what happens ... after that I'll do what Craig suggested and run it with the hard-coded values and post the log details.

thanks guys !
-------------------------
https://www.ssa.co.za
BIuser
Premium Member
Premium Member
Posts: 238
Joined: Thu Feb 02, 2006 4:03 am
Location: South Africa

Post by BIuser »

Success !

So much brainpower - so little time !

Thanks a mil.

Barbara
-------------------------
https://www.ssa.co.za
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, Barbara... for completeness, what actually resolved it for you? The single quotes? Did any of the other suggestions work as well, out of curiousity?
-craig

"You can never have too many knives" -- Logan Nine Fingers
campbellj2
Participant
Posts: 8
Joined: Fri May 16, 2008 12:13 pm

Post by campbellj2 »

We use Parameters in Dos commands all of the time. However we use the ExecDOS Routine. The routine is found in the Built-in\Before/After folder .

Enter your DOS command as follows

"COPY /Y " FILEPATH : FILENAME " C:\TEMP\X.DAT"

Wrap the DOS part of the command in double quotes. Use the colon: to append the statement together and use the parameters without the pound signs. After the job runs, check your log in Director to see the command syntax that was built. This will work for you.
Post Reply