Parameters in Command Stage
Moderators: chulett, rschirm, roy
Parameters in Command Stage
Hi there
Me again.
Well my sequence is working so well now, save for one final problem.
I need to tell my Command stage to read parameters since we do not want to hard-code network drive paths.
The syntax in my command textbox is the following: DIR /B/O-D
The syntax in my command parameter textbox is (which are two parameters I have set up in my sequence job with the relevant values:
#FILEPATH##FILENAME#
Error: File not Found.
When I hard-code the drive path - it works fine but when i add parameters it can't find the file. I also cannot put the parameters in the command textbox because it doesn't even compile with parameters in the command textbox.
Thanks.
Barbara
Me again.
Well my sequence is working so well now, save for one final problem.
I need to tell my Command stage to read parameters since we do not want to hard-code network drive paths.
The syntax in my command textbox is the following: DIR /B/O-D
The syntax in my command parameter textbox is (which are two parameters I have set up in my sequence job with the relevant values:
#FILEPATH##FILENAME#
Error: File not Found.
When I hard-code the drive path - it works fine but when i add parameters it can't find the file. I also cannot put the parameters in the command textbox because it doesn't even compile with parameters in the command textbox.
Thanks.
Barbara
-------------------------
https://www.ssa.co.za
https://www.ssa.co.za
See Carig's post in this threadviewtopic.php?t=126185
I have read Craig's response and tried what he said - but it is not finding the file ...
I put DIR /B/O-D in the first box
#FILEPATH##INPUTFILE# in the parameter box
Job fails - error: cannot find the file specified ...
Something is obviously not working ...
Then I also tried putting the DOS command also into a variable like this:
#DOSCommand##FILEPATH##INPUTFILE# - then as per Craig's message - I added sh to the command textbox - no luck. Also tried ksh - no luck...
I put DIR /B/O-D in the first box
#FILEPATH##INPUTFILE# in the parameter box
Job fails - error: cannot find the file specified ...
Something is obviously not working ...
Then I also tried putting the DOS command also into a variable like this:
#DOSCommand##FILEPATH##INPUTFILE# - then as per Craig's message - I added sh to the command textbox - no luck. Also tried ksh - no luck...
-------------------------
https://www.ssa.co.za
https://www.ssa.co.za
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Possibly the 'Windows only' Command stage which I've never seen. Can you post the log message that shows the actual command that was executed after the parameters were resolved? I assume this logs one like the Execute Command stage does.
For Windows without any MKS Toolkit like functionality, rather than "sh" or "ksh" perhaps "start" would work there instead?
For Windows without any MKS Toolkit like functionality, rather than "sh" or "ksh" perhaps "start" would work there instead?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi there Ray,
I am using an Execute Command Activity in a sequence job.
Thanks
Barbara
I am using an Execute Command Activity in a sequence job.
Thanks
Barbara
-------------------------
https://www.ssa.co.za
https://www.ssa.co.za
Hi there
This is the command output that is generated when I copy it out of the Director (together with the error message):
Load_Trans_Files..JobControl (@Cmd_TransFile_To_Load): Executed: DIR /B/O-D \\mcbcptfs01\groups\MHD\Data to load\Payroll files\TRANS files\*.csv
Reply=1
Output from command ====>
The system cannot find the file specified.
I will try START and see what happens ...
thanks
Barbara
This is the command output that is generated when I copy it out of the Director (together with the error message):
Load_Trans_Files..JobControl (@Cmd_TransFile_To_Load): Executed: DIR /B/O-D \\mcbcptfs01\groups\MHD\Data to load\Payroll files\TRANS files\*.csv
Reply=1
Output from command ====>
The system cannot find the file specified.
I will try START and see what happens ...
thanks
Barbara
-------------------------
https://www.ssa.co.za
https://www.ssa.co.za
I tried the start command - still errors ...
Thanks
Barbara
Thanks
Barbara
-------------------------
https://www.ssa.co.za
https://www.ssa.co.za
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Check that every folder in the pathname exists and that there is at least one csv file in the final folder. Otherwise DIR will return a non-zero exit status. It's clear that the parameters are being resolved.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Probably not going to make any difference since the parameters as passed are getting resolved. Are you certain there are "*.csv" files in that location and which are accessable to the DataStage job? The first (not totally conclusive) test to run is to start a "cmd" window so you get a DOS prompt and see if that exact same command works.
If it works there and not in the job, then we have a user / permissions / access problem - and yes, before you ask, even if you use "the same user".![Wink :wink:](./images/smilies/icon_wink.gif)
If it works there and not in the job, then we have a user / permissions / access problem - and yes, before you ask, even if you use "the same user".
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi there
I have tried using the DOS cmd prompt and the command in DOS works via the cmd window.
If I hard-code this path into the command textbox (Command Activity Stage) then it also works ... it just doesn't want to work with the parameters ?????
Thanks
Barbara
I have tried using the DOS cmd prompt and the command in DOS works via the cmd window.
If I hard-code this path into the command textbox (Command Activity Stage) then it also works ... it just doesn't want to work with the parameters ?????
Thanks
Barbara
-------------------------
https://www.ssa.co.za
https://www.ssa.co.za
Hi there Ray,
Yes, i've checked ... in fact I even pulled in the file path copied directly out of the Windows Explorer window. They path is definitely correct (even case) and there are two files there ... as I said, I used the exact same syntax in the cmd window and that returned the two files I am trying to load ???
Thanks
Barbara
Yes, i've checked ... in fact I even pulled in the file path copied directly out of the Windows Explorer window. They path is definitely correct (even case) and there are two files there ... as I said, I used the exact same syntax in the cmd window and that returned the two files I am trying to load ???
Thanks
Barbara
-------------------------
https://www.ssa.co.za
https://www.ssa.co.za
Windows is not case-sensitive so that's not an issue here. One thing confusing me - you've now sometimes said you are using the "Execute Command" stage and here the "Command Activity" stage. Can you verify exactly which one we're talking about? Not sure it is an issue here, just want to be certain we're all singing from the same hymn book.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I am using an execute command stage in a sequence job.
-------------------------
https://www.ssa.co.za
https://www.ssa.co.za
I'm at a loss here with what to try next. If you are certain that it works with hard-coded values and yet doesn't work when those exact same values are parameterized, I'm stumped. Have you involved your official support provider yet? Had another set of eyes double-check everything for you? ![Confused :?](./images/smilies/icon_confused.gif)
Can you post a couple of messages copied from the log, please, much like you did before? First, hard-code the values and post the command output log message like you did before. Then parameterize it with those exact same values and post that same log message again.
![Confused :?](./images/smilies/icon_confused.gif)
Can you post a couple of messages copied from the log, please, much like you did before? First, hard-code the values and post the command output log message like you did before. Then parameterize it with those exact same values and post that same log message again.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers