Impact analysis for IMS databases

When changes are made to an IMS database such as changing segment lengths, key changes, field changes, or EXIT parameter changes, it is important to drop and recreate the tables and views that reference the database to ensure that the metadata catalog definitions match the current DBDLIB information.

You can run the following union query to get a list of IMS tables and views that can be affected by changes that are made to a specific database. In this example, the database name is DBDBD1:

    (SELECT T.CREATOR AS "TABLE_CREATOR",
            T.NAME AS "TABLE_NAME", 
            T.TYPE,
            'NULL' AS "VIEW_CREATOR",
            'NULL' AS "VIEW_NAME", 
            T.DBD_NAME, 
            T.STANDARD_PSB AS "PSB_NAME",
            T.KEY_FIELD_NAME,
            T.KEY_OFFSET,
            T.KEY_LENGTH,
            T.SEGM_LEVEL,  
            T.SEGM_NAME, 
            T.SEGM_LENGTH
        FROM SYSCAC.SYSIMSSEGMENTS T
        WHERE T.DBD_NAME = 'DBDDB1') 
     UNION 
     (SELECT V.BCREATOR AS "TABLE_CREATOR",
             V.BNAME AS "TABLE_NAME",   
             'V' AS "TYPE", 
             V.DCREATOR AS "VIEW_CREATOR",
             V.DNAME AS "VIEW_NAME",
             T.DBD_NAME, 
             T.STANDARD_PSB AS "PSB_NAME",
             T.KEY_FIELD_NAME,
             T.KEY_OFFSET,
             T.KEY_LENGTH,             
             T.SEGM_LEVEL, 
             T.SEGM_NAME, 
             T.SEGM_LENGTH 
        FROM SYSCAC.SYSIMSSEGMENTS T, SYSIBM.SYSVIEWDEP V 
          WHERE 
             (T.DBD_NAME = 'DBDDB1') AND
             (T.NAME = V.BNAME) AND (T.CREATOR = V.BCREATOR)
          )
          ORDER BY 6,1,2;

You can run the query from CDA or by using the USERSAMP(CACCLNT) sample job.

Example output:

Example output from USERSAMP(CACCLNT) sample job

In this example output:

  • The USER1.IMSDB1 table has one segment, SEG1, and is reference by two separate views: USER1.V_IMSDB1 and USER1.V_IMSDB_1_AND_2.
  • The USER1.IMSDB1_2SEG table has two segments, SEG1 and SEG2, and is reference by one view: USER1.V_IMSDB_2SEG.