dynfree() — Deallocate a data set

Standards

Standards / Extensions C or C++ Dependencies
C Library both  

Format

#include <dynit.h>

int dynfree(__dyn_t *dyn_parms);

General description

Dynamically deallocates a z/OS data set in accordance with the attributes defined in dyn_parms.

To avoid infringing on the user's name space, this nonstandard function has two names. One name is prefixed with two underscore characters, and one name is not. The name without the prefix underscore characters is exposed only when you use LANGLVL(EXTENDED).

To use this function, you must either invoke the function using its external entry point name (that is, the name that begins with two underscore characters), or compile with LANGLVL(EXTENDED). When you use LANGLVL(EXTENDED) any relevant information in the header is also exposed.

The only fields in __dyn_t that are used by dynfree() are:
  • char *__ddname
  • char *__dsname
  • char *__member
  • char *__pathname
  • char __normdisp
  • char __pathndisp
  • char **__miscitems

If any other fields are specified, they will be ignored. For more information on the __dyn_t structure, see Table 1

To dynamically deallocate a data set on z/OS, you should:
  • Invoke dyninit() with a variable of type __dyn_t
  • Assign values to the appropriate fields that will satisfy the svc99() request
  • Invoke dynfree() with this variable.
Note: The dynfree() function has a dependency on the level of the Enhanced ASCII Extensions. See Enhanced ASCII support for details.

Returned value

If successful under z/OS, dynfree() returns 0.

If unsuccessful, dynfree() returns nonzero. dynfree() returns -1 if there is not sufficient storage to process all the text units.

Example

/*
   This example dynamically deallocates a data set.
 */
#include <dynit.h>

int main(void) {
⋮
  __dyn_t ip;
⋮
  dyninit(ip);
  ip.__ddname = "mydd";
⋮
  dynfree(&ip);
}

Related information