Text to be displayed in double quotes

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
Latha1919
Premium Member
Premium Member
Posts: 178
Joined: Mon May 22, 2006 2:32 pm

Text to be displayed in double quotes

Post by Latha1919 »

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
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

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
Premium Member
Posts: 178
Joined: Mon May 22, 2006 2:32 pm

Post by Latha1919 »

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
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

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
Premium Member
Posts: 178
Joined: Mon May 22, 2006 2:32 pm

Post by Latha1919 »

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
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

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 »

then in the routine code put:

first_part : "'" : "Market" : "'" : last_part

or something like that,

regards
Latha1919
Premium Member
Premium Member
Posts: 178
Joined: Mon May 22, 2006 2:32 pm

Post by Latha1919 »

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 »

try this:

first_part : char(034) : "Market" : char(034) : last_part

regards,
Cristina
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

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
Premium Member
Posts: 178
Joined: Mon May 22, 2006 2:32 pm

Post by Latha1919 »

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 »

9 year of experience :lol:
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

'034' is ascii code for double quotes. Thats how it worked :wink:
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 »

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.
Post Reply