dsjob -run cmd won't work some times
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 78
- Joined: Wed Oct 26, 2005 6:12 am
dsjob -run cmd won't work some times
Hi ,
I am executing dsjob command from shell script.
I am reading the parameters from a text file which is in format PARAM1=VALUE
PARAM2=VALUE listed one below the other.
In my shell script the final command looks something like dsjob -run -jobstatus -param 'PARAM1=VALUE' -param 'PARAM2=VALUE' PROJECT1 JOB1
If I copy the above dsjob cmd and execute it from the prompt, it is working fine
But if I run this from the script, I am getting below error.
Invalid arguments: dsjob -run
[-mode <NORMAL | RESET | VALIDATE>]
[-param <name>=<value>]
[-warn <n>]
[-rows <n>]
[-wait]
[-opmetadata <TRUE | FALSE>]
[-disableprjhandler]
[-disablejobhandler]
[-jobstatus]
[-userstatus]
[-local]
[-useid]
<project> <job|jobid>
Status code = -9999 DSJE_DSJOB_ERROR
Please let me know what might be the problem in my script.
Thanks & Regards
Sheshadri
I am executing dsjob command from shell script.
I am reading the parameters from a text file which is in format PARAM1=VALUE
PARAM2=VALUE listed one below the other.
In my shell script the final command looks something like dsjob -run -jobstatus -param 'PARAM1=VALUE' -param 'PARAM2=VALUE' PROJECT1 JOB1
If I copy the above dsjob cmd and execute it from the prompt, it is working fine
But if I run this from the script, I am getting below error.
Invalid arguments: dsjob -run
[-mode <NORMAL | RESET | VALIDATE>]
[-param <name>=<value>]
[-warn <n>]
[-rows <n>]
[-wait]
[-opmetadata <TRUE | FALSE>]
[-disableprjhandler]
[-disablejobhandler]
[-jobstatus]
[-userstatus]
[-local]
[-useid]
<project> <job|jobid>
Status code = -9999 DSJE_DSJOB_ERROR
Please let me know what might be the problem in my script.
Thanks & Regards
Sheshadri
Re: dsjob -run cmd won't work some times
Remove the quotes around 'PARAM1=VALUE'.arsheshadri wrote:Hi ,
dsjob -run -jobstatus -param 'PARAM1=VALUE' -param 'PARAM2=VALUE' PROJECT1 JOB1
In other words, your dsjob command should now look like this
Code: Select all
dsjob -run -jobstatus -param PARAM1=VALUE -param PARAM2=VALUE PROJECT1 JOB1
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 78
- Joined: Wed Oct 26, 2005 6:12 am
Re: dsjob -run cmd won't work some times
I tried without quotes..but still I am getting the error. Now I am not able to run this on cmd prompt. Earlier with quotes, I was atleast able to run this from command prompt.
Please look at the actual cmd.
dsjob -run -jobstatus -wait -param Source_File_LC=Client 58330013 Before CISROUTA -param Format=1407D -param Source_File_CISUAPT=Client 58330013 Before CISROUTA_1407D_lc -param Source_File_CISVALID=Client 58330013 Before CISROUTA_1407D_lc_1 -param Source_File_NA_Formatting=Client 58330013 Before CISROUTA_1407D_lc_1_2 -param EFX_HOME=/temp/DataStage/comm_insight/test -param LC_JOB_DIR=lenchecked -param CISUAPT_JOB_DIR=processed_1 -param CISVALID_JOB_DIR=processed_2 -param NAF_JOB_DIR=processed_3 Comm_INSIGHT_proj CI_JS2
Please look at the actual cmd.
dsjob -run -jobstatus -wait -param Source_File_LC=Client 58330013 Before CISROUTA -param Format=1407D -param Source_File_CISUAPT=Client 58330013 Before CISROUTA_1407D_lc -param Source_File_CISVALID=Client 58330013 Before CISROUTA_1407D_lc_1 -param Source_File_NA_Formatting=Client 58330013 Before CISROUTA_1407D_lc_1_2 -param EFX_HOME=/temp/DataStage/comm_insight/test -param LC_JOB_DIR=lenchecked -param CISUAPT_JOB_DIR=processed_1 -param CISVALID_JOB_DIR=processed_2 -param NAF_JOB_DIR=processed_3 Comm_INSIGHT_proj CI_JS2
I see you have param values with spaces in them. You need to enclose only the value in double quotes. That will work. Basically your command should look like this now.
Code: Select all
dsjob -run -jobstatus -param PARAM1="VALUE" -param PARAM2="VALUE" PROJECT1 JOB1
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 78
- Joined: Wed Oct 26, 2005 6:12 am
[quote="DSguru2B"]I see you have param values with spaces in them. You need to enclose only the value in double quotes. That will work. Basically your command should look like this now.
[code]
dsjob -run -jobstatus -param PARAM1="VALUE" -param PARAM2="VALUE" PROJECT1 JOB1[/code][/quote]
Still not working :? I added the " " around the parameter value.
Command looks like this.
----------------------------------------------------------------------------------
dsjob -run -jobstatus -wait -param Source_File_LC="Client 58330013 Before CISROUTA" -param Format="1407D" -param Source_File_CISUAPT="Client 58330013 Before CISROUTA_1407D_lc" -param Source_File_CISVALID="Client 58330013 Before CISROUTA_1407D_lc_1" -param Source_File_NA_Formatting="Client 58330013 Before CISROUTA_1407D_lc_1_2" -param EFX_HOME="/temp/DataStage/comm_insight/test" -param LC_JOB_DIR="lenchecked" -param CISUAPT_JOB_DIR="processed_1" -param CISVALID_JOB_DIR="processed_2" -param NAF_JOB_DIR="processed_3" Comm_INSIGHT_proj CI_JS2
------------------------------------------------------------------------------------
The same command is working from the unix prompt. :o
[code]
dsjob -run -jobstatus -param PARAM1="VALUE" -param PARAM2="VALUE" PROJECT1 JOB1[/code][/quote]
Still not working :? I added the " " around the parameter value.
Command looks like this.
----------------------------------------------------------------------------------
dsjob -run -jobstatus -wait -param Source_File_LC="Client 58330013 Before CISROUTA" -param Format="1407D" -param Source_File_CISUAPT="Client 58330013 Before CISROUTA_1407D_lc" -param Source_File_CISVALID="Client 58330013 Before CISROUTA_1407D_lc_1" -param Source_File_NA_Formatting="Client 58330013 Before CISROUTA_1407D_lc_1_2" -param EFX_HOME="/temp/DataStage/comm_insight/test" -param LC_JOB_DIR="lenchecked" -param CISUAPT_JOB_DIR="processed_1" -param CISVALID_JOB_DIR="processed_2" -param NAF_JOB_DIR="processed_3" Comm_INSIGHT_proj CI_JS2
------------------------------------------------------------------------------------
The same command is working from the unix prompt. :o
-
- Participant
- Posts: 78
- Joined: Wed Oct 26, 2005 6:12 am
This is the code that I have written in the script.
-------------------------------------------------------------------------------
#Preparing the dsjob cmd by reading parameter file
cat $JOB_PARAM_DEST/$JOB_PARAM_FILE|
while read ParmValue
do
ParmList="$ParmList -param $ParmValue"
done
#Final dsjob cmd
cmd="dsjob -run -jobstatus $ParmList $PROJECT $DSJOB"
#executing the command
./cmd
return #?
#End of Script
-------------------------------------------------------------------------------
Parameter file looks like this
-------------------------------------------------------------------------------
Format="1407D"
Source_File_CISUAPT="Client 58330013 Before CISROUTA_1407D_lc"
Source_File_CISVALID="Client 58330013 Before CISROUTA_1407D_lc_1"
Source_File_NA_Formatting="Client 58330013 Before CISROUTA_1407D_lc_1_2"
EFX_HOME="/temp/DataStage/comm_insight/test"
LC_JOB_DIR="lenchecked"
CISUAPT_JOB_DIR="processed_1"
CISVALID_JOB_DIR="processed_2"
NAF_JOB_DIR="processed_3"
-------------------------------------------------------------------------------
Regards
Sheshadri
-------------------------------------------------------------------------------
#Preparing the dsjob cmd by reading parameter file
cat $JOB_PARAM_DEST/$JOB_PARAM_FILE|
while read ParmValue
do
ParmList="$ParmList -param $ParmValue"
done
#Final dsjob cmd
cmd="dsjob -run -jobstatus $ParmList $PROJECT $DSJOB"
#executing the command
./cmd
return #?
#End of Script
-------------------------------------------------------------------------------
Parameter file looks like this
-------------------------------------------------------------------------------
Format="1407D"
Source_File_CISUAPT="Client 58330013 Before CISROUTA_1407D_lc"
Source_File_CISVALID="Client 58330013 Before CISROUTA_1407D_lc_1"
Source_File_NA_Formatting="Client 58330013 Before CISROUTA_1407D_lc_1_2"
EFX_HOME="/temp/DataStage/comm_insight/test"
LC_JOB_DIR="lenchecked"
CISUAPT_JOB_DIR="processed_1"
CISVALID_JOB_DIR="processed_2"
NAF_JOB_DIR="processed_3"
-------------------------------------------------------------------------------
Regards
Sheshadri
I would hate to break it to you but when you pass parameter values like the way you are doing, they should not have any spaces in them. Once upon a time i spent way to many hours trying to figure it out.
Just for your own satisfaction, dont change anything in the script, just remove spaces from the param values in your param file, you will see that it will work like a charm.
Also try this, in your cmd variable put the actual values with spaces and with quotes. Like this
And you will see that it will work.
Its just when passing the parameters via variable it doesnt like spaces.
Just for your own satisfaction, dont change anything in the script, just remove spaces from the param values in your param file, you will see that it will work like a charm.
Also try this, in your cmd variable put the actual values with spaces and with quotes. Like this
Code: Select all
cmd="dsjob -run -jobstatus -param Source_File_LC="Client 58330013 Before CISROUTA" -param Format="1407D" -param Source_File_CISUAPT="Client 58330013 Before CISROUTA_1407D_lc" -param Source_File_CISVALID="Client 58330013 Before CISROUTA_1407D_lc_1" -param Source_File_NA_Formatting="Client 58330013 Before CISROUTA_1407D_lc_1_2" -param EFX_HOME="/temp/DataStage/comm_insight/test" -param LC_JOB_DIR="lenchecked" -param CISUAPT_JOB_DIR="processed_1" -param CISVALID_JOB_DIR="processed_2" -param NAF_JOB_DIR="processed_3" $PROJECT $DSJOB"
Its just when passing the parameters via variable it doesnt like spaces.
Last edited by DSguru2B on Tue Jun 20, 2006 1:58 pm, edited 1 time in total.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 407
- Joined: Mon Jun 27, 2005 8:54 am
- Location: Walker, Michigan
- Contact:
-
- Participant
- Posts: 407
- Joined: Mon Jun 27, 2005 8:54 am
- Location: Walker, Michigan
- Contact:
Eval does two things.
1. Executes the entire argument passed to it as one command.
2. Goes through command substitution again.
Both are awesome. But 2 could be annoying.
But because of 2, you can now use a shell variable in your parameter file if you want.
Example:
STUFF=${PARM}
STUFF will take on the value of PARM for the shell building the command. To avoid this you need to use \\\
STUFF=\\\${STUFF}
Now STUFF shoud be the literal value ${STUFF}
1. Executes the entire argument passed to it as one command.
2. Goes through command substitution again.
Both are awesome. But 2 could be annoying.
But because of 2, you can now use a shell variable in your parameter file if you want.
Example:
STUFF=${PARM}
STUFF will take on the value of PARM for the shell building the command. To avoid this you need to use \\\
STUFF=\\\${STUFF}
Now STUFF shoud be the literal value ${STUFF}
-
- Participant
- Posts: 78
- Joined: Wed Oct 26, 2005 6:12 am