Sharing data between analyzer and converter programs

Top  Previous  Next

XCICS passes three parameters between the analyzer and the converter programs that enable data to be shared by these processing stages:

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, the pointer points to a block of storage containing the HTTP request. On completion of the encode function of the converter, XCICS Web support uses it to locate the block of storage containing the HTTP response.

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

Between the converter and the XCICS 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.

user_data_length

This parameter is the length of the block of storage addressed by the user_data pointer.

user_token

The user token is an 8-byte field which is shared by the analyzer and the converter. It can contain any information you wish:

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 to the decode stage of the converter, and a different meaning when passed to the encode stage.

Note: The analyzer and converter programs execute under different XCICS 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 XCICS, so you must issue a GETMAIN command when your programs no longer need the storage. However, XCICS will free the storage addressed by the user_data pointer after the HTTP response has been sent to the Web client.