desining approach

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
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

desining approach

Post by scorpion »

Hi All,

I have a Input file has following columns:

Name, age, sex,pan,city,zone (there are 4 zones)

And I want out put file like for each zone(for 4 zones) I require sex and average age.


how should i approach this..

can any one help on this

tx in advance
Thanx&Regards
scorpion
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

So you want to split your file into four files, one for each zone, yes?
On what basis do you want do get the average age?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Here's an approach based upon my understanding of your requirement:

1. Pass the data through an aggregator and group by Zone, Sex and then Sum on Age. Also create a COUNT column and maintain a count.
2. Now pass this data through a transformer stage where you divide the sum of age with the count.
Kris

Where's the "Any" key?-Homer Simpson
Post Reply