× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



We were in the same situation several years ago (over 20).

We switch to a model where we use the library list and all files/data area have the same name regardless of the company. Works like a charm. We had to do this when the number of company got so high that we could not create distinct names (A.xxx, B.xxx all the way to Z.xxx. We even used some special caracters).

I would strongly recommend switching to this method. It has several advantages:
- All object for a company are grouped together
- Easier if you want to do things like backup at different time depending on the company
- When a new company is created, no change in the code is required, just create a new library populated with the files that have the same name for all companies


Denis Robitaille
Chef de service TI – Solution d’entreprise
Infrastructure et opérations

CASCADES CENTRE DES TECHNOLOGIES
412 Marie Victorin
Kingsey falls(Québec) Canada J0A 1B0
Tél : 819 363 6100 Poste :52130
Cell : 819 352 9362


-----Message d'origine-----
De : RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> De la part de Jerry Adams
Envoyé : 8 février 2019 10:21
À : 'RPG programming on the IBM i (AS/400 and iSeries)' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Objet : RE: External Data Areas - Multiple Companies, One Program

Brad,

That's basically how I determine which file to open. I keep a data area in QTEMP for the user as s/he logs in that specifies which company s/he is using.

To be more specific, the original system was designed on a S/36 and uses group file ids, such that company A uses 'A.file' and Company B uses 'B.file' so I just take the group id and build the file name.

Jerry C. Adams
When is this "Old enough to know better" supposed to kick in?
IBM i Programmer/Analyst
--
NMM&D
615-832-2730

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of B Stone
Sent: Friday, February 08, 2019 8:30 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: External Data Areas - Multiple Companies, One Program

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
www.bvstools.com
MAILTOOL Benefit #6 <https://www.bvstools.com/mailtool.html>: 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.
There
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 cannot 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.



Thanks.



Jerry C. Adams

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

IBM i Programmer/Analyst

--

NMM&D

615-832-2730



--
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,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
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,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com

--
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,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com Cascades - ATTENTION: Ce courriel provient de l'extérieur de l'organisation. Ne pas cliquer sur les liens et ne pas ouvrir les pièces jointes sauf si vous reconnaissez l'expéditeur et que vous êtes sûr que le contenu est légitime.
Cascades - CAUTION: This email is from outside the organization. Do not click on links or open attachments unless you recognize the sender and you are sure the content is safe.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2024 by midrange.com 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.