Problem solve Get help with specific problems with your technologies, process and projects.

Application data areas can simplify programs and speed up processing

In most business systems, we find a core set of control files that are used by program after program. That is because these files hold information that many programs need in order to process. Consequently, these systems typically do a lot of redundant work to repeatedly retrieve this same set of information.

To avoid all of this unnecessary work, I create a large data area in QTEMP library for each user who signs on, and I preload it with useful constant information that any program can access simply by reading the data area. This tends to keep programs smaller and simpler because they are reading far fewer files, and it improves system response time because each program is doing less work to accomplish the same result.

Some of the kinds of information I have found useful to hold in this data area include the following:

* Information about the application (Accounts Receivable, Accounts Payable, Inventory, etc.) such as the application name and the current year and period number.

* Information about the company or branch, such as the branch name, the number of fiscal periods and the first fiscal period number.

* Information about the user, such as the user name and employee number. I also carry general information about the user's authority to the application.

* For accounts receivable, I carry aging information, including the number of days per aging period.

* For fields that might be used as a screen or report heading, such as the company name, I include two version of the field -- one left-justified and one centered -- to make it as easy as possible to display or print whichever version is needed.

For best results, use an externally defined data area. That means setting up DDS and creating an empty physical file (I use APPLDS as the file name and APPL as the data area name). When you design this DDS source, avoid using unpacked fields. That way you can easily retrieve data from the data area for use in a CL program.

The concept of an application data area will allow you to simplify your programs, speed up processing and provide a wealth of information to any program that needs it -- all available with a single data-area read operation.

About the author: Laird Scranton owns Concise Systems in Albany, N.Y. He has 25 years' experience as an RPG programmer, data processing manager and software consultant for IBM AS/400 and System/3x computers, writing custom software and supporting business software packages for more than 250 companies of all sizes in New York and New England.


Dig Deeper on RPG iSeries programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close