Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

DELETE-ELEMENT

The DELETE-ELEMENT statement deletes the specified members in the assigned library (logical deletion). The directory entries are thereby deleted and storage space is released.

A member of a library is deleted physically

  • if the member contains a code for physical deletion

  • if the operand DESTROY=*YES has been set

  • if the class 2 option DESTLEV requires it.

Delta members are not physically deleted until the last delta member of a delta tree, i.e. the complete delta tree, is deleted.

The statement is executed only if a library has been specified explicitly in the statement or the library specified under OPEN-LIBRARY has been opened with MODE=*UPDATE.

The DELETE-ELEMENT statement is permitted for all member types.

 

DELETE-ELEMENT

ELEMENT = *LIB RARY -ELEM ENT (...)


*LIBRARY-ELEMENT(...)



|

LIBRARY = *STD / <filename 1..54 without-vers> / *LINK(...)



|


*LINK(...)



|



|

LINK-NAME = <structured-name 1..8>



|

,ELEMENT = *ALL(...) / <composed-name 1..64 with-under with-wild(132)>(...)



|


*ALL(...)



|



|

VERSION = *HIGH EST -EXIST ING / *ALL / *UPPER-LIMIT /



|



|


<composed-name 1..24 with-under with-wild(52)>



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|


<composed-name 1..64 with-under with-wild(132)>(...)



|



|

VERSION = *HIGH EST -EXIST ING / *ALL / *UPPER-LIMIT /



|



|


<composed-name 1..24 with-under with-wild(52)>



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>



|

,TYPE = *LMS-DEF AULT / *ALL / <alphanum-name 1..8 with-wild(20)>



|

,USER-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|


*INTERVAL(...)



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|

,TO = *TODAY / <date 8..10 with-compl>



|

,CREATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|


*INTERVAL(...)



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|

,TO = *TODAY / <date 8..10 with-compl>



|

,MODIFICATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)



|


*INTERVAL(...)



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>



|



|

,TO = *TODAY / <date 8..10 with-compl>


|

,EXCEPT-ELEMENT = *NONE / *ELEMENT(...)


|


*ELEMENT(...)


|



|

ELEMENT = *ANY (...) / <composed-name 1..64 with-under with-wild(132)>(...)


|



|


*ANY(...)


|



|



|

VERSION = *ANY / *HIGHEST-EXISTING / *UPPER-LIMIT /


|



|



|


<composed-name 1..24 with-under with-wild(52)>


|



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>


|



|


<composed-name 1..64 with-under with-wild(132)>(...)


|



|



|

VERSION = *ANY / *HIGHEST-EXISTING / *UPPER-LIMIT /


|



|



|


<composed-name 1..24 with-under with-wild(52)>


|



|



|

,BASE = *STD / <composed-name 1..24 with-under with-wild>


|



|

,TYPE = *ANY / *LMS-DEFAULT / <alphanum-name 1..8 with-wild(20)>


|



|

,USER-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)


|



|


*INTERVAL(...)


|



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>


|



|



|

,TO = *TODAY / <date 8..10 with-compl>


|



|

,CREATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)


|



|


*INTERVAL(...)


|



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>


|



|



|

,TO = *TODAY / <date 8..10 with-compl>


|



|

,MODIFICATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)


|



|


*INTERVAL(...)


|



|



|

FROM = 1900-01-01 / <date 8..10 with-compl>


|



|



|

,TO = *TODAY / <date 8..10 with-compl>

,DESTROY-DATA = *LMS-DEF AULT / *NO / *YES

,DIALOG-CONTROL = *LMS-DEF AULT / *NO / *YES

ELEMENT = *LIBRARY-ELEMENT(...)

Specifies the member to be deleted.

LIBRARY = *STD / <filename 1..54 without-vers> / *LINK(...)
Specifies the library from which the member is to be deleted.

LIBRARY = *STD
The library opened by OPEN-LIBRARY.

LIBRARY = <filename 1..54 without-vers>
Name of the library from which the member is to be deleted.

LIBRARY = *LINK(...)
The library assigned via the link name.

LINK-NAME = <structured-name 1..8>
Link name of the library; this name was defined by means of a /ADD-FILE-LINK command prior to calling LMS.

ELEMENT = *ALL(...) / <composed-name 1..64 with-under with-wild(132)>(...) Name of the member to be deleted.

VERSION = *HIGHEST-EXISTING / *ALL / *UPPER-LIMIT /
<composed-name 1..24 with-under with-wild(52)>
Version of the member to be deleted.

VERSION = *HIGHEST-EXISTING
The member with the highest existing version with reference to BASE is deleted.

VERSION = *UPPER-LIMIT
The highest possible version X’FF’ in the library under the specified TYPE and name is deleted.

VERSION = <composed-name 1..24 with-under with-wild(52)>
Explicitly specifies the version of the member to be deleted.

