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



Rory Hewitt wrote:
However, if you define it without the DTAARA keyword in the called program,
then it gets read in automatically, but you can't use the OUT opcode on it,
since the program thinks it's not a data area.

The original support for data areas in RPG II... if you code UDS (instead of just DS) it automatically reads the data area when the program starts, and automatically writes it when the program ends. The name of the data structure must match the name on disk. If you give no name to the data structure, it uses LDA.

RPG III still supported the RPG II method, of course. But they added the ability to use the IN/OUT op-codes as well. When using IN/OUT, you have to identify your structure as a data area (in RPG III you used the DEFN op-code). The "U" in "UDS" is not needed when doing IN/OUT. (Unless you want *both* RPG to read it automatically *and* to read it manually with IN/OUT.)

RPG IV added the DTAARA d-spec keyword, which works just like the *DTAARA DEFN in RPG III, except that's coded on the D-spec, which is arguably a better place. RPG IV has additional capabilities to let you reference the dtaara by a different name on disk than the structure name in your code.


For some reason, I thought that the IN and OUT opcodes worked on UDS's which
didn't specify the DTAARA keyword, but apparently not.

Never have.

Personally, I think it's more intuitive to leave the "U" off and just have "DS" (instead of UDS) when using the IN/OUT keywords. i.e. either use one or the other. The RPG II support (UDS) or the RPG III support (IN/OUT). Using them both together will work, but it's confusing, IMHO.

Too many people think the "U" in "UDS" is always required with data areas. It's not. The U is *only* needed if you want RPG to automatically read the dtaara at startup, and write it at program end, like the original RPG II support.

But, at any rate, I don't see what the UDS and DTAARA have to do with how the program locks the dtaara. I thought dtaara only supported *EXCL locks -- but I haven't experimented in a very long time, so if you tell me that it uses *EXCLRD, I'll take your word for it.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

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

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.