IBM i

IBM i 

A space for professionals working with IBM’s integrated OS for Power systems to exchange ideas, ask questions, and share expertise on topics like RPG and COBOL development, application modernization, open source integration, system administration, and business continuity.


#Power


#IBMi
#Power
 View Only

Create Powerful Developer Tools on IBM i: Static Code Analyzer, Code Modifier, and Impact Analyzer

By Pavan Thute posted Tue November 11, 2025 07:51 AM

  

A blue screen with white text

AI-generated content may be incorrect.

This blog will guide you through scanning a source physical file and explain the potential advantages of performing this scan.

A screenshot of a computer screen

AI-generated content may be incorrect.

Here are some tools you can build using the scan technique:

A screenshot of a computer

AI-generated content may be incorrect.

A library can contain multiple source files, and each source file may include several members, as shown below:

A screenshot of a computer

AI-generated content may be incorrect.

IBM provides Catalog files that contain metadata about system objects, such as their names, types, creation dates, and other attributes. These files help in managing and querying object information efficiently. Some Catalog file are as below:

A screenshot of a computer program

AI-generated content may be incorrect.

Lets start, on how to perform scan step by step:

Retrieve all member names from the source physical file and store them in a temporary database in QTEMP.

A screenshot of a computer

AI-generated content may be incorrect.

To do this use below query:

A screen shot of a computer

AI-generated content may be incorrect.

Next step is to read this file and process each record:

A screenshot of a computer program

AI-generated content may be incorrect.

How to process each record:

-            Read 1st record from file which is o/p of step 1 and create alias on record 1 (i.e. member1).

-            By leveraging an alias, the complete source code of the member will be copied into a temporary table

-            Now that the entire source of Member 1 is available in the file, we can read each record and perform operations as needed.

A screen shot of a computer

AI-generated content may be incorrect.

A screenshot of a computer

AI-generated content may be incorrect.

Sample queries which can be run on member is given below:

A screenshot of a computer

AI-generated content may be incorrect.

All this can be achieved by using REGEX as shown below:

A blue screen with white text

AI-generated content may be incorrect.

It’s up to the developer how to use this technique. You can build tools like a static code analyser, a code modifier, or even an impact analysis tool.

Happy Coding…

0 comments
17 views

Permalink