Retrieve Call Stack (QWVRCSTK)

From MidrangeWiki
Jump to: navigation, search

Summary

The following is an RPG/LE fully free-form prototype for the IBM QWVRCSTK API to retrieve the Call Stack content for the current job.

For more information on this API, visit Retrieve Call Stack (QWVRCSTK) API (right-click to open link in a new tab).

By Dave Clark

Prototype for the QWVRCSTK API

//=========================================================================                    
// IBM API to Retrieve Call Stack information
//
// EXAMPLE:
// callp IBMAPI_RtvCallStack( MyCallStack: %len(MyCallStack): 'CSTK0100'
//                          : MyJobInfo: 'JDIF0100': ApiErrC);
//
// DOCUMENTATION:
// https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/apis/qwvrcstk.htm
//=========================================================================
dcl-pr IBMAPI_RtvCallStack        extpgm('QWVRCSTK');
  CStkRcvr              likeds(QWVK0100) options(*varsize);
  CStkRLen              int(10:0) const;
  CStkRFmt              char(8)   const;
  CStkJInfo             likeds(QWCF0100) options(*varsize);
  CStkJFmt              char(8)   const;
  CStkErrC              likeds(ApiErrC)  options(*varsize);
end-pr;

Example

See the Find Call Stack Entry service procedure.

References