Dealing with Numeric value in Datastage.

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

Dealing with Numeric value in Datastage.

Post by srinath51 »

Hi All,

i have a field named - "ITEM_SEQ_R" Num(5,0),the values for the field in the Sql database are 622,355.
when i use the above field and generate a text file then i get output as
' 00622.',But i want the output as '000622.'

when i concatenate a '0' then i get '0 00622.',So my question is How can i get this value in Datastage -- '000622.' instead of ' 00622.'
Sri.
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

What , if you change that to Num(6,0)?
pandeeswaran
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Define your field as 6 digits in length instead of 5.

The space you're seeing is reserved for the sign in a decimal (Number field) which has been converted to character...you can always Trim() it before concatenating (unless it's '-' then you'll need to use left(), right() and/or substrings).

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
srinath51
Participant
Posts: 61
Joined: Wed Aug 31, 2011 10:47 am
Location: United States

Post by srinath51 »

Thanks Pandeesh & Jwiles...

i converted and now it works fines as i desired.
Sri.
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

So, can you please resolve the topic?
pandeeswaran
Post Reply