Whats does this mean?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Whats does this mean?

Post by ady »

convert('.','',trim(l_SuperListInfo_1.ZPROMID:''))


What does the text in RED mean?. The data type of the ZPROMID column is decimal.

The column is being converted from CHAR to DECIMAL using a MODIFY stage and then before writing it to a SEQ file, the above derivation is given. Can anyone please let me know what that does ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

A colon is the concatenation operator and for some reason an empty string is being appended to the field. [shrug]
-craig

"You can never have too many knives" -- Logan Nine Fingers
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

Hmm ... thts wht I was wondering about .. Input datatype was CHAR 8, Output datatype is DECIMAL 8 , I thought that may be a reason why it was done so...
wnogalski
Charter Member
Charter Member
Posts: 54
Joined: Thu Jan 06, 2005 10:49 am
Location: Warsaw

Post by wnogalski »

Remove it an check what happens :roll:
Regards,
Wojciech Nogalski
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Whats does this mean?

That's an interesting Topic name :o
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

narasimha wrote:Whats does this mean?

That's an interesting Topic name :o
Perhaps, meaningless :wink:
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Find out who created the expression and ask them!

Looks like a clumsy attempt to force an implicit conversion to string so that the Trim() function can be applied. But it's wrong.

The proper way is to use an appropriate conversion function, such as StringToDecimal() in a Transformer stage or string_from_decimal() in a Modify stage.
Last edited by ray.wurlod on Thu Jan 04, 2007 4:16 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

:)

I removed it and tried to run .... it gives out the same output !

..... :?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It would in a server/BASIC expression. Appending no characters to a string returns the original string.

This is also true in a parallel expression, except that concatenation to a Decimal data type is prohibited. (You have marked the job type as parallel.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

ray.wurlod wrote: Find out who created the expression and ask them!

Looks like a weird attempt to force an implicit conversion to string so that the Trim() function can be applied. But it's wrong.

The proper way is to use an appropriate conversion function, such as StringToDecimal() in a Transformer stage or string_from_decimal() in a Modify stage.
Sorry abt the wrong place posted at...


I think you are right .... The field is modified in the MODIFY stage with this statement

ZPROMID:decimal[8,0]= decimal_from_string(ZPROMID)

And then in the following transformer this is the derivation for the field

convert('.','',trim(l_SuperListInfo_1.ZPROMID:''))
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So that ZPROMID is a string by the time it gets into this expression, and appending a zero-length string to it leaves it unaffected.

Looks like the problem for the original developer was between the keyboard and the chair.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

ray.wurlod wrote: Looks like the problem for the original developer was between the keyboard and the chair.


:lol:
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

ray.wurlod wrote: Looks like the problem for the original developer was between the keyboard and the chair.
:lol:

Something like this -
keyboard:original developer:chair
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If the Modify stage is just of the give purpose, why cant't both transformer and Modify stage be clubbed? You can perform the task in Transformer stage itself.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply