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.
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’.
● Right-click and select Compare against, and then browse for the object, select it and click OK.
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.
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.
3. Click Attach.
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.
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.
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”
/t difftype /ot output_type
The command takes the following arguments.
Read also: Compare command line tool in action with the screenshots
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.
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.
The type of objects to compare. This argument can be one of the following values:
The format of the output of the comparison. The format is always HTML.
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.