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
Latha1919
Premium Member
Posts: 178 Joined: Mon May 22, 2006 2:32 pm
Post
by Latha1919 » Thu Mar 15, 2007 5:25 am
Hi,
Currently I am wokring on DataStage 5.1. In the Transformer stage of the job, in the derivation part, I am calling a routine which has two input parameters and returns a string. While returning this string, I would like to enclose section of the string in double quotes. I am not able to do this using DQUOTE etc.
Can you suggest me how do I go about it?
Thanks,
kumar_s
Charter Member
Posts: 5245 Joined: Thu Jun 16, 2005 11:00 pm
Post
by kumar_s » Thu Mar 15, 2007 5:34 am
Do you want to handle this in routine or in job. If in job try to concatenate with quotes. eg "'":routine:"'".
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Latha1919
Premium Member
Posts: 178 Joined: Mon May 22, 2006 2:32 pm
Post
by Latha1919 » Thu Mar 15, 2007 5:42 am
This should be handled in Routine itself. Also that only part of the return string need to be enclosed in double quotes but not the entire return string.
dsx
kumar_s
Charter Member
Posts: 5245 Joined: Thu Jun 16, 2005 11:00 pm
Post
by kumar_s » Thu Mar 15, 2007 5:44 am
Could you explain with example. Why can you concatenate with Quote character in Routine it self?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Latha1919
Premium Member
Posts: 178 Joined: Mon May 22, 2006 2:32 pm
Post
by Latha1919 » Thu Mar 15, 2007 5:55 am
We are performing some validations through this routine. One of the validation here, if one of the i/p paramet value is equal to Market, then I am assigning the following message to a variable, which later is assigned to Ans.
Segment Value is "Market" and processed data will not be reported.
See, here Market should be enclosed in Double quotes.
Is it clear?
kumar_s
Charter Member
Posts: 5245 Joined: Thu Jun 16, 2005 11:00 pm
Post
by kumar_s » Thu Mar 15, 2007 6:04 am
Why isn't DQUOTE working? What you get when you use DSLogInfo with DQUOTE(Derivation result)?
As mentioned, alternatively you could concatinat the quote char.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Cr.Cezon
Participant
Posts: 101 Joined: Mon Mar 05, 2007 4:59 am
Location: Madrid
Post
by Cr.Cezon » Thu Mar 15, 2007 6:08 am
then in the routine code put:
first_part : "'" : "Market" : "'" : last_part
or something like that,
regards
Latha1919
Premium Member
Posts: 178 Joined: Mon May 22, 2006 2:32 pm
Post
by Latha1919 » Thu Mar 15, 2007 6:12 am
I tried this, and was not working out. Market is not showing up in Quotes.
dsx
Cr.Cezon
Participant
Posts: 101 Joined: Mon Mar 05, 2007 4:59 am
Location: Madrid
Post
by Cr.Cezon » Thu Mar 15, 2007 6:21 am
try this:
first_part : char(034) : "Market" : char(034) : last_part
regards,
Cristina
kumar_s
Charter Member
Posts: 5245 Joined: Thu Jun 16, 2005 11:00 pm
Post
by kumar_s » Thu Mar 15, 2007 6:23 am
Try assigning DQUOTE(derivation) to a variable and try to print that. Else have you tired the concatenation process.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Latha1919
Premium Member
Posts: 178 Joined: Mon May 22, 2006 2:32 pm
Post
by Latha1919 » Thu Mar 15, 2007 6:34 am
try this:
first_part : char(034) : "Market" : char(034) : last_part
This has worked out. Thanks a lot.
But, how you could suggest this?
Thanks,
Latha
dsx
Cr.Cezon
Participant
Posts: 101 Joined: Mon Mar 05, 2007 4:59 am
Location: Madrid
Post
by Cr.Cezon » Thu Mar 15, 2007 6:46 am
9 year of experience
DSguru2B
Charter Member
Posts: 6854 Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX
Post
by DSguru2B » Thu Mar 15, 2007 6:48 am
'034' is ascii code for double quotes. Thats how it worked
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Thu Mar 15, 2007 7:53 pm
I still can't believe that this won't work. It works for me.
Code: Select all
"Segment Value is " : DQuote(Market) : " and processed data will not be reported."
(Actually I use Quote() rather that DQuote(), but it should make no difference.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.