BASE = *STD / <composed-name 1..24 with-under with-wild>
Prefix for the version selection. In conjunction with VERSION=*HIGHEST-
EXISTING, it is then possible to use a certain prefix to reference the highest existing version. BASE=*STD has the same effect as BASE=*. For further information concerning specification of the base, see "Version designations".

TYPE = *LMS-DEFAULT / *ALL / <alphanum-name 1..8 with-wild(20)> Type of the member to be deleted.

USER-DATE = *ANY /*TODAY / <date 8..10 with-compl> / *INTERVAL(...)Date given by the user.

USER-DATE = *ANY
The member to be deleted has any date.

USER-DATE = *TODAY

The member with the current date is deleted.

USER-DATE = <date 8..10 with-compl>
The member whose date is entered explicitly in the form [YY]YY-MM-DD is deleted.

USER-DATE = *INTERVAL(...)
All members lying in the specified interval are deleted.

FROM = 1900-01-01 / <date 8..10 with-compl>
Beginning of interval.

TO = *TODAY / <date 8..10 with-compl>
End of interval.

CREATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...) Creation date of the member. For a description of the operands, see the USER-DATE operand of this statement.

MODIFICATION-DATE = *ANY / *TODAY / <date 8..10 with-compl> / *INTERVAL(...)Date of the last modification to the member. For a description of the operands, see the USER-DATE operand of this statement.

EXCEPT-ELEMENT = *NONE / *ELEMENT(...)
Specifies the members to be excluded from the above selection.

EXCEPT-ELEMENT = *NONE
No members are excluded from deletion.

EXCEPT-ELEMENT = *ELEMENT(...)
Specifies the members that are to be excluded from deletion. A member is excluded when all the fields of the EXCEPT-ELEMENT structure that are not set to *ANY identify the member as a hit. If all the fields of the EXCEPT-ELEMENT structure are set to *ANY, then all members will be excluded.
For a description of the operands, see the LIBRARY-ELEMENT operand of this statement.

DESTROY-DATA = *LMS-DEFAULT / *NO / *YES
Deletes the data for all members defined by *LIBRARY-ELEMENT.

DESTROY-DATA = *NO
A member of a library is deleted physically only if it contains a flag for physical deletion or the class 2 option DESTLEV requires it.

DESTROY-DATA = *YES
Following logical deletion, the data, if present, is deleted physically, i.e. overwritten with X’00’.

DIALOG-CONTROL = *LMS-DEFAULT / *NO / *YES

This operand determines whether or not a dialog is to be conducted with the user during execution of a statement.

For more detailed information on dialog control, see the MODIFY-LMS-DEFAULTS statement, where the value *ERROR which might have been set there has the same effect as *NO. Likewise, the value *ERROR which may have been set for DIALOG-CONTROL= in the /SEND-MSG message command has the same effect as *NO with DELETE-ELEMENT.

Statement return code

(SC2)

SC1

Maincode

Meaning


2

0
0
1
32
64
64
64
64
64
130
130
130
130

CMD0001
LMS0129
CMD0230
LMS1002
LMS0302
LMS1003
LMS1004
PLA0229
PLA0233
LMS0041
LMS0411
LMS0412
LMS0413

No error
Statement aborted by user
Syntax error
Internal error
Member does not exist
Error during wildcard processing with at least one member or file
Other error
No access right for the member
Borrow status prevents member access
System address space exhausted
Library locked
Member locked
Type locked

Required access rights

Read and write authorization for LIBRARY
Administer authorization and write authorization for ELEMENT.

Notes

  • With each UPDATE to a delta tree the delta structure is reorganized, i.e. records no longer required are deleted and the storage space no longer required is released.

  • Deleting a main branch version having the convention STD-TREE on which side branch versions are dependent can lead to problems in subsequent copying.

Example

Member TEST3 is deleted from library LIB1.

/START-LMS
//OPEN-LIBRARY LIBL,MODE=*UPDATE
//SHOW-ELEMENT-ATTRIBUTES
TYP NAME     VER (VAR#) DATE         NAME     VER (VAR#) DATE
(D) LETTER.A @   (0001) 2012-04-12   TESTELEM @   (0001) 2012-04-12
       2 (D)-ELEMENT(S) IN THIS TABLE OF CONTENTS
TYP NAME  VER (VAR#) DATE
(S) TEST3 @   (0001) 2012-04-12
       1 (S)-ELEMENT(S) IN THIS TABLE OF CONTENTS
--------------------------------------------------------------------------
       3 ELEMENT(S) IN THIS TABLE OF CONTENTS
//DELETE-ELEMENT *LIB(ELEM=TEST§,TYPE=S)
//SHOW-ELEMENT-ATTRIBUTES
INPUT  LIBRARY= :1OSQ:$USER.LIB1
TYP NAME     VER (VAR#) DATE         NAME     VER (VAR#) DATE
(D) LETTER.A @   (0001) 2012-04-12   TESTELEM @   (0001) 2012-04-12
       2 (D)-ELEMENT(S) IN THIS TABLE OF CONTENTS
//END