Comparing files

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
muascdev
Charter Member
Charter Member
Posts: 51
Joined: Tue Oct 10, 2006 5:48 pm

Comparing files

Post by muascdev »

i have a need to compare 2 files and 2 specific columns in it.. i have a need to know what column got changed. is there anyway to find out what column got changed. i dont see anywhere in change captur /compare/difference stages that tells us.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

I think you can do that with either of them. Just read only two specific columns and do a compare. I haven't tried it but give it a shot.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If Change Capture /Compare/Difference is all about that, not sure why can you find out. If you going to compare two files, obviously there would (should) be a command key. So use Explcit Keys and Explicit values option in Change Capture stage.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
muascdev
Charter Member
Charter Member
Posts: 51
Joined: Tue Oct 10, 2006 5:48 pm

Post by muascdev »

my understanding is that all these stages will tell us if keys or values changed. if i want to know what coulmns got changed with in value columns, i didnt find any option.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Make the columns you want to compare, as keys. Apply all rules of keys to these columns, like partitioning on it, sorting etc.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Or join the two files using Join (perhaps a full outer join), user Transformer stage, compare the column one to one. Add a Flag column for each column that you need to check and mark the value according to the change, either Yes or No.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply