BEGINNERS GUIDE: COMPARE DATASTAGE JOBS/OBJECTS IN SAME PROJECT OR DIFFERENT PROJECT

COMPARE-DATASTAGE-JOBS-OBJECTS-IN-SAME-PROJECT-OR-DIFFERENT-PROJECT

Did you get any requirement to compare two parallel/sequence jobs?

If Yes, then this post is for you and you can compare not only jobs but also almost all the objects in DataStage.

You can compare two objects of the same type. For example, you can compare a parallel job with another parallel job in the same project or different project.

You can compare the following objects:

  • Parallel jobs
  • Server jobs
  • Mainframe jobs
  • Job sequences
  • Parallel shared containers
  • Server shared containers
  • Parallel routines
  • Server routines
  • Mainframe routines
  • Table definitions
  • Data connections

The Designer client displays descriptions of all the differences between the two objects in a hierarchical tree structure. You can expand branches in the tree to view the details. Click the underlined link in the description to view the changed object.

You can compare two objects that are in the same project or compare two objects that are in two different projects/environments. Let see one by one.

Comparing DataStage objects in the same project

You can compare objects in the same project either by selecting both objects in the repository tree or by selecting one object and then browsing for the other.

Procedure to compare objects:

Select the first object that you want compare in the repository tree and then do one of the following.

●      Hold down the CTRL key and click the second object in the tree, then right-click and select ‘Compare selected’.

 compare-selected-option-by-highlighting-two-datastage-jobs
●      Right-click and select Compare against, and then browse for the object, select it and click OK.
 Compare-Against-Option-DataStage
DataStage takes some time to process the comparison, you should be patient.
The details that are displayed depend on the types of object that you are comparing.
For example, the following picture shows the result of comparing two parallel jobs.
 compare-datastage-jobs-result

Comparing objects in different projects/Environments

The Designer client compares two objects of the same type that are in different projects and displays the results in a window. These results show what the differences are between the two objects.

Procedure to compare objects:

1.    In the repository tree, select the first object that you want to compare.
2.    Right-click and select Cross Project Compare.
cross-project-compare-option-in-datastage
3.    Click Attach.
Attach-parallel-job-in-datastage
4.    In the “Attach to Project” window, type your username and password, and select the project that you want to attach to from the Project list.
datastage-login-to-attach-jobs-while-compare
 5.    Click OK to see a filtered view of the repository tree in the chosen project. The filtered view displays only folders that contain eligible objects.
filtered-view-of-repository-tree
6.  Browse the tree and select the object that you want to compare to the first object.
7.  Click OK.
You can see the results window now as like above results page.
Okay, this is enough with manual work!
What if you want to compare DataStage jobs automatically using a script?
Here command line tool comes handy, using this you can automate object comparing process.

Compare command line tool

You can compare objects by entering commands on your client computer command line.
You can use the command line tool to build compare operations into scripts. These can be combined with other command line tools that are available for manipulating objects and projects.
The compare command line tool has the following syntax:

diffapicmdline.exe /lhscd “left_side_connection_details”
/rhscd “right_side_connection_details”
/t difftype /ot output_type
/ol output_location

The command takes the following arguments.

Read also: Compare command line tool in action with the screenshots

left_side_connection_details:

The connection details for the left side of the comparison, that is, the first object that you want to compare. Enclose the connections details in double quotation marks. Specify the following details:
/d=domainname /host=hostname /u=username /p=password project_name object_name
The name of a table definition object must be specified as its data locator name, not the name that is displayed in the repository tree. The data locator name is displayed in the table definition properties window.

right_side_connection_details:

The connection details for the right side of the comparison, that is, the second object that you want to compare. You must specify full connection details only if you compare two objects in different projects. Otherwise, you can specify only the object name. The syntax for the connection details is the same as for the left_side_connection_details option.

difftype:

The type of objects to compare. This argument can be one of the following values:
Job
SharedContainer
Routine
TableDef

output_type:

The format of the output of the comparison. The format is always HTML.

output_location:

The full path for the output file.
On completion the tool returns one of the following codes:
0 indicates successful comparison
1 indicates an error in the command line
2 indicates that the client cannot compare the objects
Example of comparison from the command line
The following command compares the job test1 with the job new_test1. Both jobs are located in the project named ABC. The output is sent to an HTML file on the c: drive:
compcmdline.exe /lhscd “/d=localhost:9080 /h=C101 /u=scott /p=changepwd ABC test1” /rhscd “new_test1” /t job /ot html /ol c:compare_output.html

Reference: Most of the information for this post has taken from IBM documentation.

Comments

comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: