Parameters in Command Stage
Moderators: chulett, rschirm, roy
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.
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.![Confused :?](./images/smilies/icon_confused.gif)
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.
![Confused :?](./images/smilies/icon_confused.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
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 wrote:Probably not, as we're talking specifically about the Execute Command stage in a Sequence job, so... ah... hmm...
...
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 !
thanks guys !
-------------------------
https://www.ssa.co.za
https://www.ssa.co.za
Success !
So much brainpower - so little time !
Thanks a mil.
Barbara
So much brainpower - so little time !
Thanks a mil.
Barbara
-------------------------
https://www.ssa.co.za
https://www.ssa.co.za
-
- Participant
- Posts: 8
- Joined: Fri May 16, 2008 12:13 pm
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.
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.