<LOGIN> April 15, 2026, 4:48 pm

API Service Programs


   

Big Blue provides developers with several API programs to help support CGI program. Its not a requirement to use these programs, you can create your own API programs but why bother! It would be advise to simply take the existing API and wrap them in a class wrapper and simply pass the required parameters.

CGI Support

The supporting API Service Programs for HTTP support is located in the QTCP library named QTMHCGI (QTCP/QTMHCGI)

API Service Program

Description

QtmhWrStout

Write Standard Output

QtmhRdStin

Read Standard Input

QtmhGetEnv

Get Environment Variable

QtmhCvtDB

Convert to DB

QtmhPutEnv

Put Environment Variable

To display the service programs call the command DSPSRVPGM QTCP/QTMHCGI

Library's

To organize your collection of CGI specific programs I would advise to create a CGI Library - CGILIBRARY After creating the library copy (DUP) into it all of the IBM API service programs

Copy the API service program QTMHCGI to CGILIBRARY

CRTDUPOBJ OBJ(QTCP/QTMHCGI TYPE(*SRVPGM) TOLIB(CGILIBRARY)



Binding Directory

Create a Binding Directory to hold a list of modules and service programs called CGIBNDDIR (CRTBNDDIR BNDDIR(CGILIBRARY/CGIBNDDIR) Add the service program QTMHCGI to our new Binding Directory (ADDBNDDIRE BNDDIR(CGILIBRARY/CGIBNDDIR) BNDDIRE(CGILIBRARY/QTMHCGI)

   


Related Articles




Copyright © 1996 - 2013 JM Solutions, Inc. Houston, TX - All rights reserved.
Website Design JM Solutions   Webmaster