Adding the amount column value from Sequencial file.

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
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Adding the amount column value from Sequencial file.

Post by laknar »

Hi,

I'm reading from fixed width file.
in that i have a amount column starts with + or -

i.e -10.00
-12.12
+14.98
+25.78

im reading the file as squential mode.
i want to sum the column + seperately and - values seperately.

and finally differences for + values and -Values.
how can i acheive this.
bi_fujitsu
Premium Member
Premium Member
Posts: 46
Joined: Tue Mar 20, 2007 3:30 am
Location: India

Post by bi_fujitsu »

Convert to Decimal first and then use an aggregator stage to calculate the sum. Even if the order is sequential, it should give you correct sum irrespective of the sign.
-10+5 is always going to be -5.
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

From source itself im getting as decimal value.
how can i convert.
please suggest me.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

If your source already have it as decimal then what is stopping you to use aggregator for Summing those values??
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
bi_fujitsu
Premium Member
Premium Member
Posts: 46
Joined: Tue Mar 20, 2007 3:30 am
Location: India

Post by bi_fujitsu »

if it's decimal in source, then there is no need of any type conversion. Use an aggregator stage to perform regular summation.
Post Reply