Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Deleting a catalog entry

The catalog entry is automatically deleted when the related file is erased. However, erasing the file contents and deleting the catalog entry can be carried out separately with the various functions of the appropriate macro or command. Erasing the file contents without deleting the catalog entry is also called “logical erasure” of the file (see "Deleting a catalog entry"), while deleting the catalog entry without releasing the storage space is called “file export” (see "Deleting a catalog entry").

The following tables show overviews of the functions of the ERASE macro and the DELETE-FILE and EXPORT-FILE commands for deleting catalog entries.

ERASE macro

Operands

Macro version number

Destroy
data1)

Deleting a catalog entry

belegten Speicherplatz freigeben

Delete logically2)

Comments

„pathname“

0 – 3


yes

yes



SPACE-CATALOG

1 – 3


yes

yes


Default function

DESTROY

0 – 3

yes

yes

yes


Physical data destruction

DATA

0 – 3




yes

File is “logically erased”

DATA-KEEP-ATTR

3




yes

File-specific attributesare retained

SPACE

0 – 3



yes


Only for pubset files

CATALOG

0 – 3


yes



“Private” file is exported

CATALOG, VOLUME

0


(yes)

(yes)


Volume is exported

DELETE-OR-EXPORT

1 – 3


(yes)

(yes)


Effect depends on volume type

DELETE-OR-EXPORT, VOLUME

1 – 3


(yes)

(yes)


Volume is exported

1) If the catalog entry contains DESTROY=NO.

2) “Logical erasure” = Resetting the Last-Page Pointer

Table 6: Functions of the ERASE macro
DELETE-FILE command

Operands

Destroy
data1)

Deleting a catalog entry

Release allocated storage space

Delete
logically2)

Comments

FILE-NAME


yes

yes



OPTION=ALL


yes

yes


Default function

OPTION=DESTROY-ALL

yes

yes

yes



OPTION=DATA




yes

File is “logically erased”

OPTION=SPACE



yes


Only for pubset files

OPTION=DATA-KEEP-ATTRIBUTES




yes

File-specific attributes are retained

1) If the catalog entry contains DESTROY=NO.

2) “Logical erasure” = Resetting the Last-Page Pointer

Table 7: Functions of the DELETE-FILE command
EXPORT-FILE command

Operands

Deleting a catalog entry

Comments

FILE-NAME

yes

File on private disk or Net-Storage volume of type NETSTOR is exported.
File on Net-Storage volume of type NETVOL cannot be exported, because there is no file catalog (BS2FSCAT) on the Net-Storage volume.

Table 8: Functions of the EXPORT-FILE command
EXPORT-NODE-FILE command

Operands

Deleting a catalog entry

Comments

FILE-NAME

yes

Node file (on Net-Storage volume) is exported

Table 9: Functions of the EXPORT-NODE-FILE command

Node files are cataloged with the IMPNFIL macro or with the IMPORT-NODE-FILE command.

Erasing a file

The default function of the ERASE macro and the DELETE-FILE command depends on the type of volume. For disk files, the default value is “release allocated space and delete catalog entry”; in addition, the user can have the released space overwritten, see section"Data protection by "data destruction" (DESTROY option)"). For tape files, the default is “delete catalog entry”, which is equivalent to exporting the volume.

Destruction of data when the file is erased can be requested in the macro or command call, or can be specified previously in the catalog entry:

  • Operand DESTROY = YES in the CATAL macro

  • Operand PROTECTION...DESTROY-BY-DELETE in the CREATE-FILE and MODIFY-FILE-ATTRIBUTES commands

“Logically erasing” a file

The catalog entry and the allocated storage space are retained; the pointer to the last PAM page which was written (highest-used page) is simply reset to 0. The data still exists on the disk, but the user can no longer read it, since physical access to volumes is not permitted. The contents of the fields CRE-DATE and HIGH-US-PA in the catalog entry for a logically erased file are the same as for a file newly created by means of FILE (macro) or CREATE-FILE (command). A file may also be regarded as “logically erased” if it is (re-)opened with OPEN OUTPUT and then immediately closed again: the old file contents still exist, but the user can no longer access them. However, both in the case of OPEN OUTPUT and when erasing with the operand value DATA-KEEP-ATTR the file-specific attributes in the catalog entry are retained.

File export

The catalog entry is deleted, but the storage space and the data are retained. Files on private volumes or Net-Storage volumes of type NETSTOR can be removed from a system in this manner. They can be imported again, into the same or another system, at any time (by means of the IMPORT macro or the IMPORT-FILE command; see section "Creates a catalog entry"). Node files are imported with the IMPNF macro or with the IMPORT-NODE-FILES command.

Files are exported with the ERASE macro (DELETE-OR-EXPORT or CATALOG operand) or the EXPORT-FILE command. If the VOLUME operand is specified together with the macro operands or the command (permitted only for disk files), all files on this volume are exported.