Datastage Challenge

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
shank
Participant
Posts: 18
Joined: Wed Mar 25, 2009 3:11 am

Datastage Challenge

Post by shank »

Hi,

Here is a scenario.. Kindly tell me we could do this using DS or not.
The basic requirement is to compare data between current and history tables based on key columns. However both the table names and the columns to be compared will be dynamic. The table name and Key column will be passed to the datastage job. The columns to be compared will change periodically. Can we achieve this using datastage. Please reply the possibility of doing it and the approach for the same. Usage of shell script using sub routines is allowed.
Regards,
Shank
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I imagine it's possible, but have not given any thought to how. Depends to some extent on what you mean by "dynamic" and whether you allow QualityStage stage types into the mix.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

This is very much possible - especially using non-transformer stages with RCP enabling.

But the main question is, if the columns are 'dynamic', then your previous run to load might have 5 columns whereas current run have 6 - but for same table. This may lead to incorrect results.
shank
Participant
Posts: 18
Joined: Wed Mar 25, 2009 3:11 am

Post by shank »

Ok.. We are having a table which has the details of the table name and the column names which need to be compared. The table has 2 columns. COMP_FIELD and TABLE_NAME. This table would undergo change periodically. The sample data in the table would be like this...

LAST_NM|CONSUMER_POLICY
FIRST_NM|CONSUMER_POLICY
STRT_ADDRESS_LN1|POSTAL_ADDRESS
STRT_ADDRESS_LN2|POSTAL_ADDRESS
POSTAL_ZIP_CD|POSTAL_ADDRESS
PLAN_VARIATION_CD|INS_COVERAGE_FACT

So, here we would need to compare the LAST_NM and FIRST_NM columns between CONSUMER_POLICY and TEMP_CONSUMER_POLICY tables.
then we would need to compare STRT_ADDRESS_LN1, STRT_ADDRESS_LN2 and POSTAL_ZIP_CD columns between POSTAL_ADDRESS and TEMP_POSTAL_ADDRESS tables... and so on..

How can we acheive the same?
Regards,
Shank
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Parallel job? Server job?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

QualityStage reference match.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Are you talking about something like the Oracle minus query?
Mamu Kim
debrujr
Participant
Posts: 56
Joined: Fri Jul 31, 2009 1:05 pm
Location: South

Post by debrujr »

Personally I would do a mix of ksh with embedded sql. I know this is a DS forum but in my head it works out better going that route.

In essence I would group my key columns by table name in one select and then pass the table and column params to another query that will plug in the variables in their desired spots to achieve a dynamic query that will allow any variant of columns as well as number of columns to be compared with one sql construct.

In my mind it would be an outer loop performing the gather of columns by table and then an inner statement that is performing the compare.

Again I apologize for not throwing out a solution for it via DS but considering the nature of the solution and it is encapsulated in a DB then I would think this could be a simple and clean option as long as you have the skillset to do so.
Post Reply