Initial population of a data store

When a data store is first created, the startup flow for an application that initially populates the data store could be as follows:
  1. Create the environment using the target data store name on the TO2_createEnv function.
  2. Create a recoup index for the application dictionary using the TO2_createRecoupIndex function.
  3. Add a recoup index entry to the index describing how PIDs are stored in the dictionary using the TO2_addRecoupIndexEntry function.
  4. Get the PID of the application dictionary using the TO2_getDSdictPID function.
  5. Associate the recoup index with the dictionary by using the TO2_associateRecoupIndexWithPID function (see z/TPF Database User's Guide for more information).
  6. Create an anchor collection using a TO2_create... function.
  7. Store the PID of the anchor collection in the application dictionary by using the TO2_atDSdictNewKeyPut function. The key could be a symbolic name for the collection or any other value.
  8. Optionally assign a name to the collection so that the collection can be easily accessed with the browser functional messages by using the TO2_defineBrowseNameForPID function. Consider using the same symbolic name used to store the PID in the application dictionary.
Optionally, you can associate particular applications with this data store by doing the following:
  1. Create an environment using TPFDB as the data store name.
  2. For each application that will use this data store, store the data store name in the z/TPF application dictionary using the TO2_atTPFNewKeyPut function with the name of the application as the key.
  3. Enter a TO2_deleteEnv call to delete the environment.