Using the CSVINFO macro

The CSVINFO macro provides information about loaded modules associated with a job step or a task. You can invoke CSVINFO from a program or an IPCS exit.

Note: IBM recommends that you use the CSVINFO macro rather than write your own program to scan control blocks for information about loaded modules. Using the CSVINFO macro enables you to retrieve module information without depending on the details or structures of data areas.

The CSVINFO service requires a user-written module information processing routine (MIPR). The CSVINFO service obtains information about loaded modules and uses the CSVMODI data area to pass that information to the MIPR. The MIPR examines this data and returns control to CSVINFO, either requesting information about an additional loaded module or indicating that no more information is needed. This loop continues until the CSVINFO service has returned to the MIPR all requested information or all available information.

For example, if you request information about all loaded modules in your job pack area (JPA), the CSVINFO service uses the CSVMODI data area to pass information about the first loaded module to the MIPR. The MIPR processes the information and returns control to CSVINFO to obtain information about the next loaded module in the JPA. Processing continues until CSVINFO indicates that all information has been obtained or until the MIPR determines that no more information is required.

When you issue the CSVINFO macro, use the FUNC parameter to specify the information you want, and the ENV parameter to specify whether CSVINFO is being issued from a program or from an IPCS exit. Use the MIPR parameter to pass the address of your MIPR. You can pass 16 bytes of information to the MIPR using the USERDATA parameter. Information could include register contents, parameter list addresses, or other information your MIPR requires. CSVINFO places your user data into the CSVMODI data area.

References
References
End of References
Figure 1 shows the processing that occurs when your program or exit issues the CSVINFO macro. The numbered steps are explained below:
  1. The application or IPCS exit invokes the CSVINFO macro.
  2. CSVINFO retrieves the module information you want.
  3. CSVINFO places the information into the CSVMODI data area.
  4. CSVINFO passes control to your MIPR.
  5. The MIPR reads the information that is in the CSVMODI data area.
  6. The MIPR places the information into your storage or otherwise processes the information.
  7. The MIPR sets a return code for CSVINFO:
    • A return code of zero to request information about another loaded module
    • A nonzero return code to indicate that no more information is needed.
  8. The MIPR returns control to CSVINFO.
  9. Steps 2 through 8 are repeated until the MIPR indicates to CSVINFO that no more information is needed, or CSVINFO indicates to the MIPR that all information has been retrieved.
  10. CSVINFO sets a return code and returns control to your program when the MIPR passes CSVINFO a return code indicating that no more information is needed, or when CSVINFO has passed all the information to the MIPR.
  11. The application or IPCS exit continues processing.
Figure 1. Processing Flow for the CSVINFO Macro and the Caller's MIPR
ieaa6mpr