Page 1 of 1
Quoted Strings as Parameter
Posted: Thu Sep 27, 2007 5:03 am
by CogUser
We have a requirement where we need to pass quoted parameters do the dsjob command
dsjob -run -param acctype='a b c' <project name> <job name>
But ds comes back with an invalid argument message. If we remove the spaces between the values, it works
dsjob -run -param acctype='abc' <project name> <job name>
Can you pls let me know if you have come across similar scenarios and what you did to over come this problem?
Thanks
Posted: Thu Sep 27, 2007 7:29 am
by WoMaWil
That is a question of how UNIX give the data to DataStage.
Best might be you pass "'a*b*c' and substitute within DataStage the star with a blank.
Posted: Thu Sep 27, 2007 7:38 am
by JoshGeorge
Put eval before dsjob (eval dsjob -run -param ) or include the parameter name also into the quote and try.
Posted: Thu Sep 27, 2007 2:17 pm
by kduke
Try
dsjob -run -param 'acctype=a b c' <project name> <job name>
Posted: Fri Sep 28, 2007 5:01 am
by CogUser
Thank you for your suggestions. we tried all the suggestions but none of them produced the desired results.
Thanks.
Posted: Fri Sep 28, 2007 5:21 am
by balajisr
Can you post your exact error message?
Posted: Fri Sep 28, 2007 5:53 am
by ray.wurlod
Did you try escaping the quote characters?
Code: Select all
dsjob -run -param acctype=\'a b c\' <project name> <job name>
Posted: Fri Sep 28, 2007 11:23 am
by CogUser
Ray,
While using the escape character, it comes back with a message
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
If we just past the quote character without the escape character, it runs but truncates the value at the first space.
Thanks
Posted: Fri Sep 28, 2007 11:50 am
by narasimha
Guessing this should work, if you want to pass 'a b c' as the parameter value.
Code: Select all
dsjob -run -param acctype="'a b c'" <project name> <job name>
HTH
Posted: Fri Sep 28, 2007 11:55 am
by CogUser
We have thried that as well and it does not work.
Thanks
Posted: Fri Sep 28, 2007 12:09 pm
by narasimha
Mhh.. If possible can you give the exact command that you are using.
Looks like we are missing something here.
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Posted: Fri Sep 28, 2007 12:40 pm
by CogUser
we just progressed a step ahead. The original command I was trying to execute was in the project directory with the -local option, it does not work...as below.
/app/dsadm/Ascential/DataStage/DSEngine/bin/dsjob -run -wait -warn 0 -param SRCE_SYS_NM="I P" -local <ProjName> JobA2
But if I remove the -local optiona and execute it from the bin directory it works...as below
dsjob -run -wait -warn 0 -param SRCE_SYS_NM="I P" <ProjName> JobA2
Posted: Mon Oct 01, 2007 1:10 am
by WoMaWil
does a job without any parameters work correctly in UNIX. If not the reason might be else.