CAN WE PASS INTEGER COLUMN TO DECIMAL COLUMN IN TRANSFORMATI

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
panic
Participant
Posts: 17
Joined: Fri Sep 23, 2005 5:58 pm

CAN WE PASS INTEGER COLUMN TO DECIMAL COLUMN IN TRANSFORMATI

Post by panic »

WHILE TRANSFORMATIONS IN THE TRANSFORMER STAGE CAN WE PASS INTEGERED COLUMN TO DECIMAL COLUMN.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Panic

DO NOT TYPE IN ALL CAPS. If you do not respect our wishes then leave the web site. I think your attitude is rude. Craig politely asked you not to post in CAPS. You asked questions posting urgent in the topic. We do not make any money answering your questions. When you are rude then it is no longer fun. You will continue to get fewer and fewer answers.

Please try to show some good judgement and be polite and do what is asked or suggested. You will get better answers.
Mamu Kim
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

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

Post by ray.wurlod »

What exactly do you mean be an "integered" column?

Integer data types can automatically be promoted to decimal, provided the decimal data type has sufficient precision. For example, the largest legal (four byte) integer has ten digits; therefore, to be able to guarantee that the decimal column can accommodate any possible integer, it needs to have precision of at least 10+x, where x is the scale value. In this case you can guarantee that there will be accurate transfer.

On the other hand, if you have more a priori knowledge about the possible range of values that you may be processing, then a smaller precision may be possible. But if your knowledge turns out to be incorrect, then you risk loss of information in your data flow.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
panic
Participant
Posts: 17
Joined: Fri Sep 23, 2005 5:58 pm

error: column mismatch

Post by panic »

if column name (varchar) datatype then column name (integer) datatype
else integer (datatype).

i wrote in the transformer stage

If lo.custid Matches ("1970" Or "1971") Then in_data.value Else 0



is it the correct way or not.i have doubt on the quotation marks.
if not suggestions plzz.
thanks
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Server jobs are very gentle with mismatched data types.

Your expression is invalid:
If lo.custid Matches ("1970" Or "1971") Then in_data.value Else 0
can be:
If lo.custid = "1970" Or lo.custid = "1971" Then in_data.value Else 0
or
If lo.custid = 1970 Or lo.custid = 1971 Then in_data.value Else 0
The difference is that the quotes mean a text equivalency while no quotes tries a numerical equivalency. If the first valid example, 1970.00 will NOT be the same as 1970 whereas in the second example it will. Do the appropriate datatype syntax, else enforce rounding (See OCONV(link.column, "MD??") where ?? performs the appropriate decimal shift and rounding).
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

kcbland wrote:Server jobs are very gentle with mismatched data types.

Your expression is invalid:
If lo.custid Matches ("1970" Or "1971") Then in_data.value Else 0
can be:
If lo.custid = "1970" Or lo.custid = "1971" Then in_data.value Else 0
or
If lo.custid = 1970 Or lo.custid = 1971 Then in_data.value Else 0
The difference is that the quotes mean a text equivalency while no quotes tries a numerical equivalency. If the first valid example, 1970.00 will NOT be the same as 1970 whereas in the second example it will. Do the appropriate datatype syntax, else enforce rounding (See OCONV(link.column, "MD??") where ?? performs the appropriate decimal shift and rounding).

And by the way, please stop shouting as well. I agree with Kim 100%.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply