replace . with -

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
srinath51
Participant
Posts: 61
Joined: Wed Aug 31, 2011 10:47 am
Location: United States

replace . with -

Post by srinath51 »

Hi All,

i am having one of the column named in a Sql table named - 'ITEM_R(Numeric (5,0)).there are 2 values for this column i.e; 3,131 & 5,243

Now when i pull this column in the Data-stage Extract and see the data then i see the following values i.e; 03131. & 05243.

so my req was to replace the . at the end with -i.e; 03131- & 05243-
Sri.
srinath51
Participant
Posts: 61
Joined: Wed Aug 31, 2011 10:47 am
Location: United States

Post by srinath51 »

i got it fixed...

used the convert Function...
Here is the syntax :

Convert(".","-",READ_Data.ITEM_R):
Sri.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You've changed the meaning of your data.

A "." at the end means a decimal data type with 0 decimal places.
A "-" at the end means an integer with a value less than zero.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

At least the column is not named "DATA"...
Choose a job you love, and you will never have to work a day in your life. - Confucius
prakashdasika
Premium Member
Premium Member
Posts: 72
Joined: Mon Jul 06, 2009 9:34 pm
Location: Sydney

Post by prakashdasika »

Since the actual column in the sql table does not have a decimal, import the field as integer instead of decimal (which is the default for all numeric datatypes). No need to use covert function.
Prakash Dasika
ETL Consultant
Sydney
Australia
Post Reply