gtpc2mgvC/C++ Language Support User's Guide

TO2_deleteDD-Delete a Data Definition

This function deletes the data definition (DD).

Format

#include <c$to2.h>
long  TO2_deleteDD (      TO2_ENV_PTR env_ptr,
                    const char        DDname[TO2_MAX_DDNAME],
                    const char        dsname[TO2_MAX_DSNAME]);

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

DDname
The pointer to a character string, which is the name of the DD being deleted. The character string is assumed to be 32 characters in length. The name should be left-justified and padded with blanks (X'40') on the right if it less than 32 characters.

dsname
The pointer to a character string, which is the data store (DS) name for the DD being deleted. The character string must be 8 characters or greater in length, left-justified, and padded with blanks (X'40') on the right.

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_DD_NOT_FOUND

TO2_ERROR_LOCATOR_NOT_FOUND

Programming Considerations

Examples

The following example deletes a data store with the name indicated.

#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         DDname[32];
char         dsname[8];

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

Related Information