How do I sum amounts based on run date parameter

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
farkeye
Participant
Posts: 3
Joined: Fri Feb 23, 2007 1:56 pm

How do I sum amounts based on run date parameter

Post by farkeye »

Hi, I am very new to all of this good stuff.

I am working with a sequential file as input that contains
Amount_1 Decimal Length 13 Scale 2
Amount_2
.
.
.
Amount_12

There is also a Job Parameter : Datecard_From_Date with default value
2007-02-01

Based on the Job Parameter with month of 02 I only want to sum Amount_1 and Amount_2 into a new column.

Question: What stage do I use and of course how do I code it?
Would setting up the input as an occurs make it easier ?

:?
pbatchu
Charter Member
Charter Member
Posts: 20
Joined: Thu Aug 17, 2006 11:53 am
Location: Boise

Post by pbatchu »

Use the transformer stage. You can use parameters in transformer and also if condition. You can use if condition to assign value to new column. Make sure that you handle nulls, if not transform stage may drop records.
farkeye
Participant
Posts: 3
Joined: Fri Feb 23, 2007 1:56 pm

Post by farkeye »

pbatchu wrote:Use the transformer stage. You can use parameters in transformer and also if condition. You can use if condition to assign value to new column. Make sure that you handle nulls, if not transform stage may drop records.
Thank you, I will give that a try.
Post Reply