Well, I'm obviously doing something wrong. I looked at the code supplied by
Mihael and Brian, and thought I had it licked. But no joy in Mudville when

The relevant code at V7.3 is:

D EOMClose DS DtaAra(DSName)
D Contents 30a
D ap 1a Overlay(EOMClose)
D cr 1a Overlay(EOMClose:*Next)
D ar 1a Overlay(EOMClose:*Next)

D Prefix S 1a
D DSName S 21a
D FLib S 10a

DSName = %trim(flib) + '/' + prefix + '.EOM';

IN EOMClose;

When I run the test I get CPG1015 - Data area DSNAME in *LIBL not found.
Under debug the value of DSNAME = 'TSTQS36F/D.EOM ' where TSTQS36F is my
test library and D.EOM is the name of the data area. To double-check I ran
wrkobj command after canceling, and the data area, of course, showed up.

I'm sure that it is just some little thing that is sliding by me, but if
another pair of eyes can spot the issue, I would appreciate.


Jerry C. Adams
Experience is simply the name we give our mistakes. -Oscar Wilde
IBM i Programmer/Analyst

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
Barbara Morris
Sent: Friday, February 08, 2019 12:32 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: External Data Areas - Multiple Companies, One Program

On 2019-02-08 9:55 AM, Justin Taylor wrote:
You can use a variable for the data area, but that variable must be before
the program starts. An input parameter would work.

Another option would be to use *LIBL to determine the data area used.

But the variable only needs to be set before the program starts if it's a
data-area data structure (UDS in fixed form, DTAARA(*AUTO) in free-form).

If it's being handled with IN and OUT opcodes, the variable just has to be
set before the IN opcode.


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

Please contact support@xxxxxxxxxxxx for any subscription related questions.

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

This thread ...


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

This mailing list archive is Copyright 1997-2020 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].