Skip to content

Comparing/Merging Files Using ChangeMan Diff

The ChangeMan Diff utility is included with ChangeMan ZDD and supports path names that exceed 259 characters in length if you are using Windows Vista or Windows 7.

Using the ChangeMan Diff utility, you can compare and merge:

  • Files on your local computer.

  • Files and ChangeMan ZMF components on your z/OS server.

You can initiate the Compare and Merge functions in the following ways:

  • Select files/components in the Explorer window, right-click, and choose ZDD Network | Compare Files or ZDD Network | Merge Files from the popup menu (described in this chapter).

  • Select ChangeMan ZMF components from the Staging Versions dialog box and click the Compare or Merge buttons.

Once you are within the ChangeMan Diff utility, you can alternate between comparing and merging files, and initiate new compares/merges.

Comparing Files

You can compare the contents of two text-based files using the ChangeMan Diff utility. The resulting differences are displayed side-by-side.

The following types of data can be compared:

  • Any text-based file on your local computer

  • Sequential data sets

  • Partitioned data set members

  • Unix files (text-based)

  • ChangeMan ZMF components (text-based)

  • JES spool data sets

Note

Word documents cannot be compared using this utility.

Files of different types can be compared with each other. For example, you can compare:

  • A ChangeMan ZMF SRC component with a TXT file on your local computer.

  • Components in two different ChangeMan ZMF instances.

Initiating the Compare

  1. Select one or two files to be compared. Right-click and choose ZDD Network -> Compare Files from the popup menu. The Compare Files dialog box displays.

  2. The files you selected display in the File 1 and File 2 text boxes. You can change the path names in the text boxes or click the browse button to select different files.

  3. The following options can be selected.

    Option Description
    Ignore case Differences in case are ignored.
    Ignore space change Space differences within a line are ignored.
    Ignore blank lines Blank lines are ignored.
    Ignore comments Comments are ignored. A comment is determined by the file type.
  4. Click OK to invoke the ChangeMan Diff utility. The following dialog box displays a side-by-side comparison.

...

...

The two large panes display the compared files.

  • The file names display on the title bars.

  • Line numbers display on the left side of each pane.

  • The text lines are highlighted in different colors to represent different types of changes. In the previous example, the highlighted section of code in the right pane was added; the highlighted section in the left pane was deleted. When you place the cursor in the text of a file, the type of change is indicated in the legend at the bottom right side of the screen.

The Map area on the left side of the screen gives a micro view of each file. Arrows indicate the cursor position in the files; colors indicate the areas with differences.

The order in which files are selected determines if lines are considered added or deleted. If you select the files so that the newest file is File 2, then the added lines appear as added; otherwise, they appear as deleted.

Using Templates

Templates define the properties for the text display. You can change the template by choosing Tools -> Set Template.

You can modify templates and create new ones with the Template Manager: choose Tools -> Template Manager. The ChangeMan Diff Template Manager is identical to the ChangeMan Edit Template Manager: see Saving a File on page 47 for details on how to configure templates.

Altering the Display Mode

Change the display mode by choosing options on the View menu:

This option... Does this...
Toolbars Lets you show or hide the toolbars.
Status Bar Lets you show or hide the status bar.
Split Lets you split the window using your mouse. The split can be altered by dragging the edge of the split. To remove the split, drag the edge out of the window.
Map Toggles the display of the map. The map is an micro-view of the file. Changes are marked in.
Compare Mode Displays a two window view of the comparison files.
Single Window Displays a one window view of a comparison file.
Merge Mode Displays the merge mode view.
Diff Output Displays changes in a text-based report form.
Auto Align Select this option to scroll the text panes in synchronization; deselect to scroll separately.

...

Changing Compare Options

Change the compare options to ignore items such as blank lines, extra spaces, and case by choosing ToolsOptions, or by clicking the appropriate button on the Diff Parameters tool bar.

Changing Text Background Colors

You can change the background colors displayed by the ChangeMan Diff utility by choosing ToolsOptions. The one exception is: identical lines have a white background and cannot be changed.

The default colors are as follows:

This category… Indicates… Default color…
Inserted lines Added lines. Yellow
Deleted Deleted lines. Red
Merged lines (Used in Merge Mode.) A line that is:
different in the two files being merged
merged without conflict
selected as final merge result Green
Virtual lines Placeholders. It means the other file contains a line here that this file doesn’t. Gray
Changed lines Changed lines. Blue
Inserted from common file Lines found in the common ancestor file. This appears only if each of the three files has a different change for a common line. Red
Inserted from 1st file New lines added from the first file. Yellow
Inserted from 2nd file New lines added from the second file. Green
Overlapped block Block of text that appears in both documents. Blue
Merge Unselected Deselected lines. Gray

