×
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.
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
As an Amazon Associate we earn from qualifying purchases.