298
298
type: bool
299
299
required: false
300
300
default: false
301
+ noscratch:
302
+ description:
303
+ - "For C(state=absent), specifies whether to keep the data set's entry in the VTOC."
304
+ - If C(noscratch=True), the data set is uncataloged but not physically removed from the volume. The DSCB is not removed from the VTOC.
305
+ - This is the equivalent of using C(NOSCRATCH) in an C(IDCAMS DELETE) command.
306
+ type: bool
307
+ required: false
308
+ default: false
301
309
volumes:
302
310
description:
303
311
- >
575
583
type: bool
576
584
required: false
577
585
default: false
586
+ noscratch:
587
+ description:
588
+ - "For C(state=absent), specifies whether to keep the data set's entry in the VTOC."
589
+ - If C(noscratch=True), the data set is uncataloged but not physically removed from the volume.
590
+ The DSCB is not removed from the VTOC.
591
+ - This is the equivalent of using C(NOSCRATCH) in an C(IDCAMS DELETE) command.
592
+ type: bool
593
+ required: false
594
+ default: false
578
595
extended:
579
596
description:
580
597
- Sets the I(extended) attribute for Generation Data Groups.
734
751
name: someds.name.here
735
752
state: absent
736
753
754
+ - name: Uncatalog a data set but do not remove it from the volume
755
+ zos_data_set:
756
+ name: someds.name.here
757
+ state: absent
758
+ noscratch: true
759
+
737
760
- name: Delete a data set if it exists. If data set not cataloged, check on volume 222222 for the data set, and then catalog and delete if found.
738
761
zos_data_set:
739
762
name: someds.name.here
@@ -1404,7 +1427,7 @@ def get_data_set_handler(**params):
1404
1427
)
1405
1428
1406
1429
1407
- def perform_data_set_operations (data_set , state , replace , tmp_hlq , force ):
1430
+ def perform_data_set_operations (data_set , state , replace , tmp_hlq , force , noscratch ):
1408
1431
"""Calls functions to perform desired operations on
1409
1432
one or more data sets. Returns boolean indicating if changes were made.
1410
1433
@@ -1439,7 +1462,7 @@ def perform_data_set_operations(data_set, state, replace, tmp_hlq, force):
1439
1462
elif state == "absent" and data_set .data_set_type == "gdg" :
1440
1463
changed = data_set .ensure_absent (force = force )
1441
1464
elif state == "absent" :
1442
- changed = data_set .ensure_absent (tmp_hlq = tmp_hlq )
1465
+ changed = data_set .ensure_absent (tmp_hlq = tmp_hlq , noscratch = noscratch )
1443
1466
elif state == "cataloged" :
1444
1467
changed = data_set .ensure_cataloged (tmp_hlq = tmp_hlq )
1445
1468
elif state == "uncataloged" :
@@ -1586,6 +1609,11 @@ def parse_and_validate_args(params):
1586
1609
required = False ,
1587
1610
default = False ,
1588
1611
),
1612
+ noscratch = dict (
1613
+ type = "bool" ,
1614
+ required = False ,
1615
+ default = False ,
1616
+ ),
1589
1617
),
1590
1618
),
1591
1619
# For individual data set args
@@ -1676,6 +1704,11 @@ def parse_and_validate_args(params):
1676
1704
required = False ,
1677
1705
default = False ,
1678
1706
),
1707
+ noscratch = dict (
1708
+ type = "bool" ,
1709
+ required = False ,
1710
+ default = False ,
1711
+ ),
1679
1712
mutually_exclusive = [
1680
1713
["batch" , "name" ],
1681
1714
# ["batch", "state"],
@@ -1788,6 +1821,11 @@ def run_module():
1788
1821
required = False ,
1789
1822
default = False ,
1790
1823
),
1824
+ noscratch = dict (
1825
+ type = "bool" ,
1826
+ required = False ,
1827
+ default = False ,
1828
+ ),
1791
1829
),
1792
1830
),
1793
1831
# For individual data set args
@@ -1868,6 +1906,11 @@ def run_module():
1868
1906
required = False ,
1869
1907
default = False
1870
1908
),
1909
+ noscratch = dict (
1910
+ type = "bool" ,
1911
+ required = False ,
1912
+ default = False
1913
+ ),
1871
1914
)
1872
1915
result = dict (changed = False , message = "" , names = [])
1873
1916
@@ -1895,6 +1938,8 @@ def run_module():
1895
1938
module .params ["replace" ] = None
1896
1939
if module .params .get ("record_format" ) is not None :
1897
1940
module .params ["record_format" ] = None
1941
+ if module .params .get ("noscratch" ) is not None :
1942
+ module .params ["noscratch" ] = None
1898
1943
elif module .params .get ("type" ) is not None :
1899
1944
if module .params .get ("type" ) in DATA_SET_TYPES_VSAM :
1900
1945
# For VSAM types set the value to nothing and let the code manage it
@@ -1921,6 +1966,7 @@ def run_module():
1921
1966
replace = data_set_params .get ("replace" ),
1922
1967
tmp_hlq = data_set_params .get ("tmp_hlq" ),
1923
1968
force = data_set_params .get ("force" ),
1969
+ noscratch = data_set_params .get ("noscratch" ),
1924
1970
)
1925
1971
result ["changed" ] = result ["changed" ] or current_changed
1926
1972
except Exception as e :
0 commit comments