...

Using Bookmarks

To add bookmarks to the file, see Bookmarks on page 38.

Redoing the Comparison

Redo the comparison by choosing File -> Compare.

Performing a Merge

You can perform a merge on the files being compared by choosing File -> Merge. You are prompted to select an ancestor (baseline) file. After choosing the ancestor file, the display changes to Merge Mode and you can now perform an interactive merge, described in Interactive Merge.

Merging Files

Using the ChangeMan Diff utility, you can merge the contents of two file versions with a baseline version and create a new merged version. You can merge any files that can be compared using ChangeMan Diff.

Initiating the Merge

If you are already within the ChangeMan Diff utility, choose File -> Merge. Skip the rest of this section and go to Interactive Merge .

Otherwise, you can initiate the Merge function in one of the following ways:

  • Select one or two files/components in the Explorer window, right-click and choose ZDD Network -> Merge Files from the popup menu.

    or

  • Select one or two files in the Staging Versions dialog box and click the Merge button

The Merge Files dialog box displays:

  • If you selected one file/component, its path name will display in the Base File text box.

  • If you selected two files/components, the path names will display in the Revision 1 and Revision 2 text boxes.

  • Output file contains the path name for the resulting merge file.

Enter the path names for all of the files. You can type in the text boxes or click the browse button to select files from the Explorer directory tree.

You can reconcile differences between the file versions either automatically or interactively:

  • Select Automatic merge to have changes between the versions applied based on default rules.

  • Deselect Automatic merge to perform an interactive merge and choose which changes are incorporated.

Automatic Merge

Note

You can only perform an automatic merge from the Merge Files dialog box.

The automatic merge reconciles the differences between two files according to a set of defined rules. A merged file is created automatically when there are no conflicting changes.

  • In the case of inserted lines, ChangeMan Diff accepts all inserted lines from both revised files.

  • In the case of deleted lines, ChangeMan Diff omits all deleted lines from both files.

  • A message is not returned on successful completion - you can check the results in the Output file.

If there are conflicting changes, such as an update to the same line, ChangeMan Diff displays in Merge mode, where you can do an interactive merge and choose the changes to apply (described in the following section).

Interactive Merge

The interactive merge lets you reconcile disparate changes in the two files by choosing added, deleted, or changed lines from the two versions. Once you have reconciled the differences and go to save the merged file, the file name will depend on the following:

  • If you initiated the merge from the Merge Files dialog box, the merged file is the file name you specified in Output file.

  • If you initiated the merge from within ChangeMan Diff (by choosing FileMerge), you specify the merged file name in the Save As dialog box.

When you initiate an interactive merge, the ChangeMan Diff utility displays the files in Merge mode. In the following example, the Base File is on top, Revision 1 and Revision 2 are in the middle, and the resulting merged Output File is on the bottom.

  • The Map on the left hand side gives a micro view of each file, with arrows indicating the current positioning of the file, and colors indicating positions of where differences occur. The different columns correspond to the different files: the left-most column is for the First File, the middle column is for the Second File, and the right column is for the Ancestor File. To display (or hide) the Map, choose View -> Show Map (or choose View -> Hide Map).

  • The text background is color coded to indicate which lines came from which file. Place your cursor in a file, and the Status Bar at the bottom will display the meaning of the colors for that file. To display (or hide) the Status Bar, choose View -> Show Status Bar (or choose View -> Hide Status Bar). See "Changing Text Background Colors for explanation of the different colors.

  • The other features of the display are the same as for the Compare function Comparing Files.

Interactive Merge Actions

The following actions are available during the interactive merge.

Step through the changes in a file by placing the cursor in the file, then clicking either Next Change or Previous Change.

Accepting/Rejecting Inserted Lines

For inserted lines, right-click on the line and the choose either Unselect Block (reject) or Select Block (accept).

Accepting/Rejecting Changed Lines

For changed lines, you can right-click and Accept Changes or Reject Changes, or you can choose the change from a particular file by choosing Accept from First File, Accept from Second File, or Accept from Common Ancestor.

Editing Merge File

You can edit any part of the merge file by placing your cursor in the line, then overtyping.

You can also cut code from File 1, File 2, or the Common Ancestor and paste it into the merge file.

Saving and Exiting the Merge

After you have completed the merge, save the merge file by either choosing File -> Save or clicking Save on the toolbar.

To exit and discard changes to the merged file, click the close button and reply No to the prompt.

Redoing the Merge

To discard changes and redo the merge file, choose either File -> Merge or Merge on the toolbar.

Performing a Compare

To perform a comparison of the files (and discard changes to the merge file), choose either File -> Compare or Compare on the toolbar, then change to the comparison view by choosing View -> Compare Mode.

See Comparing File for more information.

Back to top