Comparing CFF files , Record to Record !

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
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Comparing CFF files , Record to Record !

Post by ady »

I have two CFF files one from the Production and one from the DEV. Now I need to compare "records" / "fields" for these two files to check if the data from both the ENV matches.

Some fields in DEV data are not in Production yet, in that case we'll have to tell the job not to perform a compare record-for-record in those cases, but rather field-to-field. I need to compare all rows !!

I think I need to use indicators for each field which say "Y" if the data matches, "F" in the field matches and "N" if there is a mismatch. Indicators are not that important but I need a way to compare the data (i think indicators are the easiest to do it).

Any Ideas ??
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you have Enterprise Edition? There are better tools in parallel jobs. In a server job, you're up for a lot of stage variables and hand-coding.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

I am required to do it on Server. Can I do it? and How can I do this on parallel ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Of course you can do in in server. Set up a stage variable for each comparison. Tedious, perhaps, but not difficult.

Parallel jobs have inbuild stage types for change detection (Difference, Compare and Change Capture stages). They tend to make this kind of task less tedious.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Check out Merge Stage, you can extend its usage to see the differences in the the two files.
You can do things like Left Outer Join, Right Outer Join,....
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Merge stage will only show differences on columns defined as keys for the join. :cry:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

ray.wurlod wrote:Merge stage will only show differences on columns defined as keys for the join. :cry:
Thats right, missed that part.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

How can I setup a stage variable ? .... Please explain ?

I need to compare each field in the record ! :(
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In the Transformer stage you open the stage properties window (use the leftmost tool on the toolbar), then select the Variables tab.
You will need one stage variable for each field. The result of the expression is whatever you like, either a true/false, or a "flag" as suggested earlier.

You may also need to "show stage variables" so that you can see the stage variables grid in the design canvas.

Further stage variables can be used to consolidate the overall answer (for example, record contains no changes).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If its a delimited file, first count number of delimiter using either DCOUNT or other functions available. If it the number of fields is as expected, do a lookup against production file. If all the fields matches, marks the flag as 'Y'.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ady
Premium Member
Premium Member
Posts: 189
Joined: Thu Oct 12, 2006 12:08 am

Post by ady »

Specs just changed ... i have to compare sequential files now, and on parallel jobs ! :)

Which is the best option i have right now Difference,Change capture or compare ?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Depends what you want out of it. Why not start a new thread on the parallel forum?
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