Delete

Delete a data set profile.

DataSetAdmin.delete()

def delete(
    self, data_set: str, volume: Union[str, None] = None, generic: bool = False
) -> Union[dict, bytes]:

📄 Description

Delete a data set profile.

📥 Parameters

  • data_set
    The name of the data set profile being deleted.

  • volume
    A single volume name for this data set profile. This argument is optional. If generic=True is specified, volume is ignored.

  • generic
    A bool indicating whether to treat this profile as generic or not. This argument is optional and defaults to False.

📤 Returns

  • Union[dict, bytes]
    Returns a Security Result dictionary or Security Request XML bytes if the DataSetAdmin.generate_requests_only class attribute is set to True.

❌ Raises

  • SecurityRequestError
    Raises SecurityRequestError when the SAF Return Code of a Security Result is equal to 4.
  • DownstreamFatalError
    Raises DownstreamFatalError when the SAF Return Code of a Security Result is greater than 4.

💻 Example

Python REPL
>>> from pyracf import DataSetAdmin
>>> data_set_admin = DataSetAdmin()
>>> data_set_admin.delete("ESWIFT.TEST.T1136242.P3020470")
{"securityResult":{"dataSet":{"name":"ESWIFT.TEST.T1136242.P3020470","operation":"del","generic":"no","requestId":"DatasetRequest","commands":[{"safReturnCode":0,"returnCode":0,"reasonCode":0,"image":"DELDSD               ('ESWIFT.TEST.T1136242.P3020470')"}]},"returnCode":0,"reasonCode":0}}
Security Result Dictionary as JSON
{
  "securityResult": {
    "dataSet": {
      "name": "ESWIFT.TEST.T1136242.P3020470",
      "operation": "del",
      "generic": "no",
      "requestId": "DatasetRequest",
      "commands": [
        {
          "safReturnCode": 0,
          "returnCode": 0,
          "reasonCode": 0,
          "image": "DELDSD               ('ESWIFT.TEST.T1136242.P3020470')"
        }
      ]
    },
    "returnCode": 0,
    "reasonCode": 0,
    "runningUserid": "testuser"
  }
}