MAINFRAME > Tips & Techniques > Systems Management

Creating a ‘Roll-Your-Own’ Program Inventory

Creating a ‘Roll-Your-Own’ Program Inventory

Editor’s note: This is the first of two articles on creating a roll-your-own program inventory.

Do you use a source code management product, but have, at best, only estimates of how many programs are in your system or what the proportional mix of languages are? Would you like to know which of them are online versus batch? Do you want to know which programs are used heavily, only occasionally, or not at all? The solution to answering such questions might be easier than you think.

All you need is a spreadsheet program, the simple report-generation tools of many source code manager products, and utilities provided by CICS, IMS, resource measurement facility (RMF) and the like. With these, you can create a useful roll-your-own program inventory without buying yet another product.

By taking the simple output from a source code manager, downloading and massaging it with a spreadsheet product, like Excel, and expanding it by processing SYSPRINT output from other sources—a useful, flexible and valuable reporting tool can be created with modest effort. Producing the initial report is straightforward, but more advanced reporting will entail more effort. You can determine how much effort is justified and tailor the inventory accordingly.

Creating the Initial Report

Most, if not all, source code manager products have some basic reporting. After researching the reporting, determine what input parameters are needed and code them. Then run and revise the tool until achieving the desired output. SYSPRINT output can be directed to a data set rather than a printer. The file characteristics should be for print (i.e. LRECL=133), in either a sequential file or partitioned data set.

Once the file is created, some addition massaging of the data might be desirable. You might want to sort the data, eliminate duplicates (a sort with a SORT and a SUM control statement), etc. The SORT SUM job (or job step) is particularly useful if you use suffixing as your versioning technique. For example, a program might have a base name of PROG01, with the seventh digit signifying the language (e.g. C=COBOL, P=PLI, A=Assembler, R=program generator, B= Copy Book, M=CICS Map, and so forth), and the last digit signifying the program version (A=version 1, B=version 2, etc.). In this case, it’s usually not desirable to include all program versions in the inventory, because normally only the most recent program version is in use. Previous versions are kept for archival purposes. A duplicate-eliminating job or step includes sort statements such as:

SORT FIELDS=(1,7,CH,A,33,2,Y2S,D,27,2,CH,D,30,2,CH,D),EQUALS

In this case, the program name starts in position 1, for the first seven characters. The additional fields are shown as an illustration that it’s often useful to sort the initial file by more than one field—for example, by program name, language, subsystem (CICS, IMS, batch, etc., assuming this is stored in the source code manager).

Creating a Simple Spreadsheet Program Inventory

At this point, it’s possible to download the data into a spreadsheet and create a simple program inventory. First, the file must be downloaded to a PC as a text file. If the file is a flat, fixed-length file, it can be downloaded by an FTP product, a TELNET product with FTP, or myriad tools capable of downloading files to a PC.

Once downloaded, bring up an Excel window (or other spreadsheet). Click on the “Data” tab on the toolbar at the top of the window, and click on “Get External Data” within the pop-up. Next, click on the “From Text” icon, causing an “Import Text” window to appear. From there, select the drive, folder and subfolders where the text file was downloaded; then double click on the text file.

Once the file has been opened, a “Text Import Wizard—Step 1 of 3” pop-up window appears. Verify that:

  • The Fixed_Width radio button is selected.
  • The Start Import Row is at 1 (unless you’ve a reason to start elsewhere).
  • The File Origin is set correctly (typically 437: OEM United States).
  • The data in the Preview of file … etc. ... box looks correct.

Then click on “Next” at the bottom of the pop-up. This should bring up the “Text Import Wizard – Step 2 of 3” window.

This second window is where break lines—in effect, column separators—can be set to delineate where one field/column ends and another begins. Usually some break lines will already be set where a field ends. However, in some cases (i.e. contiguous columns of spaces or continuous text), they might have to be inserted manually. When all columns have been marked, click on “Next” at the bottom of the pop-up, which brings up “Text Import Wizard—Step 3 of 3.”

At this point, unwanted columns can be removed. In many cases, with source code managers, the reports that are built into the product are canned, and don’t provide for much customization. That’s why this window is a good place to remove columns. Do so by clicking on a column heading, highlighting said column, and select the “Do not import column (skip)” radio button in the “Column data format” box. The column will be marked as a skip column, and will not be imported into the spreadsheet. In addition, data formats in this box can be set for columns that are to be kept. The default is general, but text columns should have the “Text” radio button turned on, and date columns should be set to the correct format with the “Date:” radio button on.

Once the import settings have been made in the three pop-up windows, it’s time to import the program inventory file into the spreadsheet. This is accomplished by clicking on the “Finish” box in the third pop-up. This will bring up an “Import Data” window, where the starting column and row in which the data is to be placed can be specified. When this is complete, click “OK.” The data will then be loaded into the spreadsheet.

Now What?

At this point, you can add headings, sort or rearrange columns, and modify the program inventory. Yet we’ve only hardly scratched the surface. You can add such elements as missing or unsupported subsystems, programs not stored in the source code manager or in a different source code manager (such as report generators), and usage or performance information. This is the where the value of a program inventory is greatly increased, and it will be the subject of Part 2 of this article. But to do this, a program inventory repository file must be created.

Jim Schesvold is a technical editor for IBM Systems Magazine. Jim can be reached at

comments powered by Disqus



2019 Solutions Edition

A Comprehensive Online Buyer's Guide to Solutions, Services and Education.

Optimal Service Delivery

Overcome eight key challenges and reduce costs


An Accurate Benchmark Is Important

Advice for the Lazy Administrator

Steps you can take to avoid late nights and system frights.

IBM Systems Magazine Subscribe Box Read Now Link Subscribe Now Link iPad App Google Play Store
Mainframe News Sign Up Today! Past News Letters