EDELETE

Deletes selected items from a file based on an item-list or selection criteria.

Syntax

EDELETE file-specifier [ item-list | selection-criteria ] {(options}

Refer to Sentence Structure for descriptions of these parameters.

Special Options

C{n} Display running counters of the number of items selected and items processed. The counter display is refreshed after every n items processed (default 500) or after the total number of items if less than 500. For example, (C25) refreshes the display after every 25 items processed.

G{n} Completes once n items have been deleted (default 500), or the end of the file is reached, whichever occurs first.

I Lists item-ids selected.

Note

You cannot use C and I options at the same time. If you specify both, the I option takes precedence.

Comments

EDELETE requires at least an item-list or selection criteria. The list can be provided by an immediately-preceding list generating command.

EDELETE deletes the specified items immediately. To ensure data integrity, it is recommended that a list be generated through a SELECT-type command and the list examined before the EDELETE processor is invoked. To clear a file of all items, use the CLEAR-FILE command.

EDELETE can be used to delete binary items such as cataloged DataBasic programs and index definition items (use DELETE-INDEX to delete the indexes created from the index definition items - see Indexing for more details).

Caution

EDELETE also allows you to delete D-pointers. You should not do this, however, because the data associated with the D-pointer will remain in the database but will no longer be accessible. The correct way to delete a D-pointer is to use DELETE-FILE.

See Also

DELETE command.

Examples

To illustrate the functions of EDELETE, the following examples assume the contents of inventory file PINV presented in Figure 4-1.

     1
001  INSTALLATION AND PLANNING GUIDE 2.0
002  1004
003  771004B
004  PRINTED]COPY MASTER]DUMMY
005  1]1]1
     2
001  PROGRAMMER'S REFERENCE MANUAL 2.0
002  1005
003  771005A
004  PRINTED]COPY MASTER
005  1]1
     3
001  EDITOR REFERENCE MANUAL 2.0
002  1006
003  761006B
004  PRINTED
005  1
     4
001  PROC AND BATCH REFERENCE MANUAL 2.0
002  1007
003  761007A
004  PRINTED
005  1
     5
001  ENGLISH REFERENCE MANUAL 2.0
002  1008
003  761008A
004  PRINTED]COPY MASTER
005  2]1

To delete items based on an explicit item-list, enter

:EDELETE PINV '2''4'
2  ITEMS DELETED

To delete items based on an explicit item-list with a selection criteria clause, enter

:EDELETE PINV '2''4' IF 3 = "76]"
1 ITEM DELETED

In the first example, items 2 and 4 are automatically deleted. In the second example, only item number 4 is deleted because the number in attribute 3 (761007A) passes the test specified by the selection criterion.

In the following example, just a selection criterion is used. All items in the file are tested for compliance with the criterion shown and those items (3, 4, and 5) are deleted.

:EDELETE PINV WITH 3 = "76]"
3 ITEMS DELETED