Converter programs

Converter programs are primarily for use with application programs that were not originally coded for use with the Web. They can also be used to combine output from several application programs into a single HTTP message.

About this task

Attention: This topic contains Product-sensitive Programming Interface and Associated Guidance Information.

Converter programs are not used when CICS® is an HTTP client, or for web service processing; they can only be invoked when CICS is an HTTP server. The role of converter programs in the CICS web support process for CICS as an HTTP server is described in HTTP request and response processing for CICS as an HTTP server. Enabling CICS web support for CICS as an HTTP server has information to help you plan your architecture for CICS as an HTTP server.

A URIMAP resource can specify a converter program to carry out relevant processing for HTTP requests. If an analyzer program is used in CICS web Support processing, the analyzer program can also invoke a converter program. A converter program can be useful in the following circumstances:
  • When application programs that were not originally coded for use with the web need to receive input in the form of a COMMAREA, or need their output to be converted into an HTTP response. Web-aware application programs, which are coded using the EXEC CICS WEB and EXEC CICS DOCUMENT application programming interfaces, should not require this conversion to take place. You can use a converter program to perform this conversion or other processing on the content of the request.
  • When you want to make more than one application program work on the same request data in sequence, and return a single HTTP response to the web client.

If a converter program is invoked directly from a URIMAP definition, the PROGRAM attribute of the URIMAP definition (which specifies the name of the application program to process the request) can be passed to the converter program, and the converter program can choose to override it.

A converter program receives the web client's request in a block of storage, together with a parameter list giving more information about the request. The converter program processes the content of the request into a format which is suitable for the application program that will provide data for the response, and passes it to the application program in a COMMAREA. This sequence is called the decode function of the converter program. If a converter program does not use the decode function to create a COMMAREA for the application program, the 32 767 byte buffer used to receive the HTTP request is passed to the application program.

The application program returns its results to the converter program. The converter program can invoke a further application program or programs, if more than one application program is needed to produce the data for the response. When the converter program has all the required data from the application programs, it produces an HTTP response to be sent to the web client. This sequence is called the encode function of the converter program.

A converter program is not associated with a TCPIPSERVICE definition in the same way as an analyzer program. You can use any converter program to process any HTTP request, but it must be local to the CICS system in which the request is received. For a given request, the same converter program is called for both the decode and encode functions.

All the user-replaceable programs must be local to the system in which CICS web support is operating. If you do not use autoinstall for programs, you must define and install program definitions for all user-replaceable programs used by CICS web support, including the analyzer and converter programs. If you use autoinstall for programs, you must ensure that user-replaceable programs are installed with the correct attributes.

Converter programs are also used by the CICS business logic interface. The role of the converter program in the CICS business logic interface is described in Using the CICS business logic interface to call a program. The caller of the CICS business logic interface determines whether a converter program is required, and which converter program should be called.