Question on Comparing DataStage Jobs

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
ccatania
Premium Member
Premium Member
Posts: 68
Joined: Thu Sep 08, 2005 5:42 am
Location: Raleigh
Contact:

Question on Comparing DataStage Jobs

Post by ccatania »

Some of our programmers who have coverted to DataStage from the mainframe darkside have asked if there is a way to compare DataStage jobs. For example compare the Datastage job in production against same job in Test and have any code differences list out, as they were able to do in the darkside. :roll:

Thnxs,

Charlie
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Version 8 does it in "stunning" fashion. Nice graphics, drill thru to the link or transform that is different, etc.... prior to that, I've seen posts in here where people compare .dsx's, but it's more challenging.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
ccatania
Premium Member
Premium Member
Posts: 68
Joined: Thu Sep 08, 2005 5:42 am
Location: Raleigh
Contact:

Post by ccatania »

Thanks Ernie for the quick reply. I have version 8 upgrade on my project plan for the summer, we tried to export and do a dsx compare using utra-edit's compare option, but it listed every timestamp differences it found, a real mess. Knowing that it is available in version 8 will make my darkside developer's smile a little. while I have your attention.
any truth to the rumor that version control is not available in veriosn 8, if so, is there a replacement?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's not a rumor, it's a fact. And there's no direct replacement, that's coming 'real soon now' as official hooks to supported products. In the meantime, you'd have to roll your own.

For the comparison, yes - timestamps and version numbers will always be an issue - but you quickly learn to discern the differences that matter.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ccatania
Premium Member
Premium Member
Posts: 68
Joined: Thu Sep 08, 2005 5:42 am
Location: Raleigh
Contact:

Post by ccatania »

Thanks guys for the input have a great weekend.
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

I have to do a lot of code reviews and have run into this as well. We are on 7.5.1a and are not slated to move to v8 until later this year or early 2009 (bummer).

When the DSX is compiled, the OSH is visibile in the file. The following alias (on Unix) will parse out the basic OSH:

Code: Select all

alias -x getdsstages='sed -n "/OrchestrateCode =+=+=+=/,/=+=+=+=/p"'
Put this in your .profile so the command is accessible in your sessions. Then do the following from the commandline:

Code: Select all

getdsstages DSXFileVersion1 > old
getdsstages DSXFileVersion2 > new
diff old new
You will still get more differences than basic code changes, but it does reduce the clutter somewhat. If you have a side-by-side diff tool, it is much easier to eyeball the differences. ClearCase has an X-Windows GUI that works well.

Brad.
bcarlson
Premium Member
Premium Member
Posts: 772
Joined: Fri Oct 01, 2004 3:06 pm
Location: Minnesota

Post by bcarlson »

For those of you who use buildops, here is a Perl script that grabs your buildop code out of the DSX file for comparison:

Code: Select all

[mysuerid@myserver 16394]: cat getdsbuildop
#!/usr/bin/perl

$last_rec = undef;
$ind1 = 0;
$ind2 = 0;
$found = 0;
LINE: while(<>) {
        if (/CUSTOMPXBUILD/) {
                $last_rec = "$_";
                $ind1 = 1;
        } elsif (/Definition/ && $ind1 == 1) {
                # Right occurence, make updates then reset indicator
                print "$last_rec";
                print "$_";
                $ind2 = 1;
        } elsif (/InputLinkOrder/) {
                print "$_";
                $ind1 = 0;
                $ind2 = 0;
        } elsif ($ind2 == 1) {
                print "$_";
        }
}
This is pretty brute force, but it does simplify the output a bit.

From the commandline:

Code: Select all

getdsbuildop DSXFileVersion1 > old
getdsbuildop DSXFileVersion2 > new
diff old new
Again, if you have a side-by-side diff tool, the comparison is much easier.

Also, when you use a diff tool, try to ignore whitespace. I've noticed that helps reduce 'fake' differences...

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

Post by ray.wurlod »

The new tool (probably coming out with version 8.1) will - initially at least - provide an interface to Clear Case, according to one of the presentations at IoD 2007.
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