gtpc2mgeC/C++ Language Support User's Guide

TO2_removeDSsystemKey-Remove the Element Using the Key

This function locates the entry in the data store (DS) system dictionary and removes it from the dictionary. The passed key is assumed to be 64 bytes in length.

Format

#include <c$to2.h>
long  TO2_removeDSsystemKey (      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 is assumed to be 64 bytes in length.

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.

The following error codes are common for this function:

TO2_ERROR_ENV

TO2_ERROR_LOCATOR_NOT_FOUND

Programming Considerations

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

Examples

The following example removes an element from the TPFCS class dictionary for the specified data store.

#include <c$to2.h>                /* Needed for TO2 API functions     */
#include <stdio.h>                /* APIs for standard I/O functions  */
 
TO2_ENV_PTR      env_ptr;         /* Pointer to TO2 Environment       */
 
char key[64]
= "Dictionary.System.Key                                             ";
 
TO2_ERR_CODE     err_code;        /* TO2 error code value             */
TO2_ERR_TEXT_PTR err_text_ptr;    /* TO2 error code text pointer      */

  ·
  ·
  ·
if (TO2_removeDSsystemKey(env_ptr, key) == TO2_ERROR) { printf("TO2_removeDSsystemKey failed!\n"); err_code = TO2_getErrorCode(env_ptr); err_text_ptr = TO2_getErrorText(env_ptr, err_code); printf("err_text_ptr is %s\n", err_text_ptr); } else printf("TO2_removeDSsystemKey successful!\n");
  ·
  ·
  ·

Related Information