There is also an API called QXXRTVDA. Why do you want to use something different to RTVDTAARA or IN?
There is also the Retrieve Data Area API QWCRDTAA. This API is a bit more flexible in terms of the *DTAARA data type (though the referenced C run-time API does support access beyond *DTAARAs).
Register Hereor login if you are already a member
I usually don't respond to old threads .. but let me add:
D Mydta UDS DTAARA('MYDTAARA')
The U in this D-Spec causes the RPGLE program to Load the data structure and lock the data area prior to the C-spec processing.