Search code examples
ibm-midrangerpg

AS/400, iSeries, System i Objects - Number of ODT entries - what do they relate to in RPG source


In trying to find which RPG source file has been used to create an object, I'm looking to use object size, number of MI instructions and number of ODT (object definition table) entries to confirm which source file was used to create the object. There seems to be an opinion that the first two may vary with different versions of the compiler.

So wondered whether there is a correspondance between the particular type of statements in RPG source and the number of ODT entires.

I've googled extensively on this subject and not found any explanation that is comprehensible to the average application programmer about ODT entires. This article has a very detailed descrition of ODT but I'm finding it difficult to relate it to an RPG program and the number ODT entries.

This glossary defines ODT as a table built at compile time by the system to keep track of objects declared in the program. The program objects in the table include variables, constants, labels, operand lists and exception descriptions. The table resides in the compiled program object. So does this mean compiling an RPG source at different versions of the operating system would result in the number of ODT entries remaining same for each object created from the same source?


Solution

  • Object size, MI instructions, ODT could all change between compiler versions. Or even PTF application.

    There are two supported methods for tieing source to program object.

    The display program (DSPPGM) command:

    Type of program  . . . . . . . . . . . . . . . . :   OPM                
    Source file  . . . . . . . . . . . . . . . . . . :   QRPGSRC            
      Library  . . . . . . . . . . . . . . . . . . . :     OLSMLSRC         
    Source member  . . . . . . . . . . . . . . . . . :   OP510B             
    Source file change date/time . . . . . . . . . . :   08/07/05  08:45:11 
    

    Note for ILE RPG, DSPPGM provides a third screen that lists the modules used and you can 5=Display Description and see:

    Module . . . . . . . . . . . . . . . . . . . . :   OP021B            
      Library  . . . . . . . . . . . . . . . . . . :     QTEMP           
    Source file  . . . . . . . . . . . . . . . . . :   QRPGLESRC         
      Library  . . . . . . . . . . . . . . . . . . :     OLSMLSRC        
    Source member  . . . . . . . . . . . . . . . . :   OP021B            
    Module attribute . . . . . . . . . . . . . . . :   RPGLE             
    Module creation date/time  . . . . . . . . . . :   04/04/14  10:27:41
    Source file change date/time . . . . . . . . . :   03/25/14  14:08:49
    

    Commercial change control packages make use of the object control level attribute that can be set via API and viewed via API or DSPOBJD DETAIL(*SERVICE)

    Object . . . . . . . . . . . . . . . :   OP021B      
      Library  . . . . . . . . . . . . . :     OLSMLPRG  
    Library ASP device . . . . . . . . . :   *SYSBAS     
    Library ASP group  . . . . . . . . . :   *SYSBAS     
    Type . . . . . . . . . . . . . . . . :   *PGM        
    
    Object control level . . . . . . . . :   00N0001X    
    

    Note that for ILE programs/service programs. The object change control can be set for both the *PGM object and the module objects used. The module level object change control is available via DSPPGM with the module source info.