CMPOBJ – Compare Objects

Command

The CMPLIB (Compare Objects) tool compares objects from anywhere on the system to find differences in the object definition, or embedded modules or source version it was compiled from: 

CMPOBJ OBJ(*ALL/PGM_NAME) TYPE(*ALL)            

This will show all the objects that match your selection – then create a SHAH1 hash value based on

  • object name
  • object description
  • source change date
  • and embedded modules if an ILE object

For example, Here is a real world example where we want to see every occurrence of a program called pgm(ATLIMPRT) and compare the differences in any library system-wide:

CMPOBJ OBJ(*ALLUSR/ATLIMPRT) TYPE(*PGM)

We can see the different hash values on the right hand column clearly showing the which programs are identical and which have differences.