Compare and Merge Utilities: Track Differences & Reconcile
Comparing datasets and members to track differences is essential for version control, change management, and code reconciliation. ISPF provides powerful compare and merge utilities, primarily SuperC, that allow you to compare two datasets or members, view differences, and merge changes. Understanding compare and merge utilities helps you manage code versions and reconcile differences effectively. This tutorial covers SuperC compare utility, viewing differences, merge techniques, and best practices.
Compare utilities identify what changed between versions, making it easier to understand modifications, track changes, and reconcile differences. Merge utilities help you combine changes from different sources, resolve conflicts, and create reconciled versions. This tutorial provides practical guidance for comparing and merging datasets effectively.
Understanding Compare Utilities
Compare utilities identify differences between datasets or members.
What are Compare Utilities?
Compare utilities are tools that:
Compare two datasets or members line-by-line
Identify matching and non-matching lines
Display differences in various formats
Highlight changes, additions, and deletions
Provide merge capabilities
SuperC Utility
SuperC is ISPF's primary compare utility (Option 3.13):
Unified Format: Single view with change indicators
Context Format: Differences with surrounding context
Difference Indicators
SuperC uses indicators to show differences:
Matching Lines: Lines that are identical
Changed Lines: Lines that differ
Added Lines: Lines only in second dataset
Deleted Lines: Lines only in first dataset
Navigating Differences
To navigate through differences:
Use scroll commands to move through differences
Jump to next or previous difference
View specific line ranges
Search within differences
Comparison Options
SuperC provides various options for customization.
Case Sensitivity
Case sensitivity options:
Case-Sensitive: Distinguishes uppercase and lowercase
Case-Insensitive: Ignores case differences
Use case-insensitive for code comparisons
Use case-sensitive for data comparisons
Whitespace Handling
Whitespace options:
Ignore leading/trailing whitespace
Ignore all whitespace differences
Preserve whitespace exactly
Useful for code formatting comparisons
Context Lines
Context options:
Show lines around differences
Set number of context lines
Helps understand change context
Makes differences easier to understand
Merge Utilities
Merge utilities help reconcile differences.
What is Merging?
Merging combines changes from two sources:
Selectively applies changes
Resolves conflicts between versions
Creates reconciled version
Preserves desired changes from both sources
Merge Process
The merge process involves:
Comparing the two sources
Reviewing differences
Deciding which changes to keep
Applying selected changes
Saving reconciled version
Merge Options
Merge options include:
Keep lines from first dataset
Keep lines from second dataset
Keep both sets of lines
Manually edit merged result
Apply merge selectively
Reconciling Differences
Reconciling differences requires careful review and decision-making.
Reviewing Differences
To reconcile differences:
Review all differences carefully
Understand the context of each change
Identify which changes to keep
Consider impact of each change
Make informed decisions
Applying Changes
To apply changes:
Use merge commands to apply changes
Select lines to keep from each source
Resolve conflicts manually if needed
Verify merged result
Save reconciled version
Conflict Resolution
When conflicts occur:
Identify conflicting changes
Understand both versions
Decide on resolution approach
Apply resolution
Verify resolution is correct
Tracking Differences Over Time
Tracking differences helps manage versions and changes.
Version Comparison
To track differences over time:
Regularly compare current with previous versions
Document significant changes
Maintain version history
Use consistent naming for versions
Keep backup copies
Change Documentation
Document changes by:
Recording what changed
Noting why changes were made
Tracking change dates
Maintaining change logs
Linking changes to requirements
Common Comparison Scenarios
Common scenarios for using compare utilities.
Comparing Code Versions
To compare code versions:
Compare current version with previous
Identify what changed
Review changes for correctness
Understand impact of changes
Document modifications
Comparing Libraries
To compare libraries:
Compare corresponding members
Identify library differences
Find missing or extra members
Verify library synchronization
Merging Changes
To merge changes:
Compare source and target
Review differences
Apply desired changes
Resolve conflicts
Verify merged result
Best Practices
Following best practices improves comparison and merge effectiveness:
Compare Regularly: Compare versions regularly to track changes
Review Carefully: Review all differences before merging
Understand Context: Understand the context of changes
Test Merged Results: Test merged results before using
Document Changes: Document significant changes
Use Appropriate Options: Set comparison options appropriately
Backup Before Merging: Backup datasets before merging
Verify Results: Always verify merged results
Explain Like I'm 5: Compare and Merge
Think of compare and merge like comparing two drawings:
Comparing is like putting two drawings side-by-side to see what's different. You look at both drawings and notice what changed - maybe a line was added, a color was changed, or something was erased. It's like having two versions of a drawing and seeing exactly what's different between them!
Differences are like the changes you notice between the drawings. Some parts are the same (matching), some parts are different (changed), some things were added to one drawing, and some things were removed. It's like marking all the differences with a highlighter!
Merging is like creating a new drawing that combines the best parts of both drawings. You decide which parts to keep from each drawing and put them together into one new drawing. It's like taking your favorite parts from both drawings and making a new, combined drawing!
Reconciling is like making sure the combined drawing makes sense. You check that all the parts fit together correctly, that there are no conflicts (like two different colors in the same spot), and that the final drawing looks good. It's like making sure your combined drawing is perfect!
So compare and merge is like comparing two drawings to see what's different, then creating a new drawing that combines the best parts of both!
Practice Exercises
Complete these exercises to reinforce your compare and merge skills:
Exercise 1: Basic Comparison
Practice basics: compare two test datasets using SuperC, understand difference display, navigate differences, and learn basic comparison. Master basic comparison.
Exercise 2: Compare PDS Members
Practice PDS: compare PDS members, understand member comparison, review differences, and learn PDS comparison. Master PDS member comparison.
Exercise 3: Use Comparison Options
Practice options: use different comparison options, understand option effects, test case sensitivity, and learn option usage. Master comparison options.
Exercise 4: Basic Merge
Practice merge: perform basic merge operation, apply changes selectively, understand merge process, and learn merging. Master basic merging.
Exercise 5: Reconcile Differences
Practice reconcile: reconcile differences between datasets, resolve conflicts, verify reconciled result, and learn reconciliation. Master reconciliation.