gtpc2mh3C/C++ Language Support User's Guide

TO2_getCollectionAttributes-Get the Attributes of the Collection

This function returns a sequence collection of the EBCDIC names of the attributes of the collection and their current values.

Format

#include <c$to2.h>
long  TO2_getCollectionAttributes (const TO2_PID_PTR  pid_ptr,
                                         TO2_ENV_PTR  env_ptr,
                                         TO2_PID_PTR  retn_pid_ptr);

pid_ptr
The pointer to the persistent identifier (PID) of the collection whose attributes will be returned in a sequence collection.

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

retn_pid_ptr
The pointer to where to return the temporary PID assigned to the sequence collection of attributes.

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

None.

Examples

The following example retrieves the sequence collection of method names for the data store (DS) 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      */
TO2_PID      pid_ptr,
TO2_PID      retn_pid_ptr;

  ·
  ·
  ·
if (TO2_getCollectionAttributes(&collect, env_ptr, &retn_pid_ptr) == TO2_ERROR) { err_code = TO2_getErrorCode(env_ptr); { printf("TO2_getCollectionAttributes failed!\n"); process_error(env_ptr); } else { printf("TO2_getCollectionAttributes successful!\n"); } }

Related Information

TO2_getClassNames-Convert EBCDIC Class Name to Index.