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



Hey all,

I'm getting this really weird error when I'm trying to call 
QSYGETPH...i've put this in a test program until i get all the bugs worked 
out of calling these APIs...here's my code:

h bnddir('CGIBIN/CGIDEV2BND') 
h bnddir('CGIBIN/BASE64') 
 //-----------------------------------------------------
 // Prototypes 
 //-----------------------------------------------------
 /copy qrpglesrc,prototypeb 
 /copy qrpglesrc,usec 
 /copy qrpglesrc,variables3 
 /copy qrpglesrc,base64_h 
d getprofilehandle... 
d                 pr                  extpgm('QSYGETPH')
d                               10a   const 
d                               10a   const 
d                               12a 
d                            32767a   options(*varsize) 
d setprofilehandle... 
d                 pr                  extpgm('QWTSETP') 
d                               12a 
d                            32767a   options(*varsize:*nopass)
d setprofiletoken... 
d                 pr                  extpgm('QSYSETPT') 
d                               32a 
d                            32767a   options(*varsize:*nopass)
d releaseprofilehandle... 
d                 pr                  extpgm('QSYRLSPH') 
d                               12a 
d                            32767a   options
 //------------------------------------------
 // Data Structures 
 //------------------------------------------
d apierror0200    ds 
d  aekey2                 1      4b 0 inz 
d  aebytprv2              5      8b 0 inz(12)
d  aebytavl2              9     12b 0 inz 
d  aeexcpid2             13     19a   inz
d  aereserved2           20     20a   inz
d  aeccsid2              21     24b 0 inz
d  aeoffset2             25     28b 0 inz
d  aelength2             29     32b 0 inz
d  aeexcpdta2            33    160a   inz
 //--------------------------------------
 // Standalones
 //--------------------------------------
d path            s           1024a 
d httpprofhndl    s             12a 
d usrb64token     s             64a   varying 
d usrtoken        s             32a 
 /free 
 /copy qrpglesrc,prolog3 
  usrb64token = getenv('HTTP_AS_AUTH_PROFILETKN':qusec);
  base64_decode(%addr(usrb64token)+2:%len(usrb64token): 
                %addr(usrtoken):%size(usrtoken)); 
  getprofilehandle('QTMHHTP1':'*NOPWD':httpprofhndl:apierror0200); 
  setprofiletoken(usrtoken:apierror0200); 
  clrhtmlbuffer(); 
  path = '/home/scessna/cgidev2/html/test.html'; 
  gethtmlifs(path); 
  updhtmlvar('userprf':psdsusrprf); 
  updhtmlvar('userid':psdsusrnam); 
  callp wrtsection('all *fini'); 
  setprofilehandle(httpprofhndl:apierror0200); 
  releaseprofilehandle(httpprofhndl:apierror0200); 
  *inlr = *on; 
 /end-free 

When I call getprofilehandle(QSYGETPH), the job log says this:

Error occurred while calling program or procedure *LIBL/ SYGETPH (C G D 
F).

Cause . . . . . :   RPG procedure TEST in program CGIBIN/TEST at statement 
 
  1648 attempted to call program or procedure *LIBL/ SYGETPH, but was 
unable 
  to access the program or procedure, the library, or a required service  
  program. If the name is *N, the call was a bound call by procedure 
pointer.

When it calls this, it blanks out the leading "Q" in QSYGETPH...does 
anyone know why this might be happening?  Thanks.

Shane

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.