IBM HTTP Server for AS/400
Using RPG-CGI for Web Enablement


Terms of Use
  1. You may freely download this file or set of files for use within your site or at your client sites.
  2. You must keep all of the original copyrights and other notifications with all copies of the file(s) that you download from this site.
  3. You may use any of the code or techniques described in your own programs.
  4. You may not develop any article, publication, Web page or other document that is based entirely or substantially on any of the information or code that you download.
  5. You may link directly to www.web400.com from any of your Web sites. Please do not link directly to internal pages on this site.
  6. Use of any materials, files, descriptions, code, procedures, etc., that you obtain from this Web site is AT YOUR OWN RISK. DO NOT USE any of the materials, files, descriptions, code, procedures, etc., if you are uncertain what the effect might be, and if you do not have adequate backup and recovery to correct any possible problems.
  7. I do not offer "free" support for any of the material available on this site. Consulting services are available by request for a fee.


File name: Using RPG-CGI for Web Enablement
Environment: IBM HTTP Server for AS/400 (5769-DG1), V4R3 or greater.

AS/400 RPG compiler (5769-RG1).

Date Posted: February 10, 2001

About this document:
If you use RPG as your programming language for the AS/400 system, you can create CGI programs to work with Web forms. This article, adapted from seminar materials, describes the basic concepts of CGI processing and includes ILE RPG code samples of a complete, working RPG-CGI program. The code sample shows how to use the QzhbCgiParse API, which is a more powerful API than the obsolete QtmhRdStin and QtmhCvtDb APIs.

The sample is available in RPG only. I do not have a sample available for COBOL.

The sample is available as RPG source code only. Please do not ask me to send you a compiled version of the program. If you do not know how to compile the programs, seek competent help. If you do not have the AS/400 RPG compiler, you will need to locate an AS/400 that has the compiler.
Links to the article and PowerPoint presentation:
RPGCGI.htm - Web page that describes how to use CGI APIs in an ILE RPG program.

RPGCGIPPT.htm - PowerPoint Web presentation that describes how to use CGI APIs in an ILE RPG program. Note: this will display best when you click the "Full Screen Slide Show" icon that appears in the bottom right corner of your browser after the file is opened. You can then navigate through the slide show by clicking each slide in order.

Download Files:
Note: you can view the files in your browser by clicking the link. To save the files, right-click and select the "Save Target As..." option.

testcgi_html.txt - HTML file for test name and address form. Save this file, copy to a directory on your AS/400 IFS to test the RPG-CGI programs.

testcgi.txt - ILE RPG program that produces a response Web page. Calls the CGIPARSE program.

cgiparse.txt - ILE RPG program that calls the QzhbCgiParse API to parse the contents of the POST buffer. Returns results to the caller in two arrays (field names, field values). This is a general purpose program that you can call from any program that needs to process an incoming POST buffer and parse field name/value pairs.




Craig Pelkie
Bits & Bytes Programming, Inc.
craig@web400.com

WEB400 Home Page Download Files


Web Server, AS/400
Copyright © 2001, Bits & Bytes Programming, Inc., ALL RIGHTS RESERVED

WWWSights, Publisher
Last modified February 10, 2001