Quoted Strings as Parameter

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
CogUser
Premium Member
Premium Member
Posts: 9
Joined: Mon Jan 29, 2007 8:22 am
Location: London

Quoted Strings as Parameter

Post 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
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post 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.
Wolfgang Hürter
Amsterdam
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Put eval before dsjob (eval dsjob -run -param ) or include the parameter name also into the quote and try.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Try

dsjob -run -param 'acctype=a b c' <project name> <job name>
Mamu Kim
CogUser
Premium Member
Premium Member
Posts: 9
Joined: Mon Jan 29, 2007 8:22 am
Location: London

Post by CogUser »

Thank you for your suggestions. we tried all the suggestions but none of them produced the desired results.

Thanks.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Can you post your exact error message?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Did you try escaping the quote characters?

Code: Select all

dsjob -run -param acctype=\'a b c\' <project name> <job name>
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
CogUser
Premium Member
Premium Member
Posts: 9
Joined: Mon Jan 29, 2007 8:22 am
Location: London

Post 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
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post 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
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
CogUser
Premium Member
Premium Member
Posts: 9
Joined: Mon Jan 29, 2007 8:22 am
Location: London

Post by CogUser »

We have thried that as well and it does not work.

Thanks
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Mhh.. If possible can you give the exact command that you are using.
Looks like we are missing something here. :roll:
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
CogUser
Premium Member
Premium Member
Posts: 9
Joined: Mon Jan 29, 2007 8:22 am
Location: London

Post 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
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

does a job without any parameters work correctly in UNIX. If not the reason might be else.
Wolfgang Hürter
Amsterdam
Post Reply