Frequency of a record in a sequential 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
chitrangadsingh
Participant
Posts: 12
Joined: Mon Jul 18, 2005 4:07 am

Frequency of a record in a sequential file

Post by chitrangadsingh »

Hi,

I have to read a sequential file with some fields and the output should contain the frequency of occurence of values in one of the fields.
For eg. lets assume file has 3 fields A,B and C.
the sample data is

A B C
e t g
e w p
r u g
s t p

Now the output file should have :
C Count
g 2
p 2
How this can be achieved in PX without any sql (since the input is a sequential file)

Thanx,
Chits
hexa
Participant
Posts: 51
Joined: Sun Aug 08, 2004 6:25 am

Post by hexa »

Welcome ABROAD

Use Aggregator Stage to achive.

refer doc for more information

hexa
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

As hexa mentioned, group the required column in AGGR and use the count function to achieve this.

Take care of Sort the input data and partitioning.

HTWH.

Regards
Saravanan
chitrangadsingh
Participant
Posts: 12
Joined: Mon Jul 18, 2005 4:07 am

Post by chitrangadsingh »

Hey thanx for the warm welcome and the soln.

Any idea regd any docs freely available on net for Datastage??

(i'm kinda on leave and thus dont have access to any docs)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Currently there are no manuals available for download.

This may change now that IBM has acquired the products, as their model includes publishing manuals on a web site.

But not yet.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply