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:

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].