gtpc2mi1C/C++ Language Support User's Guide

TO2_removeBrowseKey-Remove the Element Using the Specified Key

This function locates the entry represented by the specified key and removes the entry from the dictionary. The passed key string is assumed to be 64 bytes long.

Format

#include <c$to2.h>
long TO2_removeBrowseKey (      TO2_ENV_PTR  env_ptr,
                          const void        *key);

env_ptr
The pointer to the environment as returned by the TO2_createEnv function.

key
The pointer to the EBCDIC key to use to locate the dictionary entry. The passed key string is assumed to be 64 bytes long.

Normal Return

The normal return is a positive value.

Error Return

An error return is indicated by a zero. When zero is returned, use the TO2_getErrorCode function to determine the specific error code. For more information, see Error Handling.

Programming Considerations

A commit scope will be created for the TO2_removeBrowseKey request. If the request is successful, the scope will be committed. If an error occurs while processing the TO2_removeBrowseKey request, the scope will be rolled back.

Examples

The following example removes the entry associated with the key provided from the dictionary.

#include <c$to2.h>             /* Needed for TO2 API functions     */
#include <stdio.h>             /* APIs for standard I/O functions  */
 
long         err_code;
TO2_ENV_PTR  env_ptr;          /* Pointer to TO2 environment       */
char         *key;

  ·
  ·
  ·
if (TO2_removeBrowseKey(env_ptr, key)== TO2_ERROR) { err_code = TO2_getErrorCode(env_ptr); { printf("TO2_removeBrowseKey failed!\n"); process_error(env_ptr); } else { printf("TO2_removeBrowseKey successful!\n"); } }

Related Information