Introduction:
For a specific model and Action Block I would like to create a report to list all Load Modules where that Action Block is used.
Instructions:
The first step is to find where the Action Block is used working from bottom up i.e. where used in other (Common) Action Blocks or Procedure Step (PStep) Action Blocks. Once you get up to the Pstep level you can then find the module that contains that PStep.
In the Gen 8.5 Client-Server Encyclopedia Public Interfaces Guide section Public Interface View Definitions (A-D) there are several Action Block related views including ACTN_BLK_USE (Action Block Usage). It can be used in conjunction with other views to provide the required information
To assist in writing SQL the following information can be obtained from the file odrpta.chm (directory "%GEN85%\Gen"), which contains the meta-model information.
Executable Unit (EXECUNIT) object types are:
BATCHJS (batch) - type 121
OLTRAN (online & server) - type 122
WNUNIT (window) - type 307
In each of the above the following associations exist. (associations are always stored in the forward direction so you always need to use that in the SQL)
< - means backward association
> - means forward association
Here is OLTRAN for an example:
OLTRAN < REFS (249) PSTEPEU
PSTEPEU > OLTRAN < REFS (249) PSTEPEU
PSTEPEU < USEDID (285) BUSPRST
BUSPRST > DEFNDBY (53) ACBLKBSD
(ACBLKBSD is the Action Block BSD object)
Therefore with the above you can work out what module contains a PStep action block.
(The MBRNAME property of the OLTRAN will give you the module name - this is column NAME08_PROP_1 in the DNAME table)
Examples:
The following SQL will retrieve load modules that contain a specific PStep or a BSD/BAA action block that is used by a PStep action block.
If you need the capability to do the same for action blocks called by other CABs then use of the PI query mentioned above would be required.
======================================================================
Online/server load modules which contain a PSTEP:
select name08_prop_1 from dname where name_obj_id in
(select obj_id from dobj where obj_type_code=122 and obj_id in
(select assoc_to_obj_id from dasc where assoc_type_code=245
and assoc_from_obj_id in
(select obj_id from dobj where obj_type_code=10 and
obj_id in
(select assoc_to_obj_id from dasc where assoc_type_code=290
and assoc_from_obj_id in
(select obj_id from dobj where obj_type_code=60 and obj_name=
'PSTEP' and obj_model_ID='MODEL_ID')
))));
======================================================================
Online/server load modules which contain a BSD/BAA action block being used directly by a PSTEP:
select name08_prop_1 from dname where name_obj_id in
(select obj_id from dobj where obj_type_code=122 and obj_id in
(select assoc_to_obj_id from dasc where assoc_type_code=245
and assoc_from_obj_id in
(select obj_id from dobj where obj_type_code=10 and
obj_id in
(select assoc_to_obj_id from dasc where assoc_type_code=290
and assoc_from_obj_id in
(select obj_id from dobj where obj_type_code=60 and obj_id in
(select assoc_from_obj_id from dasc where assoc_type_code=53 and
assoc_to_obj_id in
(select obj_id from dobj where
(obj_type_code=21 or obj_type_code=23) and obj_id in
(select assoc_from_obj_id from dasc where assoc_type_code=36 and
assoc_to_obj_id in
(select obj_id from dobj where obj_type_code=3 and obj_id in
(select assoc_to_obj_id from dasc where assoc_type_code=245 and
assoc_from_obj_id in
(select obj_id from dobj where obj_name=
'ACTION_BLOCK' and obj_model_ID='MODEL_ID')
))))))))));