How to minimise the 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
sureshchandra
Participant
Posts: 92
Joined: Mon May 07, 2007 4:26 am

How to minimise the output?

Post by sureshchandra »

Hi all,
My job design is
ODBC------>Trans---------->SeqFile.
I'm getting the dates as output.I won't recquired all the dates as out put.Among all i need only Max and Min dates.

Pls help me how to do this?


Thanks in advance
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

My first thought is that you should use the Aggregator Stage to compute your minimum and maximum dates but something tells me there must be more involved.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you specify MIN(TheDate) and MAX(TheDate) in your extraction SQL?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sureshchandra
Participant
Posts: 92
Joined: Mon May 07, 2007 4:26 am

Post by sureshchandra »

Hi all,
In source i'm having only one column.
This is my query pls check it
WITH DATES AS(
SELECT MIN(XX_MA_DT) STRT_DT,MAX(XX_MA_DT) END_DT
FROM
(SELECT DISTINCT XX_MA_DT
FROM EMP.T1
WHERE T1.XX_MX_DT < CURRENT DATE
ORDER BY XX_MA_DT DESC
FETCH FIRST 13 ROWS ONLY) TMP).
I'm having only XX_MA_DT this column. I'm not having the STRT_DT and
END_DT.
I need only Max and Min dates as out put.
Pls help me what are the stages recquired and what should i do ?
Thanks in advance
sureshchandra
Participant
Posts: 92
Joined: Mon May 07, 2007 4:26 am

Post by sureshchandra »

Hi all,
In source i'm having only one column.
This is my query pls check it
WITH DATES AS(
SELECT MIN(XX_MA_DT) STRT_DT,MAX(XX_MA_DT) END_DT
FROM
(SELECT DISTINCT XX_MA_DT
FROM EMP.T1
WHERE T1.XX_MX_DT < CURRENT DATE
ORDER BY XX_MA_DT DESC
FETCH FIRST 13 ROWS ONLY) TMP).
I'm having only XX_MA_DT this column. I'm not having the STRT_DT and
END_DT.
I need only Max and Min dates as out put.
Pls help me what are the stages recquired and what should i do ?
Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could wrap that SQL in another SELECT statement to form the MIN and MAX of XX_MA_DT.

You could use an Aggregator stage to form the MIN and MAX.

You could use stage variables in a Transformer stage.

There's three ways, just off the top of my head.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sureshchandra
Participant
Posts: 92
Joined: Mon May 07, 2007 4:26 am

Post by sureshchandra »

Hi Ray,
Pls be clear of how to do in aggreator stage.
should i add the STRT_DT and END_DT in source and do aggregation ?


I'm very thankful to u
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not in source, only in target. Derive as MIN(XX_MA_DT) and MAX(XX_MA_DT) respectively.
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