counting the rows for a similar column and making a header

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Before we go any further, is this really a Server job question? Or will you be building a Parallel job for this task?
-craig

"You can never have too many knives" -- Logan Nine Fingers
gauravgulati_
Participant
Posts: 2
Joined: Tue Nov 24, 2015 4:00 am

Post by gauravgulati_ »

HI Chullet

This is a server job. No parallel jobs involved in this.
Cheers
Gaurav
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This is probably most easily accomplished by sorting the data in reverse (or reading the file backwards), adding the "headers" at the end of each group, then sorting again back into forward order.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
naveenkumar.ssn
Participant
Posts: 36
Joined: Thu Dec 03, 2009 9:11 pm
Location: Malaysia

Re: counting the rows for a similar column and making a head

Post by naveenkumar.ssn »

Hi,


SeqFile ---- Aggreator ---- TargetFile

Group by on the first column and then in the aggreator use the count function to get the number of records.

That will resolve your issue

Regards
Naveen
Naveen Kumar
Datastage Consultant
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

How will that solve their problem? They need more than a simple count of the records. :?

Output:

COMP1 003
COMP2 002
COMP3 001

Perhaps if you explained how it can be combined with the source data, ensuring that the counts come first in the output, then you'd have a solution.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply