Topic
  • 3 replies
  • Latest Post - ‏2012-11-12T08:34:20Z by SystemAdmin
SystemAdmin
SystemAdmin
849 Posts

Pinned topic DMH_COMPILE_UNIT table - COMP_UNIT_ID versus MEMBER_ID

‏2012-11-09T12:35:50Z |
When trying to write a custom query that involves DMH_COMPILE_UNIT, we came up this question:

DMH_COMPILE_UNIT table has 2 different columns - (1) COMP_UNIT_ID (2) MEMBER_ID

Statement A:
Based on RAA online help, here is what I understand:
COMP_UNIT_ID is supposed to be a unique id for each compile unit; while MEMBER_ID would be the foriegn key reference to FILE_ID of DMH_FILE table.

Statement B:
After scanning inventory, I observe that, both COMP_UNIT_ID and MEMBER_ID are same for all components being scanned so far.

Question 1. Why do we have 2 seperate columns - when they seem to have the same value? (I'm guessing, these will differ in future versions, when RAA allows a single file to have multiple compilation units, is this correct?)
Question 2. In v 6.0.0.0, can these columns be used interchangeably in custom queries (in join \ where clauses)?
Updated on 2012-11-12T08:34:20Z at 2012-11-12T08:34:20Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    849 Posts

    Re: DMH_COMPILE_UNIT table - COMP_UNIT_ID versus MEMBER_ID

    ‏2012-11-09T14:32:00Z  
    COMP_UNIT_ID name of the main CSECT
    MEMBER_ID name of the library member containing the compiling unit_id

    When you create an executable you can name it different than the member id.
    For example in COBOL I have source file in member name MEMFIL and I code in
    PROGRAM-ID. PROGNAM.

    I understand that member_id will be MEMFIL and COMP_UNIT_ID will be PROGNAM
  • jcdelmo
    jcdelmo
    345 Posts

    Re: DMH_COMPILE_UNIT table - COMP_UNIT_ID versus MEMBER_ID

    ‏2012-11-09T15:46:46Z  
    The PROGRAM (compile unit) assets primary key is COMP_UNIT_ID in the DMH_COMPILE_UNIT table. The FILE (member) assets primary key is FILE_ID in the DMH_FILE table. Prior to RAA v6, the FILE_ID column was named MEMBER_ID - explaining why some of the tables use FILE_ID and some (still) use MEMBER_ID.

    The MEMBER_ID column in the DMH_COMPILE_UNIT table is (obviously) a foreign key to the DMH_FILE table - representing the program's main file.

    The intent, as you suspect, is to eventually support multiple compile units per file.

    Currently the value of the two ids are the same.

    Because they are the same one could use them interchangeably, but I would strongly discourage doing that as your custom queries may not work as expected any future release that supports multiple compile units per file.
  • SystemAdmin
    SystemAdmin
    849 Posts

    Re: DMH_COMPILE_UNIT table - COMP_UNIT_ID versus MEMBER_ID

    ‏2012-11-12T08:34:20Z  
    • jcdelmo
    • ‏2012-11-09T15:46:46Z
    The PROGRAM (compile unit) assets primary key is COMP_UNIT_ID in the DMH_COMPILE_UNIT table. The FILE (member) assets primary key is FILE_ID in the DMH_FILE table. Prior to RAA v6, the FILE_ID column was named MEMBER_ID - explaining why some of the tables use FILE_ID and some (still) use MEMBER_ID.

    The MEMBER_ID column in the DMH_COMPILE_UNIT table is (obviously) a foreign key to the DMH_FILE table - representing the program's main file.

    The intent, as you suspect, is to eventually support multiple compile units per file.

    Currently the value of the two ids are the same.

    Because they are the same one could use them interchangeably, but I would strongly discourage doing that as your custom queries may not work as expected any future release that supports multiple compile units per file.
    Thank you, jcdelmo & RAFA. That was informative.