Need only One output

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
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Need only One output

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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
Post Reply