Writing reenterable programs

 

WebSphere MQ uses its structures for both input and output. If you want your program to remain reenterable:

  1. Define working storage versions of the structures as DSECTs, or define the structures inline within an already-defined DSECT. Then copy the DSECT to storage that is obtained using:

    • For batch and TSO programs, the STORAGE or GETMAIN z/OS assembler macros

    • For CICS, the working storage DSECT (DFHEISTG) or the EXEC CICS GETMAIN command

    To correctly initialize these working storage structures, copy a constant version of the corresponding structure to the working storage version.

    The MQMD and MQXQH structures are each more than 256 bytes long. To copy these structures to storage, use the MVCL assembler instruction.

  2. Reserve space in storage by using the LIST form (MF=L) of the CALL macro. When you use the CALL macro to make an MQI call, use the EXECUTE form (MF=E) of the macro, using the storage reserved earlier, as shown in the example under Using CEDF. For more examples of how to do this, see the assembler language sample programs as shipped with WebSphere MQ.

Use the assembler language RENT option to help you to determine if your program is reenterable.

For information on writing reenterable programs, see MVS/ESA Application Development Guide: Assembler Language Programs, GC28-1644.

 

Parent topic:

Coding in System/390 assembler language


fg11830_