# REMOVE Delete Record from File

> Source: https://manual.pvxplus.com/directives/remove

## Format

**REMOVE** (*filespec*\[,*fileopt*\])

***Where:***

|  |  |
| --- | --- |
| *filespec* | Can be a numeric expression indicating the open channel number to use or a string expression containing the pathname or table name (if string is prefixed by the keyword **TABLE**) of the file to use. |
| *fileopt* | Supported file options (see **[File Options](https://manual.pvxplus.com/appendix/input-output-and-control-options#Mark1)**):<br>\|  \|  \|<br>\| --- \| --- \|<br>\| **BSY**=*stmtref* \| Traps Error #0: Record/file busy \|<br>\| **DOM**=*stmtref* \| Missing record transfer \|<br>\| **ERR**=*stmtref* \| Error transfer \|<br>\| **IND**=*num* \| Record index \|<br>\| **KEY**=*string$/num* \| Record key \|<br>\| **RTY**=*num* \| Number of retries (one-second intervals). This overrides the value defined by the **['WT'](https://manual.pvxplus.com/parameters/wt)** system parameter. \|<br>\| **TIM**=*num* \| Maximum time-out value in integer seconds \|<br>\| *stmtref* \| Program line number or statement label to which to transfer control \| |

*(TABLE support was added in PxPlus 2018.)*

## Description

Use the **REMOVE** directive to delete a record from a file. The directive is only supported for file types that have keys (i.e. not for indexed files). The **REMOVE** directive and the specific options are dependent on the specific file type.

For Keyed, Direct Sort or ZIP files, the **KEY=** option is mandatory to identify the record to be removed. The key specified must be the primary key for the file. With multi-keyed files, PxPlus removes all related alternate keys from the file automatically when executing this directive.

PxPlus supports use of the **REMOVE** directive with ZIP files.

## See Also

**[Accessing ZIP Files](https://manual.pvxplus.com/pxplus-user-guide/file-handling/processing-data-files/accessing-zip-files)**

## Example

```
0010 open (20)"CSTFLE"
0020 input "What customer do we delete?",C$
0030 if C$="" then stop
0040 remove (20,key=C$,dom=0100)
0050 print "Well that's gone.."
0060 goto 0020
0100 print "Could not find ",C$
0110 goto 0020
```
