Page 1 of 1

Need only One output

Posted: Mon Oct 28, 2002 1:24 am
by rasi
Hi,

I am creating a job in which I want to insert one log record to my oracle table which has the jobname,number of rows processed and datetime stamp.

If I use a output link to my oracle it will insert for every input record. But i need only one record for a job. Is there any way of doing in Datastage.

Also I need to know in the transformation if I want to send a output to a link only once is it possible.

Thanks in advance

Rasi

Posted: Mon Oct 28, 2002 7:47 am
by chulett
You could use the Aggregator stage to solve your first problem. Send a minimal amount of information down a seperate link to the Aggregator and use it's COUNT function. Pull that out, add the jobname and timestamp in a transform and send it off as one row to Oracle.

On the 'once' issue, depends on when you need the 'once'. If first is ok, then contrain the link with @INROWNUM=1. Last is more difficult unless you know how many input rows you have. Don't have a good answer for that one off the top of my head, really depends on what you need to do.

-craig

Posted: Mon Oct 28, 2002 10:00 pm
by ray.wurlod
FIRST and LAST are available as "grouping functions" in the Aggregator stage, iirc from version 4.2 of DataStage. This is a handy way to do LAST, and you could apply this to a column whose value was being generated by @INROWNUM or @OUTROWNUM, depending on specifically what you wanted to count.

Posted: Tue Oct 29, 2002 9:25 am
by chulett
Cool, forgot about those 'aggregations'. MIN and MAX are also candidates, depending on the data and what people are trying to accomplish.

-craig