gtpc2mh6C/C++ Language Support User's Guide

TO2_getCreateTime-Copy Created Time Stamp of the Collection

Whenever TPF collection support (TPFCS) creates a collection, it will time stamp the collection with the current time. This function copies the created time value from the specified collection and returns it in the field provided.

Format

#include <c$to2.h>
long  TO2_getCreateTime (const TO2_PID_PTR  pid_ptr,
                               TO2_ENV_PTR  env_ptr,
                               void        *timeRetPtr);

pid_ptr
A pointer to the persistent identifier (PID) of the collection whose created time is to be returned.

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

timeRetPtr
A pointer to an 8-byte field where the created time of the collection will be returned. The returned time is in System/390 time-of-day (TOD) clock format.

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_PID

TO2_ERROR_ZERO_PID

TO2_ERROR_DELETED_PID

TO2_ERROR_NOT_INIT

Programming Considerations

None.

Examples

The following example copies the created time value for the provided collection.

#include <c$to2.h>             /* Needed for TO2 API functions    */
long   getCreationTime(const TO2_PID_PTR   pid_ptr,
                             TO2_ENV_PTR   env_ptr,
                             double      * timeRetPtr)
/*                                                                */
/*    copy the create time value from the input collection        */
/*    and return it to the caller.                                */
/*    returns 0 if successful otherwise -1 if an error occurs.    */
/*                                                                */
{

  ·
  ·
  ·
if (TO2_getCreateTime(pid_ptr, env_ptr, timeRetPtr) == TO2_ERROR) { process_error(env_ptr); return -1; } return 0; }

Related Information

None.