A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.
Moderators: chulett , rschirm , roy
laiko
Premium Member
Posts: 35 Joined: Sun May 25, 2008 10:55 am
Post
by laiko » Mon Mar 22, 2010 1:11 pm
I have entered the following in unix command line:
Code: Select all
/DS/Ascential/DataStage/DSEngine/bin/dsjob -run -jobstatus -wait -mode NORMAL -param JOB_ID=98246 PREVRUNDT="2010-03-20 18:00:00" CURRRUNDT="2010-03-21 18:00:00" -warn 50 APPPRJ Load_Target
It errored out with the following message:
Code: Select all
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>
What can be wrong here???
asorrell
Posts: 1707 Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas
Post
by asorrell » Mon Mar 22, 2010 1:18 pm
Try putting -param in front of each parameter.
I can't access a system right now to test, but that may fix it.
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Mon Mar 22, 2010 1:27 pm
What Andy means is
Code: Select all
/DS/Ascential/DataStage/DSEngine/bin/dsjob -run -jobstatus -wait -mode NORMAL -param JOB_ID=98246 PREVRUNDT="2010-03-20 18:00:00"-param CURRRUNDT="2010-03-21 18:00:00" -warn 50 APPPRJ Load_Target
Note the extra "-param" ahead of CURRRUNDT.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
asorrell
Posts: 1707 Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas
Post
by asorrell » Tue Mar 23, 2010 10:57 am
Code: Select all
/DS/Ascential/DataStage/DSEngine/bin/dsjob -run -jobstatus -wait -mode NORMAL -param JOB_ID=98246 -param PREVRUNDT="2010-03-20 18:00:00"-param CURRRUNDT="2010-03-21 18:00:00" -warn 50 APPPRJ Load_Target
Should be another one in front of PREVRUNDT as well...
Let us know if that fixes it.
laiko
Premium Member
Posts: 35 Joined: Sun May 25, 2008 10:55 am
Post
by laiko » Tue Mar 23, 2010 11:17 am
Yes, that worked by adding -param before each parameter. Thank you.
I am going to put this code in a shell script. I have something like
Code: Select all
DSPath="/DS/Ascential/DataStage/DSEngine/bin"
paramvals="param JOB_ID=98246 -param PREVRUNDT='2010-03-20 18:00:00' -param CURRRUNDT='2010-03-21 18:00:00'"
conn="$DSPath/dsjob"
paramlist=" -run -jobstatus -wait -mode NORMAL $paramvals -warn 50 "
jobinfo=" APPPRJ Load_Target"
$conn $paramlist $jobinfo
This does not work and says:
Code: Select all
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>
But it works if I have:
Code: Select all
DSPath="/DS/Ascential/DataStage/DSEngine/bin"
conn="$DSPath/dsjob"
jobinfo=" APPPRJ Load_Target"
$conn -run -jobstatus -wait -mode NORMAL param JOB_ID=98246 -param PREVRUNDT='2010-03-20 18:00:00' -param CURRRUNDT='2010-03-21 18:00:00' -warn 50 $jobinfo
The list of parameters are dynamic so I'd like to put them in a string for readability of the code. I am really puzzled why it is not running when I am using variables.
asorrell
Posts: 1707 Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas
Post
by asorrell » Tue Mar 23, 2010 11:56 am
It fails because UNIX treats the "special" characters like the $ sign differently because of the quotes around it. Try using echo on the variables to see what Unix is actually submitting and you will probably see some differences from what you expect in terms of the finished command.
You'll need to play around a bit to get the quotes correct if you use environment variables to store the various pieces.
anbu
Premium Member
Posts: 596 Joined: Sat Feb 18, 2006 2:25 am
Location: india
Post
by anbu » Tue Mar 23, 2010 11:57 am
Code: Select all
paramvals="-param JOB_ID=98246 -param PREVRUNDT='2010-03-20 18:00:00' -param CURRRUNDT='2010-03-21 18:00:00'"
Add dash before first param
You are the creator of your destiny - Swami Vivekananda
asorrell
Posts: 1707 Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas
Post
by asorrell » Tue Mar 23, 2010 1:12 pm
Good catch on the typo! I need to get my contacts prescription updated.
laiko
Premium Member
Posts: 35 Joined: Sun May 25, 2008 10:55 am
Post
by laiko » Tue Mar 23, 2010 1:32 pm
My bad... that's really a typo when I posted the question. But in the actual case, it really has a dash. So this does not work either:
Code: Select all
DSPath="/DS/Ascential/DataStage/DSEngine/bin"
paramvals="-param JOB_ID=98246 -param PREVRUNDT='2010-03-20 18:00:00' -param CURRRUNDT='2010-03-21 18:00:00'"
conn="$DSPath/dsjob"
paramlist=" -run -jobstatus -wait -mode NORMAL $paramvals -warn 50 "
jobinfo=" APPPRJ Load_Target"
$conn $paramlist $jobinfo
anbu
Premium Member
Posts: 596 Joined: Sat Feb 18, 2006 2:25 am
Location: india
Post
by anbu » Tue Mar 23, 2010 1:56 pm
Add set -vx and show the trace of your script
You are the creator of your destiny - Swami Vivekananda
DSguru2B
Charter Member
Posts: 6854 Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX
Post
by DSguru2B » Tue Mar 23, 2010 1:58 pm
Try the following
Code: Select all
DSPath="/DS/Ascential/DataStage/DSEngine/bin"
paramvals="-param JOB_ID=98246 -param 'PREVRUNDT=2010-03-20 18:00:00' -param 'CURRRUNDT=2010-03-21 18:00:00'"
conn="$DSPath/dsjob"
paramlist=" -run -jobstatus -wait -mode NORMAL $paramvals -warn 50 "
jobinfo=" APPPRJ Load_Target"
eval $conn $paramlist $jobinfo
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.