Create report to list all Load Modules where Action Block is used
search cancel

Create report to list all Load Modules where Action Block is used

book

Article ID: 31777

calendar_today

Updated On:

Products

Gen Gen - Workstation Toolset

Issue/Introduction

For a specific Gen model and Action Block would like to create a report to list all Load Modules where that Action Block is used.
Using Client Server Encyclopedia.

Environment

Gen Client Server Encyclopedia.

Resolution

Table of Contents


Reports

There are some existing reports that can be run to determine where an Action Block is used i.e.

  • "Model Action Block Use Report" and then search on the Action Block name
  • "Object Cross Reference Report" with Report Type of “Referenced” & required Action Block selected to find all the places where it is referenced (used). 

For further details please: Use the Client Server Encyclopedia > Encyclopedia Reports

 

SQL

There are other possible alternatives using SQL against the Encyclopedia Public Interface or directly against the raw data tables and the following information is intended to provide initial guidance for the experienced Gen Encyclopedia administrator (NOTE: in these examples the Client Server Encyclopedia/CSE will be used).
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. After reaching the Pstep level can then find the module that contains that PStep.

Public Interface:
In the Gen 8.6 documentation Client Server Encyclopedia Public Interface > Public Interface View Definitions (A-D) section 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.

Direct SQL:
To assist in writing SQL the following information can be obtained from the file odrpta.chm (directory "%Gen86%\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 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 it is possible to work out what module contains a PStep action block
(The MBRNAME property of the OLTRAN will give 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 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')
))))))))));
======================================================================

 

Generated code

Finally, a simpler option not using SQL to get the information required is to search the existing generated ICM files for the action block name/member name.