gtpc2mgp | C/C++ Language Support User's Guide |
This function creates a data definition (DD) and stores it in the data store (DS) dictionary.
Format
#include <c$to2.h> long TO2_createDD ( TO2_ENV_PTR env_ptr, const char DDname[TO2_MAX_DDNAME], const char dsname[TO2_MAX_DSNAME], const TO2_OPTION_PTR optionListPtr);
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 code is common for this function:
TO2_ERROR_LOCATOR_NOT_UNIQUE
Programming Considerations
A commit scope will be created for the TO2_createDD request. If the request is successful, the scope will be committed. If an error occurs while processing the TO2_createDD request, the scope will be rolled back.
Examples
The following example converts the class name provided into a class index.
#include <c$to2.h> /* Needed for TO2 API functions */ long err_code; TO2_ENV_PTR env_ptr; /* Pointer to TO2 environment */ char DDname[32]; char dsname[8]; TO2_OPTION_PTR optionListPtr
·
·
·
if (TO2_createDD(env_ptr, DDname, dsname, optionListPtr) == TO2_ERROR) { err_code = TO2_getErrorCode(env_ptr); { printf("TO2_createDD failed!\n"); process_error(env_ptr); } else { printf("TO2_createDD successful!\n"); } }
Related Information