17.00 - Shutdown - Access Module

Teradata® Tools and Utilities Access Module Programmer Guide

Product
Access Module
Release Number
17.00
Release Date
June 2020
Content Type
Programming Reference
Publication ID
B035-2424-220K
Language
English (United States)

The Shutdown function terminates an Access Module. The structure follows:

typedef struct _pmiShut            
{                                            
  char       EyeCatcher[pmiMAX_EC_LEN];/* Struct eyecatcher string */
  pmUInt32   StructLength;             /* Length of this structure */
  void      *PIData;                                       
  pmUInt16   Mode;                                                   
} pmiShut_t;                

where the following is true:

Parameter Field Description
EyeCatcher input Structure description string, such as pmShutParms.
StructLength input Total structure length, including the EyeCatcher string.
PIData input Value provided by an Access Module in response to a previous open request call.
Mode input Shutdown mode/option as follows:
  • pmShutDownNormal – Normal error checking. If anything prevents a clean termination (such as files still open), then exit without action with a non-pmrcOK in Retcode.
  • pmShutDownBrute – Take arbitrary action for unexpected conditions.

Return Codes

The following Shutdown return code supplements those listed in Typical Interface Return Codes:

Return Code Description
pmrcOpenFiles Files are open.

Usage Notes

Consider the following when specifying the Shutdown parameters:
  • Requirements – A Shutdown function is required when the Reqtype field of the pmiCmdBlock_t structure is pmiPIDMOptShut.
  • Housekeeping Operations – The Shutdown function also performs the following housekeeping operations:
    • Terminating subprocesses
    • Closing open files
    • Freeing memory
  • Error Conditions – The Shutdown function needs to proceed despite file close errors.