calling a script

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
forboy
Participant
Posts: 13
Joined: Tue May 04, 2004 12:03 pm

calling a script

Post by forboy »

Hi, I new to DS, anybody help me with solution for this,

I have source coming from text file and DB2 table. target is DB2 table. I have straight move from text file, but from DB2 table I need to get only one column which is date, I need to get latest date from it, these two sources( text file and DB2 table) have none of the columns same. How can I do it, do I need to write a shell script with sql inside and call it(script) somewhere. help me here.



forboy
dsxdev
Participant
Posts: 92
Joined: Mon Sep 20, 2004 8:37 am

Post by dsxdev »

What is your requirement ? Is it that you need to move records from file to DB2 table and get record with latest date from DB2 table and then wrtie to target Db2 table
or is it the of the records from both text file and DB2 table you need to get record with latest date.

if your requirement is the third option then you can Use funnel Stage to get records from both the sources and then direct it to an Aggregator Stage to get Max of the dates.

If you need to merge the latest date from DB2 stage to records from text file then you can achieve it by using a dummy column.

First read from text file, use a column generator to add a new Dummy column with a default value. Now get one column with latest date from DB2 stage and a dummy column with same default value as from Column generator then merge/join these two sources to get the desired result.
Happy DataStaging
Post Reply