Hi Jerry,
I rarely use dataareas, but according to the manual you should specify: " The name must be in the correct case. For example, if you specify DTAARA(*VAR:dtaname) and variable dtaname has the value 'qtemp/mydta', the data area will not be found. Instead, it should have the value 'QTEMP/MYDTA'."
Eventually you did not specify *VAR:
Best regards
stefan.tageson@xxxxxxxx
M +46 732 369934
Sensitivity: Internal
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jerry Adams
Sent: den 11 februari 2019 16:36
To: 'RPG programming on the IBM i (AS/400 and iSeries)' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: External Data Areas - Multiple Companies, One Program
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 testing.
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
rtvflib(flib);
getprefix(prefix);
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.
Thanks.
Jerry C. Adams
Experience is simply the name we give our mistakes. -Oscar Wilde IBM i Programmer/Analyst
--
NMM&D
615-832-2730
-----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.
--
Barbara
--
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://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Frpg400-l&data=02%7C01%7Cstefan.tageson%40evry.com%7C5f04406d192c4b4d7fc908d69036a424%7C40cc2915e2834a2794716bdd7ca4c6e1%7C1%7C0%7C636854961689840915&sdata=m1%2BFvY9RvC9TaOuzSNdmbMvhMdJa4%2B4S0ghpdBw14ss%3D&reserved=0
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Frpg400-l&data=02%7C01%7Cstefan.tageson%40evry.com%7C5f04406d192c4b4d7fc908d69036a424%7C40cc2915e2834a2794716bdd7ca4c6e1%7C1%7C0%7C636854961689840915&sdata=XyT6QEUbLrHl3XI1eguFfdNviobHp91zGxIZWzh3A5o%3D&reserved=0.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Famazon.midrange.com&data=02%7C01%7Cstefan.tageson%40evry.com%7C5f04406d192c4b4d7fc908d69036a424%7C40cc2915e2834a2794716bdd7ca4c6e1%7C1%7C0%7C636854961689840915&sdata=G6E6wHsP6JT%2BUwRS1jbHrHtwkTuso0jItyOLdDGBcyg%3D&reserved=0
--
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://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Frpg400-l&data=02%7C01%7Cstefan.tageson%40evry.com%7C5f04406d192c4b4d7fc908d69036a424%7C40cc2915e2834a2794716bdd7ca4c6e1%7C1%7C0%7C636854961689840915&sdata=m1%2BFvY9RvC9TaOuzSNdmbMvhMdJa4%2B4S0ghpdBw14ss%3D&reserved=0
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Frpg400-l&data=02%7C01%7Cstefan.tageson%40evry.com%7C5f04406d192c4b4d7fc908d69036a424%7C40cc2915e2834a2794716bdd7ca4c6e1%7C1%7C0%7C636854961689840915&sdata=XyT6QEUbLrHl3XI1eguFfdNviobHp91zGxIZWzh3A5o%3D&reserved=0.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Famazon.midrange.com&data=02%7C01%7Cstefan.tageson%40evry.com%7C5f04406d192c4b4d7fc908d69036a424%7C40cc2915e2834a2794716bdd7ca4c6e1%7C1%7C0%7C636854961689840915&sdata=G6E6wHsP6JT%2BUwRS1jbHrHtwkTuso0jItyOLdDGBcyg%3D&reserved=0
As an Amazon Associate we earn from qualifying purchases.