Initialization - Access Module

Teradata® Tools and Utilities Access Module Programmer Guide

Access Module
Release Number
June 2022
English (United States)
Last Update
Product Category
Teradata Tools and Utilities

The Initialization function initializes an Access Module. The structure follows:

typedef struct _pmiInit
  char     EyeCatcher[pmiMAX_EC_LEN];  /* Struct eyecatcher string */
  pmUInt32 StructLength;               /* Length of this structure */
  void    *PIData;          /* Access module Internal Data Pointer */
  pmUInt16 InterfaceVerNo;         /* pmdcomt.h version identifier */
  pmUInt16 InterfaceVerNoD;        /* pmddamt.h version identifier */
  pmUInt32 ClientIDL;                  /* Length of ClientID field */
  pmUInt32 InitStrL;                       Length of InitStr field */
                                                 /* Client Utility */
  char     ClientID[pmMAX_CLIENT_ID+1];              /* identifier */
                                                  /* Access Module */
  char     InitStr[pmiMAX_INIT_STR_LEN+1]; /* initialization field */
} pmiInit_t;

where the following is true:

Parameter Field Description
EyeCatcher input Structure description string, such as pmInitParms.
StructLength input Total structure length, including the EyeCatcher string.
PIData output A handle/pointer to internal Access Module data. No restrictions exist on the PIData value, and the assigned value is returned in a subsequent call to the Access Module.
InterfaceVerNo input Identifying value for the expected version of the general Access Module interface header file,pmdcomt.h. This value should match the pmInterfaceVersion value defined in pmdcomt.h. If the match fails, set the Access Module Retcode to pmrcBadVer and return.
InterfaceVerNoD input Identifying value for the expected version of the device-dependent Access Module interface header file, pmddamt.h. This value should match the pmiInterfaceVersion value defined in pmddamt.h. If the match fails, set the Access Module Retcode to pmrcBadVer and return.
ClientIDL input Length of ClientID.
InitStrL input Length of InitStr.
ClientID input Identifier of the using program, such as Teradata FastLoad.
InitStr input A string of Access Module-specific initialization information that is meaningful only to the Access Module. The customer provides the initialization string, by way of the client utility, which passes the string unaltered to the Access Module.

Return Codes

The following Initialization return codes supplement those listed in Typical Interface Return Codes.

Return Code Description
pmrcBadVer An invalid parameter value for InterfaceVerNo or InterfaceVerNoD.
pmrcRedundant Specifies that the Access Module is already initialized.

Usage Notes

Consider the following when specifying Initialization parameters:
  • Initialization Requirements – Access Module initialization is required when the Reqtype field of the pmiCmdBlock_t structure is pmiPIDMOptInit.
  • Supporting Multiple Interactions – When supporting more than one iteration, use the PIData field to distinguish between iterations and between the files opened by each iteration.
    • To distinguish between iterations, use a different PIData value with each initialization request.
    • To distinguish between the files opened by each iteration, use the same PIData value with each file open request.