Information Catalog Manager Programming Guide and Reference

FLGInit

Initializes the Information Catalog Manager API DLL for use, connects the application to the database, and retrieves environmental information that you can use with other API calls.

Authorization

Administrator or user

Syntax



APIRET  APIENTRY   FLGInit( PSZ              pszUserID,
                            PSZ              pszPassword,
                            PSZ              pszDatabaseName,
                            FLGADMIN         Admin,
                            PFLGHEADERAREA * ppListStruct,
                            PFLGEXTCODE      pExtCode );

Parameters

pszUserID (PSZ) -- input
Points to a null-terminated string containing the user ID for the information catalog database logon.

pszPassword (PSZ) -- input
Points to a null-terminated string containing the user's password.

pszDatabaseName (PSZ) -- input
Points to a null-terminated string containing the database alias for the information catalog.

admin (FLGADMIN) -- input
Indicates the user option desired.
FLG_YES
Log on as an administrator.
FLG_NO
The default. Log on as an user.

ppListStruct (PFLGHEADERAREA) -- output
Points to the address of the pointer to the output structure. For the format of the output structure, see The Information Catalog Manager API output structure.

If there is no output structure, the pointer to the output structure is set to NULL, and the Information Catalog Manager returns an error condition with a reason code.

pExtCode (PFLGEXTCODE) -- output
Points to an extended code associated with the reason code. See Appendix D, Information Catalog Manager reason codes to see if a meaningful extended code is associated with the returned reason code.

Reason code (APIRET)
Represents the execution result of this API call.

See Appendix D, Information Catalog Manager reason codes for an explanation of the returned reason codes.

Output structure

FLGInit produces an output structure containing information about the Information Catalog Manager environment, as shown in Figure 83.

The object area of the output structure contains the required registration and object properties in the user's national language. The object area also contains values that provide information about the user's Information Catalog Manager environment.

Figure 83. FLGInit output structure


Figure FLAA2023 not displayed.

Usage

The output structure returns the 80-byte property names required for all object type registrations, object types, and objects.

If you are using a non-English version of the Information Catalog Manager, the values in the object area for each of these properties are translated. You need to save these translated values so that you can use them with FLGCreateReg and FLGCreateType.

Freeing memory allocated for an output structure

If FLGInit returned data in the output structure, you must save the data returned in the output structure and then call FLGFreeMem (see FLGFreeMem). Do not use other methods, for example, C language instructions, to free memory.

Table 17 shows the required properties that are returned by FLGInit.

Table 17. Required property names returned by FLGInit
Property name Description
EXTERNAL NAME OF OBJ TYPE First registration property in any object type registration
PHYSICAL TYPE NAME Second registration property in any object type registration
DP NAME Third registration property in any object type registration
CREATOR Fourth registration property in any object type registration
LAST CHANGED BY Fifth registration property in any object type registration
LAST CHANGED DATE AND TIME Sixth registration property in any object type registration
Object type identifier First required property on any object type
Instance identifier Second required property on any object type
Name Third required property on any object type
Last Changed Date and Time Fourth required property on any object type
Last Changed By Fifth required property on any object type

This output structure also returns environmental values. Save these values to use with other API calls.

Table 18. Environmental values returned by FLGInit
Property name Description
STORE ENVIRON Database product name with the release number in VxRxMx format. For example:
DB2/NT V07R01M0
DB2 UDB for Windows NT product
STORE ENVSIZE Value indicating the maximum length of PTNAME for the information catalog in this environment.
Not-applicable symbol 1-character default token of the Information Catalog Manager environment to represent an unspecified data field. This value was set during installation.
VERSION 20-character indicator of the version of the Information Catalog Manager.
LANGUAGE 3-character national language code; for example, ENU indicates English. Valid values are:
CHS
Simplified Chinese
CHT
Traditional Chinese
DAN
Danish
DEU
German
ENU
US English
ESP
Spanish
FIN
Finnish
FRA
French
ITA
Italian
JPN
Japanese
KOR
Korean
NLB
Belgian French
NOR
Norwegian
PTB
Brazilian Portuguese
SVE
Swedish
KAUSERID 8-character user ID for the administrator currently logged on.
Product Path 260-character full working path for the Information Catalog Manager.
System Path Length 8-character value for the maximum path length for the system.
Code page 4-character code page identifier
User Type 1-character identifier, set to:
A
Logged-on user ID is the primary administrator
B
Logged-on user ID is the backup administrator
D
Logged-on user ID is a user with authority to perform object management tasks
W
Logged-on user ID is a user

Examples

Figure 84 shows the C language code required to invoke the FLGInit API call. This sample code initializes the Information Catalog Manager API DLL so that information applications can issue calls to the Information Catalog Manager API.

Figure 84. Sample C language call to FLGInit

 UCHAR          pszUserID[FLG_USERID_LEN + 1];
 UCHAR          pszPassword[FLG_PASSWORD_LEN + 1];
 UCHAR          pszDatabaseName[FLG_DATABASENAME_LEN + 1];
 FLGADMIN       admin = FLG_YES;
 APIRET         rc;               // reason code
 PFLGHEADERAREA * ppListStruct;    // pointer to output structure pointer
 FLGEXTCODE     ExtCode = 0;           // Extended code
 
 .
 .  // IA specific code
 .
 strcpy( pszUserID, "LAUTZ" );
 strcpy( pszPassword, "MYPASSWD");
 strcpy( pszDatabaseName, "CATALOG");
 
 rc = FLGInit (pszUserName,
               pszPassword,
               pszDatabaseName,
               admin,
               ppListStruct,
               &ExtCode );
 
 .  // Issue FLGFreeMem to release the output structure created by FLGInit
 .  // Calls to the FLG API
 .  // When complete, call
 .  // FLGTerm()
 

Figure 85 shows the output structure.

Figure 85. Sample output structure for FLGInit


Figure FLAA2024 not displayed.


[ Top of Page | Previous Page | Next Page ]