Passing Parameters through dsjob function
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 3
- Joined: Thu Feb 08, 2007 3:44 pm
- Location: Sydney
Passing Parameters through dsjob function
Hi
I am reading parameters from .csv file using shell script, and trying to execute the DataStage Sequence job by passing the paramters to it, as follows.
dsjob -run -param abc=$abc -param DBname=$DBname PROJECTNAME SEQ_JOBNAME
I am getting Invalid arguments dsjob -run Error
Status code = -9999 DSJE_DSJOB_ERROR.
Even if I use the -mode parameter I am getting the same error.
dsjob -run -mode NORMAL -param abc=$abc -param DBname=$DBname PROJECTNAME SEQ_JOBNAME
Can anyone help how to pass the parameters through commandline ?
Thanks for any help
Venkata
I am reading parameters from .csv file using shell script, and trying to execute the DataStage Sequence job by passing the paramters to it, as follows.
dsjob -run -param abc=$abc -param DBname=$DBname PROJECTNAME SEQ_JOBNAME
I am getting Invalid arguments dsjob -run Error
Status code = -9999 DSJE_DSJOB_ERROR.
Even if I use the -mode parameter I am getting the same error.
dsjob -run -mode NORMAL -param abc=$abc -param DBname=$DBname PROJECTNAME SEQ_JOBNAME
Can anyone help how to pass the parameters through commandline ?
Thanks for any help
Venkata
You need to specify the -MODE NORMAL. Is your project actually called "PROJECTNAME"? What happens if you try to start the job by typing in all the actual values?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3
- Joined: Thu Feb 08, 2007 3:44 pm
- Location: Sydney
-
- Participant
- Posts: 3
- Joined: Thu Feb 08, 2007 3:44 pm
- Location: Sydney
DSguru2B wrote:Thats what ArndW asked you, Is your project really called PROJECTNAME or thats just a variable. If its a variable then you need to prefix it with dollar sign ($PROJECTNAME)
PROJECTNAME is actually my Project Name, I have tried to usedDSguru2B wrote:Thats what ArndW asked you, Is your project really called PROJECTNAME or thats just a variable. If its a variable then you need to prefix it with dollar sign ($PROJECTNAME)
eval dsjob -run -mode NORMAL -param BATCHNUMBER=$BATCHNUMBER -param log=$log PROJECTNAME SEQ_jobname
but i am still getting error. I would like to know
-param BATCHNUMBER="$BATCHNUMBER"
-param BATCHNUMBER=%$BATCHNUMBER%
-param BATCHNUMBER='$BATCHNUMBER'
is needed ?
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Have you tried the first option, that should take care of the value fi it is having any spaces.
Check your file to verify the parameter names and Let us know what error message it is giving.
Code: Select all
-param BATCHNUMBER="$BATCHNUMBER"
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Thomas Alva Edison(1847-1931)
If you are in UNIX then the -param is the option and the ParamName=ParamValue is the option value and the whole thing needs quotes if there are spaces. So -param "ParamName=$ParamVariable" is more accurate. If the parameter value has quotes in it then you have yet another problem.
Do us a favor and put an echo "dsjob..." and post that so we can see if there are any other special characters. please edit out your passwords.
Do us a favor and put an echo "dsjob..." and post that so we can see if there are any other special characters. please edit out your passwords.
Mamu Kim
May be, but this is how i'm running the jobs from a unix shell.
dsjob -file ${file} ${servername} -run -warn ${WARNING_LIMIT} -jobstatus -local ${PROJECT_NAME} ${JOB_NAME}
In my previous post I forgot to mention about using -local option.
-local option is required if your Job needs to take environmental variables.
-mode NORMAl option is not required if you just want to run the job.
Server Job Developers Guide says:
-local use this when running a DataStage job from withing a
shellscript on a UNIX server. Provided the script is run in the project
directory, the job will pick up the settings for any environment
variables set in the script and any setting specific to the user
environment.
Thanks,
Poorna
dsjob -file ${file} ${servername} -run -warn ${WARNING_LIMIT} -jobstatus -local ${PROJECT_NAME} ${JOB_NAME}
In my previous post I forgot to mention about using -local option.
-local option is required if your Job needs to take environmental variables.
-mode NORMAl option is not required if you just want to run the job.
Server Job Developers Guide says:
-local use this when running a DataStage job from withing a
shellscript on a UNIX server. Provided the script is run in the project
directory, the job will pick up the settings for any environment
variables set in the script and any setting specific to the user
environment.
Thanks,
Poorna
-local might be required to pick up environment variables. Granted. I dont use environment variables. Hence cannot comment more on it.parimi123 wrote: -local option is required if your Job needs to take environmental variables.
-mode option is optional. If -mode is not specified, a normal job run is started. Hence its is not requiredparimi123 wrote: -mode NORMAl option is not required if you just want to run the job.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.