Could you use the LDA to set what company is open, and then open the
specific data area depending on that?

I seem to recall doing something similar at an old job... it was my
introduction to the LDA. :)

Bradley V. Stone
MAILTOOL Benefit #6 <>: Easily send
group emails with Distribution Lists

On Fri, Feb 8, 2019 at 8:18 AM Jerry Adams <midrange@xxxxxxxx> wrote:

The discussion the other day on data structures brought to mind a problem
that I have been working on regarding data areas. I used a data area to
function as a sort of "truth table" for our company. O read it into a
program to determine if the next (or following) step is ready.

Works fine, but the owner decided that he wants to add a new company.
will be, I am sure, some new programs for it, but the basic back office
processing is pretty much the same. So I am modifying the programs to
access the file depending upon the company. That's relatively easy.

The issue with the data area on disk is that I have not been able to find a
way in the manuals (that I understood, anyway) to access different data
areas. For example, a disk file can have a EXTFILE(some-name) with USROPN
that I then use to define that "some-name" before I open the file. I
find anything similar for data areas on disk.

I could, I know, just define two data areas in the program(s) and then use
the same method I'm using for files to determine which data area to read.
But looking ahead, I wanted to make it flexible so that the next time he
sets up a new company, I will not have to go back into the program. I
could, for example, easily change it to a data file. But wondered if there
were any minimal coding changes that would accomplish the same effect.

Any ideas/thoughts welcomed.


Jerry C. Adams

Do what is right because it is right, and leave it alone. -Chiune Sugihara

IBM i Programmer/Analyst




This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives

Please contact support@xxxxxxxxxxxx for any subscription related

Help support by shopping at with our affiliate

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.