×
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.
your prototype is severely off. char(*) in the IBM
documentation means it's a variable character data not a
pointer (which is what you have the parms defined as)
Actually char(*) is indeed a pointer.
It's a pointer to character data, but it is indeed a pointer.
This prototype would work just as well:
D ChkUsrAut PR ExtPgm('QSYCUSRA')
d authindicator 1a
d userprofile 10a const
d qualobject 20a const
d objecttype 10a const
d authority 110a const
d authcount 10i 0 const
d calllevel 10i 0 const
d errorcode * value
D ErrorDS ds Qualified Inz
d BytesProvided 10i 0
d BytesAvailable 10i 0
D authind s 1a
/free
chkusraut( authind
: 'USERID '
: 'QRPGLESRC MYLIB '
: '*FILE'
: '*CHANGE'
: 1
: 1
: %addr(ErrorDS));
*inlr=*On;
return;
/end-free
While it's certainly easier to take advantage of the VARSIZE keyword and pass errorDS as a simple
reference parameter, it's important to remember that when you pass by reference, you are indeed
passing a pointer.
Heck, the following prototype would work (just harder to use ;-)
D ChkUsrAut PR ExtPgm('QSYCUSRA')
D authindicator * value
d userprofile * value
d qualobject * value
d objecttype * value
d authority * value
d authcount * value
d calllevel * value
d errorcode * value
D ErrorDS ds Qualified Inz
d BytesProvided 10i 0
d BytesAvailable 10i 0
D authind s 1a
D usrprf s 10a
D qualObj s 20a
D objTyp s 10a
D auth s 110a
D authCnt s 10i 0
D callvl s 10i 0
/free
usrprf = 'USERID ';
qualObj = 'QRPGLESRC MYLIB ';
objTyp = '*FILE';
auth = '*CHANGE';
authCnt = 1;
callvl = 1;
chkusraut( %addr(authind)
: %addr(usrprf)
: %addr(qualObj)
: %addr(objTyp)
: %addr(auth)
: %addr(authCnt)
: %addr(callvl)
: %addr(ErrorDS));
*inlr=*On;
return;
/end-free
Again, passing _any_ varible by reference is the same as passing a pointer by value. In the second
example, beside being harder to use, you lose the advantages of the CONST keyword.
HTH,
Charles
This e-mail transmission contains information that is intended to be confidential and privileged. If you receive this e-mail and you are not a named addressee you are hereby notified that you are not authorized to read, print, retain, copy or disseminate this communication without the consent of the sender and that doing so is prohibited and may be unlawful. Please reply to the message immediately by informing the sender that the message was misdirected. After replying, please delete and otherwise erase it and any attachments from your computer system. Your assistance in correcting this error is appreciated.
As an Amazon Associate we earn from qualifying purchases.