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



Hi Marie,

You don't appear to be setting up the ErrorCode parameter properly. The system may be sending you back errors, and you won't know it. Worse, you may be corrupting job memory, since you've told the API that your error code is more than 1 GB long, when in reality it's only 500 bytes.

So, that's where I would start. I would code your ErrorCode as:

d ErrorCode ds
d 10i 0 inz(0)
d 10i 0 inz(0)

That's a minimal implementation -- there's more you can do, but it should be a good starting point.

See if that helps?


On 9/2/2011 10:58 AM, Marie O'Rourke wrote:
Hi

I have the following code and the 'AuthIndicator' variable always comes
back as Y.
I have edited the Authority on the Object so that no-one has *CHANGE
authority and *PUBLIC is *EXCLUDE
I have tried using other User Profiles and i have tried incrementing the
CallLevel variable.

I'm new to using APIs so not exactly sure why this isn't working as
expected. Our AS400 is on V5R4.

Here's my Code
* Interface for the API...
D QSyCUsrA PR ExtPgm('QSYCUSRA')
D AuthIndicatPR 1A
D UserProfilePR 10A const
D QualObjectPR 20A const
D ObjectTypePR 10A const
D AuthorityPR 110A options(*varsize)
D AuthCountPR 10I 0 const
D CallLevelPR 10I 0 const
D ErrorCodePR 500a options(*varsize)

D AuthIndicator S 1A
D UserProfile S 10A
D QualObject S 20A
D ObjectType S 10A
D Authority S 110A
D AuthCount S 10I 0
D CallLevel S 10I 0
D ErrorCode S 500A

/Free
AuthIndicator = ' ';
UserProfile = '*CURRENT';
QualObject = 'CRXXXXPHNO*LIBL';
ObjectType = '*FILE';
Authority = '*CHANGE';
AuthCount = 1;
CallLevel = 0;

QSyCUsrA(AuthIndicator:UserProfile:QualObject:ObjectType:
Authority:AuthCount:CallLevel:ErrorCode);

DSPLY AuthIndicator;

*INLR = *On;

/End-Free



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.