Sharing data between analyzer and converter programs

CICS® passes three parameters between the analyzer and the converter programs that enable data to be shared by these processing stages.

The user_data pointer
This parameter contains the address of a 32K block of storage that is passed from stage to stage. On entry to the analyzer program, the pointer points to a block of storage containing the HTTP request. On completion of the encode function of the converter program, CICS web support uses it to locate the block of storage containing the HTTP response, unless the EXEC CICS WEB API commands have been used to produce a response instead.

You must not change the value of the pointer in the analyzer program, although you can modify the contents of the block of storage addressed by the pointer.

Between the converter program and the user-written application program, you can pass the pointer unchanged from one stage to another, or you can issue a GETMAIN command in one program and pass the address of the newly acquired storage in the pointer.

The user_data length
This parameter is the length of the block of storage addressed by the user_data pointer.
The user token
The user token is an 8–byte field which is shared by the analyzer program and the converter program. It can contain any information you want:
  • You can pass small quantities of shared information directly in the user token.
  • To pass larger quantities, you can issue a GETMAIN command in one program, to acquire storage for a shared work area. Use the user token to pass the address of the shared storage.
You can change the contents of the user token in each program: for example, the user token can have one meaning when passed from the analyzer program to the decode function of the converter program, and a different meaning when passed to the encode function.

The analyzer program can modify any of the parameters in the parameter list which is passed to the converter program. The pointers cannot be changed, but the data indicated by the pointer can be changed. The length of each field must not change.

Note: The analyzer and converter programs execute under different CICS tasks. Therefore, if you issue a GETMAIN command in the analyzer program, you must code the SHARED option if the storage is to be visible in the converter program. In general, storage acquired with the SHARED option is not freed automatically by CICS, so you must issue a FREEMAIN command when your programs no longer need the storage. However, CICS will free the storage addressed by the user_data pointer after the HTTP response has been sent to the web client.