Strange behavior with parameters
Posted: Thu Sep 09, 2004 7:19 am
We have a sequence job that cleans up files by moving them to a "complete" directory. We accomplish this with an "ExecuteCommand" stage that issues a command like this: "mv somepath/someprefix_*.dat somepath/complete".
This works fine, but I would like to use parameters and I'm having trouble. When I add parameters for the prefix, the command seems fine in the DataStage log, but I always get this message:
"mv: cannot access sompath/somprefix_*.dat"
Details:
The sequence job the ExecuteCommand is in has a parameter defined named "FilePrefix". Here is the command line of the ExecuteCommand stage using the parameter:
mv somepath/#FilePrefix#_*.dat somepath/complete
I'm testing this job from director, and typing the parameter value in at the prompt. (When I actually use it, I would pass that from a calling sequence job.)
As I mentioned, I can look in the log and see the command that is actually executed, and it is formatted correctly. I have verified the directory where the command is executed using "pwd" in the sequence job. I have checked that a matching file exists in the directory using "ls" in the sequence job.
I also included another ExecuteCommand stage with the same command hard-coded in sequence AFTER my parameterized one. The parameterized one fails, then the hardcoded one succeeeds. (According to the log, they are issuing the same command.)
One last note, the "somepath" about includes a softlink from our project directory to our data directory.
This works fine, but I would like to use parameters and I'm having trouble. When I add parameters for the prefix, the command seems fine in the DataStage log, but I always get this message:
"mv: cannot access sompath/somprefix_*.dat"
Details:
The sequence job the ExecuteCommand is in has a parameter defined named "FilePrefix". Here is the command line of the ExecuteCommand stage using the parameter:
mv somepath/#FilePrefix#_*.dat somepath/complete
I'm testing this job from director, and typing the parameter value in at the prompt. (When I actually use it, I would pass that from a calling sequence job.)
As I mentioned, I can look in the log and see the command that is actually executed, and it is formatted correctly. I have verified the directory where the command is executed using "pwd" in the sequence job. I have checked that a matching file exists in the directory using "ls" in the sequence job.
I also included another ExecuteCommand stage with the same command hard-coded in sequence AFTER my parameterized one. The parameterized one fails, then the hardcoded one succeeeds. (According to the log, they are issuing the same command.)
One last note, the "somepath" about includes a softlink from our project directory to our data directory.