What is digital reinvention? Warren Tomlin, IBM Vice President, discusses real digital reinvention, the kind of change that will drive companies forward to competitive advantage, requires business leaders to combine siloed innovation.
Real digital reinvention, the kind of change that will drive companies forward to competitive advantage, requires business leaders to combine siloed innovation. Warren Tomlin, IBM Vice President, discusses how digital reinvention requires the integration of everything together: analytics and mobile,…
Customers don’t just want personal experiences—they want contextual experiences. Avanlee Okragly, VP of SimpleC, and Rob High, CTO of Watson are using cognitive to create new customer experiences. Learn more: http://bit.ly/2q29RaE
Cloud gave birth to new business models that are changing the way we work. Collaboration and accessibility are bringing new business values to CEOs like Amy Gross (VineSleuth) and Rodrigo Garcia de la Cruz (Finnovating). Learn more: http://bit.ly/2nXiOS1
By the year 2020, there will be more than 50 billion IoT devices. Matt Candy, VP & UKI/European Leader at IBM iX, and Saul Berman, Partner/VP/Chief Strategist of IBM GBS, help us prepare for the challenges and opportunities. Learn more:…
How is cognitive changing the way we create? We brought together the top thought-leaders in tech for a cognitive-created dinner to find out. From a CTO to an entrepreneur to a healthcare VP to a Michelin-star chef, see all the…
We're at the beginning of a revolution with cognitive, and it's transforming the way healthcare companies work with patients, families and providers. Doug Nelson, Chief Technology Officer of SimpleC, explains why it's so important to adopt this technology sooner rather…
Cognitive computing is a revolutionary technology transforming how companies do business and, ultimately, serve their customers. Doug Nelson, Chief Technology Officer of SimpleC, explains how to get in front of this revolution. Learn more: http://bit.ly/2qaOVOX
Fill the gap between modules and ILE programs for a full panorama of your ILE application.
Part I and Part II of this series have shown how some system commands can be used to dissect in depth one application, without the source code. But these analyses suffer from a lack of information for ILE programs—namely, the link between the program and embedded modules.
Indeed, for OPM programs, the command DSPOBJD provides a direct link between the program and source code. This is possible because the compiler goes directly from the source code to the program without going through an object module. Conversely, for ILE programs, DSPOBJD does not give such information. It cannot: ILE programs can be composed of several modules.
Although each module knows the name of its source code (and DSPOBJD knows how to find that), the link between a program and the list of modules is inaccessible: the command DSPPGM does not offer OUTPUT(*FILE).
This third article shows first the command RTVPGM, based on the six APIs shown below. This command and these APIs provide an OUTPUT(*FILE) equivalent to the output screens of DSPMOD, DSPPGM, and DSPSRVPGM. These OUTFILE outputs are a one-to-one relationship for most of the formats of these APIs.
Retrieve Module Information (QBNRMODI) API
Retrieve Program Information (QCLRPGMI) API
Retrieve Service Program Information (QBNRSPGM) API
List Module Information (QBNLMODI) API
List ILE Program Information (QBNLPGMI) API
List Service Program Information (QBNLSPGM) API
This article then shows the scripts used to extract information from these files.
The command RTVPGM explores objects of type * MODULE, * PGM, and * SRVPGM. It produces 16 files:
Three describe the basic information modules, programs, and service programs:
MODI0100—Basic module information
PGMI0100—Basic program information
SPGI0100—Basic service program information
Five to describe the attachment of modules:
MODL0100—Module export (*EXPORT) information
MODL0200—Module import (*IMPORT) information
MODL0300—Module procedures (*PROCLIST) information
MODL0400—Referenced system objects (*REFSYSOBJ) information
MODL0500—Module copyright (*COPYRIGHT) information
Five describe programs and service programs' attachments:
PGML0100—ILE program module (*MODULE) information
PGML0200—ILE service program (*SRVPGM) information
PGML0300—Data items exported to the activation group (*ACTGRPEXP)
PGML0400—Data item imports resolved by weak exports that were exported to the activation group (*ACTGRPIMP)
PGML0500—ILE program copyright (*COPYRIGHT) information
Three describe specific service programs' attachments:
SPGL0600—Procedure export information
SPGL0700—Data export information
Figures 1 through 3 show the three screens of the RTVPGM command.
Figure 1: In RTVPGM page 1, choose the objects to analyze and the names for module information files.
Figure 2: In RTVPGM page 2, choose the name for the program information files.
Figure 3: In RTVPGM page 3, choose the name for the service program information files.
These files by themselves are very interesting cross-references. For example, when a program crashes because of a service program (yes, it happens, especially in development), we can easily find out which procedure sent the error message (it's in F9 of the message), but how do we determine the name of the module that hosts this procedure? Is it the only one? MODL0300 provides the answer.
But back to the goal of this article: analyzing the structure of an ILE application. The difference is that here, with an ILE application, we must include the fact that a program consists of one or more modules and these modules have source code.
First, you will find below rewritten SQL to match some SQL from the previous article. I've done this because the previous SQL was prepared for a program, where source code name and module name are the same.
For an ILE program, there is no method to determine the list of modules within a program because DSPPGM does not have an OUTPUT(*OUTFILE). The modified SQL uses the OUTFILEs generated by RTVPGM to determine the list of the modules of any ILE program, irrespective of the number of modules. Depending on whether or not the *MODULE objects are available, we use either file MODI0100 or PGML0100. Finally, you will find SQL that gets the two or three pieces of information that were missing
Modules by Type and Year
This statistic concerns the counting of objects by type and year of source update:
end cpldate , modattr , text FROM jpltools.modi0100
, src as (
SELECT MLNAME, case when MLCHGc = '' then ' ' else trim(char(
MLCHGC+ 19)) concat MLCHGD concat MLCHGt end Upddate,MLMTXT FROM
jpltools.mbrlist WHERE MLCHGc <> ''
) select src "Object", srcmbr "Src Mbr",
cpldate concat case when upddate = cpldate then '' else ' was
updated ' concat upddate end "Compiled_date"
, case when mlmtxt = text then ' ' concat text else '>> '
concat text concat ' changed to ' concat mlmtxt end "Text"
from obj join src on srcmbr = mlname and (cpldate <> upddate
or text <> mlmtxt)
Figure 19: These sources were modified but not recompiled.
I changed my machine; we see the traces dated 2010-11-12-20:41:42.
These are based on DSPPGMREF output; that is to say on objects themselves, not on the source. Therefore, there is nothing to add to DSPPGMREF from the 16 files of RTVPGM. These analyses, exposed in the second article, are already accurate. They are not replicated here.
ILE Cross-references are focused on module, procedure, program, and service program information received from RTVPGM outfiles. Their goal is to complete the data got from DSPPGMREF. Here, you will find a starter: the two SQLs needed to get the missing information quoted in previous articles:
Program by Activation Group:
select activation_group_attribute, count(*) count from jpltools.pgmi0100 group by activation_group_attribute
Figure 20: Get information about programs by activation group.
Monitor the Rights Acquisition:
select USER_profile_option, use_adopted_authority, count(*) count from jpltools.pgmi0100 group by USER_profile_option, use_adopted_authority
Figure 21: Monitor rights acquisition.
None of the programs in this application uses the owner authority. I don't need to further analyze which program runs under owner profile authority and check whether this is compliant with my policy rules. But if you need that information, you may want to quickly run an analysis:
SELECT program_name, program_library_name, program_owner FROM
jpltools.pgmi0100 WHERE USER_profile_option <>'U'
I'll stop here; there is so much information in these files! Depending on your own interests, you can now easily understand how your software is built. Now, it's up to you.
Jean-Paul Lamontre has been working on IBM machines since 1976. His first was a 3/15 with 128K RAM (the biggest machine of the county). His first program was an RPG program, no more than 15 lines. It never compiled, and nobody ever understood why.
Currently, Jean-Paul divides has work time between two companies.
For Resolution, which offers Xcase, a database engineering suite, he is the CTO of the IBM i department. Xcase allows developers to modernize a DDS database to DDL, discover and implement implicit relationships, and manage SQL databases using an advanced GUI.
Jean-Paul also publishes some free tools on his personal Web site. Most popular are SQL2XLS, SPLF2PDF, and MAIL.