first() implemation in datastage

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
chvenkat.v
Participant
Posts: 94
Joined: Fri Dec 14, 2007 3:22 am

first() implemation in datastage

Post by chvenkat.v »

I wants to implement first() function in datastage. As you know we have first function in aggre trfm stage in informatica . In my case we are getting the values from source seq. file, and it is a migration from informatica to datastage. So, we need to replace same logic in PX job. Please tell me how to implement this.

Thanks!
venkat.
miwinter
Participant
Posts: 396
Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK

Post by miwinter »

As a Datastage forum, members here are not likely to necessarily know anything about Informatica. I have used it previously, albeit some 7-8 years ago now, yet even I can't recall what the first function does.

If you explain what it is you need to achieve, forgetting all about Informatica, it would be far simpler for anyone to answer your query. I'd guess, from the fact you are using it in an aggregation, that it's some kind of min/max function though (i.e. keep first).
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

DataStage also has an aggregator stage with similar functionality. Have you tried using that?
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

It is available in DS Server edition.

In PX, you can use a tx or lookup first row.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Group change detection using stage variables in a transformer, constrain to only the first element in each group.

[first answer was more min() than first() unfortunately]
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Remove Duplicates stage is the easiest way to capture the first record of each group.

As noted, the keyChange column that can be generated by a Sort stage can also be used to flag the first record in each group.
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