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



Can someone point me in the right direction with my first RPG CGI. I am having 
problems with my CGI RPG program. I am getting 500 error when I get there. The 
program is a SQL RPG which I compiled to a module (with CRTSQLRPGI *MODULE), 
then bound with the service program QZHBCGI in QHTTPSVR using CRTPGM. I know 
the web server is running the program, it appears I am having problems with 
QtmhWrStout. I have included the code snippets ...

RPG:
D NEWLINE         C                   CONST(X'15')                     
D HTTPHeader      C                   CONST('Content-type: text/html') 
D APIOut          C                   CONST('QtmhWrStout')             
D WPError         DS                                                   
D  EBytesP                1      4B 0                                  
D  EBytesA                5      8B 0                                  
D  EMsgID                 9     15                                     
D  EReserverd            16     16                                     
 *                                                                     
D WrtDta          S           1024A                                    
D WrtDtaLen       S              9B 0 INZ(1024)                 

C                   EVAL      WrtDta = HTTPHeader                       
C                   EVAL      WrtDta = %TRIM(WrtDta) + NEWLINE          
C                   EXSR      WRSTDOUT                                  
C                   EVAL      WrtDta = '<HTML><TITLE>TEST</TITLE><BODY> 
C                             <H1>Test --- Test<BR></BODY></HTML>'      
C                   EVAL      WrtDta = %TRIM(WrtDta) + NEWLINE          
C                   EXSR      WRSTDOUT            

C     WRSTDOUT      BEGSR                                         
 *                                                                
C                   EVAL      EBytesP = %SIZE(WPError)            
C                   EVAL      WrtDtaLen = %LEN(%TRIM(WrtDta))     
C                   CALLB     APIOut                              
C                   PARM                    WrtDta                
C                   PARM                    WrtDtaLen             
C                   PARM                    WPError               
 *                                                                
C                   ENDSR                                         

If someone thinks it may be elsewhere, let me know what you need to see.

Thanks For the Help
Chris
                             

Chris Piper
Systems Analyst
Stant Manufacturing, Inc.
765.827.8121
cpiper@xxxxxxxxxxxx



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.