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



One tip is to clear the error data structure prior to each call to QSYGETPH so 
that an error on a prior call is not carried forward on subsequent calls, when 
authenticating users within a loop.

Nathan.


----- Original Message ----
From: "Fleming, Greg (ED)" <GFLEMING@xxxxxxxxxxxxxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxx
Sent: Monday, June 19, 2006 10:00:34 AM
Subject: QSYGETPH API

We are trying to use the QSYGETPH API and keep getting the CPF22E2 error
(Password not correct for user profile) even though we're using a valid
logon and password.  

I've posted our code below.  Does anyone see anything obvious we might
be doing wrong ?

 

     D GetProfile      Pr                    ExtPgm('QSYGETPH')


     D  UserID                       10A


     D  Password                       *


     D  Handle                       12A


     D  ErrorCode                   256A   Options(*Varsize : *NoPass)


     D  PswLength                    10I 0 Options(*NoPass)

     D  CCSIDCode                    10I 0 Options(*NoPass)   

                    

     D ErrDs           Ds


     D  BytesPrv               1      4I 0 Inz(256)


     D  BytesAvl               5      8I 0 Inz(0)


     D  ErrMsgID               9     15


     D  Reserved              16     16


     D  ErrMsgDta             17    256              

 

   P RtvProfile      B


     D RtvProfile      PI            10I 0


     D   userid                      10a   Value


     D   password                    10a   Value


      *

     D   pswlength     S             10I 0


     D   CCSIDCode     S             10I 0


     D   Passwordin    S               *


     D*

      /Free

        //?Translate User ID and Password to Upper Case;

            UserId   = %Xlate(LC:UC:UserID);    // User Id;

            Passwordin = %addr(Password);  // Password;

            pswlength = %len(Password);

            CCSIDCode = 37;

 

        //?Retrieve user Profile;

             CallP  GetProfile (UserID : passwordin: handle : ERRDS:

                                pswlength:CCSIDCode);

                If BytesAvl > 0;

                    Return 0;

                Else;

                    Return 1;

                Endif;

      /End-Free  

                                              

 

Greg Fleming

Programmer/Analyst

Everglades Direct, Inc.

 


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.