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



You're missing an INZ

D szerrds ds INZ
D szerror 256
D szerrprov 10i 0 overlay(szerror)
D szerrret 10i 0 overlay(szerror: *next)
D szerrmsg 7 overlay(szerror: *next)
D szerrres 1 overlay(szerror: *next)
D szerrdata 240 overlay(szerror: *next)

without the INZ, the DS will be initialized to all spaces which means
szerrprov = x'40404040' = 1077952576 bytes...a bit big methinks!

Also, there's no need to assign a size to szerror, better to let the
compiler figure it out that way you won't have to remember to change
it if you add another subfield.. Personally (and per our company
standards) all DS should be qualified. Also you don't need to name
the reserved field...

So my version looks more like

D szerrds ds INZ
D error
D bytesProv 10i 0 overlay(error)
D bytesRtnd 10i 0 overlay(error: *next)
D messageID 7 overlay(error: *next)
D 1 overlay(error: *next)
D data 240 overlay(error: *next)


HTH,
Charles



On Fri, Sep 2, 2011 at 1:20 PM, John McKay <jmckay@xxxxxxxxxxxxxxxx> wrote:
Hi Marie,

I agree with the previous contributors, in that the error parameter can
be better defined.

I have copied the relevant bits of code here ...

 * 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                        likeds(szerrds)

...

D szerrds         ds
D   szerror                    256
D     szerrprov                 10i 0 overlay(szerror)
D     szerrret                  10i 0 overlay(szerror: *next)
D     szerrmsg                   7    overlay(szerror: *next)
D     szerrres                   1    overlay(szerror: *next)
D     szerrdata                240    overlay(szerror: *next)

...

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

If there is an error, field szerrmsg wil contain the message id in the
form xxxnnnn, which you can look up using WRKMSGF QCPFMSG.
Otherwise, szerrmsg wil be blank.

I am down in Lmerick and you can contact me directly if I can be of more
help.

Regards,
John McKay   mba
jmckay at mckaysoftware dot ie





On 02/09/2011 16:58, 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



Thanks
Marie
This e-mail is intended only for the addressee named above. The contents should not be copied nor disclosed to any other person. Any views or opinions expressed are solely those of the sender and do not necessarily represent those of QUINN-Insurance Limited (Under Administration), unless otherwise
specifically stated . As internet communications are not secure,
QUINN-Insurance Limited (Under Administration) is not responsible for the contents of this message nor
responsible for any change made to this message after it was sent by the original sender. Although virus scanning is used on all inbound and outbound e-mail, we advise you to carry out your own virus check before opening any attachment. We cannot accept liability for any damage sustained as a result of any software viruses.

====================================================================

QUINN-Insurance Limited (Under Administration) is regulated by the Central Bank of Ireland and regulated by the Financial Services Authority for the conduct of UK
business.

====================================================================

QUINN-Insurance Limited (Under Administration) is registered in Ireland, registration number
240768 and is a private company limited by shares.
Its head office is at Dublin Road, Cavan, Co. Cavan.




This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.