Page 1 of 1

first() implemation in datastage

Posted: Wed Aug 19, 2009 7:48 am
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.

Posted: Wed Aug 19, 2009 7:57 am
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).

Posted: Wed Aug 19, 2009 8:03 am
by ArndW
DataStage also has an aggregator stage with similar functionality. Have you tried using that?

Posted: Wed Aug 19, 2009 8:03 am
by Sainath.Srinivasan
It is available in DS Server edition.

In PX, you can use a tx or lookup first row.

Posted: Wed Aug 19, 2009 8:14 am
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]

Posted: Wed Aug 19, 2009 6:29 pm
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.