Python API gdgs module
The zoautil_py.gdgs
module contains utilities to interact with z/OS generation data groups (GDG). This module has classes and functions.
Classes
This module contains a single GenerationDataGroupView
class with its own methods.
class zoautil_py.gdgs.GenerationDataGroupView(name:str)
Description
- This class provides an interface to a z/OS generation data group.
- The class supports the iterator protocol by yielding the active generation data sets in a GDG snapshot. The GDG base is not protected while iterating. Use a batch job if you need to serialize the group.
Parameters
- name (str) - Name of the generation data group.
Members
The following class members are read only:
name
(str) - Name of the generation data group.limit
(int) - Maximum number of active generations in the group.scratch
(bool) - True if the GDG has the SCRATCH attribute. False if the GDG has the NOSCRATCH attribute.empty
(bool) - True if the GDG has the EMPTY attribute. False if the GDG has the NOEMPTY attribute.order
(str) - Determines the allocation order of the generation data sets during GDG ALL requests.purge
(bool) - True if the GDG has the PURGE attribute. False if the GDG has the NOPURGE attribute.extended
(bool) - True if the GDG has the EXTENDED attribute. False if the GDG has the NOEXTENDED attribute.
For a description of the GDG attributes, see z/OS DFSMS Access Method Services Commands under define generation data group optional parameters.
Methods
- generations() ((datasets.Dataset))
- Gets a snapshot of the active generation data sets in the GDG.
- Returns
- Tuple - Tuple of
Dataset
objects. Snapshot of the active generation data sets.
- delete() (None)
- Deletes the generation data group and all its active generation data sets.
- clear() (None)
- Deletes all the active generation data sets in the GDG.
Functions
The gdgs
module provides functions for interacting with z/OS generation data groups.
zoautil_py.gdgs.create(name: str, limit: int, *, empty:bool=False, scratch:bool=False, purge:bool=False, extended:bool=False, fifo:bool=False)
Description
- Creates a GDG base.
Returns
GenerationDataGroupView
object.
Parameters
-
name
(str) – Name of the GDG base being defined. -
limit
(int) – Maximum number of generation data sets the GDG can contain. -
empty
(bool) - If True, creates a GDG with the EMPTY attribute. NOEMPTY when False. -
scratch
(bool) - If True, creates a GDG with the SCRATCH attribute. NOSCRATCH when False. -
purge
(bool) - If True, creates a GDG with the PURGE attribute. NOPURGE when False. -
extended
(bool) - If True, creates a GDG with the EXTENDED attribute. NOEXTENDED when False. -
fifo
(bool) - If True, creates a GDG with the FIFO attribute. NOFIFO when False.
Notes
- For a description of the GDG attributes, see z/OS DFSMS Access Method Services Commands under define generation data group optional parameters.
zoautil_py.gdgs.list_gdg_names(pattern:str) ([str])
Description
- Lists the GDG names matching the supplied pattern.
Returns
- list - List of matching GDG names.
Parameters
pattern
(str) – The GDG pattern to search.
Raises
GenerationDataGroupFetchException
– See message for details.
zoautil_py.gdgs.exists(name:str) (bool)
Description
- Check if a GDG exists.
Returns
- True if the GDG was found; False otherwise.
Raises
GenerationDataGroupFetchException
– See message for details.
Parameters
name
(str) – The GDG to check for.