Python API ztypes module

The zoautil_py.ztypes module contains the following auxiliary objects that are used by multiple ZOAU utilities.

  • ZOAUResponse
  • DataDefinition
  • DatasetDefinition
  • DDStatement
  • FileDefinition

Classes


class zoautil_py.ztypes.ZOAUResponse(rc, stdout_response, stderr_response, command)


Description

  • ZOAU shell command execution response.

  • Bases: object

  • Defined in: zoautil_py.ztypes

Parameters

  • rc (int) - The Return Code of the executed command.

  • stdout_response (str) - The standard_out of the executed command.

  • stderr_response (str) - The standard_out of the executed command.

  • command (str) - Full command string, including options and arguments.

  • response_format (str) - Encoding label of the payload contents. For example "utf-8".

Other methods

  • to_dict()

    • Description: Converts zoautil_py.ztypes.ZOAUResponse object to dictionary.

    • Returns: Dictionary including these keys:  rc, stdout_response, stderr_response, and command.

    • Return type: dict



class zoautil_py.ztypes.DataDefinition(name)


Description

  • Base definition of a DD to use with mvscmd.

  • Bases: object

  • Defined in: zoautil_py.ztypes

Parameters

  • name (str) - Name of a dataset or path to a zFS file.


class zoautil_py.ztypes.DatasetDefinition(dataset_name, disposition='SHR', type=None, primary=None, primary_unit=None, secondary=None, secondary_unit=None, normal_disposition=None, abnormal_disposition=None, conditional_disposition=None, block_size=None, record_format=None, record_length=None, storage_class=None, data_class=None, management_class=None, key_length=None, key_offset=None, volumes=None, dataset_key_label=None, key_label1=None, key_encoding1=None, key_label2=None, key_encoding2=None)


Description

  • Definition of z/OS dataset.

  • Bases: zoautil_py.ztypes.DataDefinition

  • Defined in: zoautil_py.ztypes

Parameters (All dataset attributes)

  • dataset_name (str) - Name of the dataset.

  • disposition (str) - The status of a data set, and what to do with the data set after termination of the step or job. May be one of OLD/EXCL, SHR, NEW, MOD. Default is SHR.

  • type (str) - May be one of: KSDS, ESDS, RRDS, LDS, SEQ/BASIC, LARGE, PDS, PDSE/LIBRARY, HFS. Default is PDSE.

  • primary (str) - Amount of primary space to allocate for the dataset. Default is 5 units of primary_unit.

  • primary_unit (str) - May be K or KB (kilobytes), M or MB (megabytes), G or GB (gigabytes), C or CYL (cylinders), T or TRK (tracks). Default is M.

  • secondary (str) - Amount of secondary space to allocate for the dataset. Defaults to 1/10 of primary space.

  • secondary_unit (str) - May be K or KB (kilobytes), M or MB (megabytes), G or GB (gigabytes), C or CYL (cylinders), T or TRK (tracks).

  • normal_disposition (str) - What to do with the data set after normal termination of the program. May be one of DELETE, PASS, CATALOG, UNCATALOG.

  • abnormal_disposition (str) - What to do with the data set after normal termination of the program. May be one of DELETE, CATALOG, UNCATALOG.

  • block_size (str) - Block size of the dataset. Default is one of:

    • 32718 for record format FBA
    • 32720 for FB
    • 32743 for VBA
    • 32760 for VB and U
  • record_format (str) - Record format for the dataset. May be one of F, FB, VB, FBA, VBA, U. Default is FB.

  • record_length (str) - Record length specified in bytes. Default is one of:

    • 80 for fixed datasets (FB, FBA)
    • 137 for variable datasets (VB, VBA)
    • 0 for unformatted datasets (U) For variable datasets, the length must include the 4-byte prefix area.
  • storage_class (str) - The storage class for an SMS-managed dataset. Required for SMS-managed datasets that do not match an SMS-rule. Not valid for datasets that are not SMS-managed.

  • data_class (str) - The data class for an SMS-managed dataset. Optional for SMS-managed datasets that do not match an SMS-rule. Not valid for datasets that are not SMS-managed.

  • management_class (str) - The management class for an SMS-managed dataset. Optional for SMS-managed datasets that do not match an SMS-rule. Not valid for datasets that are not SMS-managed.

  • key_length (str) - Length of the key for Key Sequenced Datasets (KSDS).

  • key_offset (str) - Offset of the key for Key Sequenced Datasets (KSDS).

  • volumes (str) - A list of comma separated volume serials. When providing multiple volumes, processing will begin with the first volume in the provided list. Offline volumes are not considered. Volumes can always be provided when not using SMS.

  • dataset_key_label (str) - The label for the encryption key used by the system to encrypt the data set. Only applicable when using encrypted datasets.

  • key_label1 (str) - The label for the key encrypting key used by the Encryption Key Manager. Only applicable when using encrypted datasets.

  • key_encoding1 (str) - How the label for the key encrypting key (key_label1) is encoded by the Encryption Key Manager. May be one of: L, H Only applicable when using encrypted datasets.

  • key_label2 (str) - The label for the key encrypting key used by the Encryption Key Manager. Only applicable when using encrypted datasets.

  • key_encoding2 (str) - How the label for the key encrypting key (key_label2) is encoded by the Encryption Key Manager. May be one of: L, H Only applicable when using encrypted datasets.



class zoautil_py.ztypes.DDStatement(name, definition)


Description

  • DDStatement for use with zoautil_py.mvscmd.execute and similar functions.

  • Bases: object

  • Defined in: zoautil_py.ztypes

Parameters

  • name (str) – DD name

  • definition (DatasetDefinition or FileDefinition or str or list[DatasetDefinition]) – Additional arguments and options for DDStatement. To specify a concatenation of datasets, use list[DatasetDefinition].



class zoautil_py.ztypes.FileDefinition(path_name, normal_disposition=None, abnormal_disposition=None, path_mode=None, status_group=None, file_data=None, record_length=None, block_size=None, record_format=None)


Description

  • Definition of an HFS file.

  • Bases: zoautil_py.ztypes.DataDefinition

  • Defined in: zoautil_py.ztypes

Parameters (all HFS file attributes)

  • path_name (str) - Full path to the zFS file. This is case-sensitive, between 1 and 255 characters long, and must be an absolute path.

  • normal_disposition (str) - What to do with the UNIX file after normal termination of the program. May be one of KEEP, DELETE.

  • abnormal_disposition (str) - What to do with the UNIX file after abnormal termination of the program. May be one of KEEP, DELETE.

  • path_mode (str) - The file access attributes for the UNIX file being allocated. Provide in chmod-like number format. (e.g. 0644, 1777)

  • status_group (str) - The file access attributes for zFS file being allocated. Specify up to 6 of: OCREAT, OEXCL, OAPPEND, ORDWR, ORDONLY, OWRONLY, ONOCTTY, ONONBLOCK, OSYNC, OTRUNC. Provide multiple attributes as a comma-separated list.

  • file_data (str) - The type of data that is (or will be) stored in the zFS file. May be one of BINARY, TEXT, RECORD.

  • record_length (str) - Use the specified logical record length for the zFS file being allocated. This is required in situations where the data will be processed as records and therefore, the record length, block size and record format need to be supplied since a zFS file would normally be treated as a stream of bytes.

  • block_size (str) - Use the specified block size for the zFS file being allocated since a zFS file would normally be treated as a stream of bytes.

  • record_format (str) - Use the specified record format for the zFS file being allocated since a zFS file would normally be treated as a stream of bytes.