Well, thanks to you and Stefan. This was originally written at V5R1, and I
have, lazily, not gotten into reading about or coding free-form F and D
specs (much less O specs). Once I made the *var change and explicitly
defined the length of the data area on the DS line, everything compiled and
worked fine.
Again, thanks to everyone.
Jerry C. Adams
I sometimes think that God in creating man overestimated his ability. -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: Monday, February 11, 2019 2:12 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: External Data Areas - Multiple Companies, One Program
On 2019-02-11 10:36 AM, Jerry Adams wrote:
...
D EOMClose DS DtaAra(DSName)
... > D DSName S 21a
...
When I run the test I get CPG1015 - Data area DSNAME in *LIBL not found.
As Stefan said, you need to code DtaAra(*VAR:DSName).
But ... warning ... that's only true for a fixed-form D spec. The fixed-form
version of the DTAARA keyword assumes that a name is actually a sort of
literal. But if it was a free-form D spec, *VAR isn't supported for the
DTAARA keyword. Your DtaAra keyword would work if it was a free-form
definition.
dcl-ds EOMClose DtaAra(DSName)
The more usual problem with the DTAARA keyword for fixed-form vs free-form
is when people are accustomed to coding the DTAARA keyword with a name
rather than a literal.
This D spec uses data area *LIBL/DTANAME.
D myDtaara DS DtaAra(dtaname)
But for this free-form definition, dtaname has to be either a named constant
or a variable.
dcl-ds myDtaara DTAARA(dtaname)
If you wanted *LIBL/DTANAME, you'd have to put DTANAME in quotes, uppercase.
dcl-ds myDtaara DTAARA('DTANAME')
For more free-vs-fixed gotchas:
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzasd/freefixeddiff
.htm
--
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://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
As an Amazon Associate we earn from qualifying purchases.