| Author |
Message |
ffillmorejr
Participant
Joined: 27 Jul 2010
Posts: 10
Points: 95
|
|
| DataStage® Release: 8x |
| Job Type: Server |
| OS: Windows |
|
I have an ODBC Stage that SELECTs rows from a System i table/physical file. This feeds a Transformer stage that puts the rows on respective INSERT/UPDATE/DELETE links to a second ODBC Stage writing to another database. Once all of the records have been processed in the second ODBC Stage, I would like to delete ("prune") all of the records I have read from the original System i table/physical file.
The Transformer Stage (in the middle) has a value used to identify the records to be deleted. I need to have the Transformer to feed that value to a third ODBC Stage to process the deletion, but only after all of the records have been processed in the target database (second ODBC Stage). I know how to pass the value from the Transformer. How do I know when the target database records have all been processed? How can I tell when the second ODBC Stage has finished successfully processing all of its input records?
|
|
|
|
|
 |
anbu

Group memberships: Premium Members
Joined: 18 Feb 2006
Posts: 403
Location: india
Points: 1588
|
|
|
|
|
|
I dont think you can read and delete the same table in a job. Our forum experts can confirm this.
Instead you can write the key fields to a file or hash file and create another job to use it and delete rows from your source table
|
_________________ You are the creator of your destiny - Swami Vivekananda |
|
|
|
 |
kris007
 since March 2006
Group memberships: Premium Members
Joined: 24 Jan 2006
Posts: 1088
Location: Riverside, RI
Points: 7446
|
|
|
|
|
|
|
If your source is a table, you will have to split your process into two jobs to delete the data from the source. If your source is a physical file then you can write your flagged records from the transformer stage into a sequential file and overwrite your source file as part of your after job subroutine.
|
_________________ Kris
Where's the "Any" key?-Homer Simpson
|
|
|
|
 |
ArndW
Participant
Group memberships: Premium Members, Inner Circle, Australia Usergroup
Joined: 16 Nov 2004
Posts: 14022
Location: Germany
Points: 79230
|
|
|
|
|
|
|
You can have your transform stage output records to a flat file; then have an output link on that file which won't get executed until the last row has been written to it.
|
_________________
|
|
|
|
 |
kris007
 since March 2006
Group memberships: Premium Members
Joined: 24 Jan 2006
Posts: 1088
Location: Riverside, RI
Points: 7446
|
|
|
|
|
|
|
But the OP wanted all the records to get inserted/updated into the target table before the process can start deleting the records from the source table.
|
_________________ Kris
Where's the "Any" key?-Homer Simpson
|
|
|
|
 |
arunkumarmm
Participant
Joined: 30 Jun 2008
Posts: 98
Location: New York
Points: 527
|
|
|
|
|
|
|
Best way is to do the delete in a sep. job.
|
_________________ Arun |
|
|
|
 |
Sainath.Srinivasan
Participant
Group memberships: Heartland Usergroup
Joined: 17 Jan 2005
Posts: 3293
Location: United Kingdom
Points: 13965
|
|
|
|
|
|
|
First-and-foremost, is the source table used by any other system ? If so, modifying its content will impact them. Have you discussed your method with such potential system's owners ?
Second, if ...
|
|
|
|
|
 |
ffillmorejr
Participant
Joined: 27 Jul 2010
Posts: 10
Points: 95
|
|
|
|
|
|
Thank you to all who responded to this post. I have blogged on the integration of InfoSphere Change Data Capture and DataStage - including the solution to the pruning question I had posted here.
http://www.thefillmoregroup.com/blog/?p=369
|
|
|
|
|
 |
|
|