# clear-locks command

The clear-locks BASIC program clears all locks, or specific locks,
 according to the options provided. When used with the i option, an
 optional host can be specified to release all item locks residing on a remote
 server.

Warning: Supports additional options for
FSI item locks. FSI group locks cannot be listed or cleared from TCL.
You must use the monitor.

## Syntax

```
clear-locks {host}{(options}
```

## Parameter(s)

| options | a | Clears client Transaction Log locks only. |
| --- | --- | --- |
| b | Clears all BASIC locks. | |
| c | Clears server Transaction Log locks only. | |
| f{fid} | Clears all group and item locks for a specific frame-ID, specified as a decimal number. The fid variable must be the first frame-ID of a group to clear all item locks in the group. If a FCB is specified, all item locks in the entire file are cleared. Note: The f option indicates that the number immediately following it is a frame-ID. Without the f option, the number is interpreted as a port number. | |
| g{f{fid}} | Clears all group locks and ignores item locks for a specific frame-ID, specified as a decimal number. See the note for the f option. | |
| i{f{fid}} | Clears all item locks, and ignores group locks, for a specific frame-ID, specified as a decimal number. See the note for the f option. Note: The i option will not work with a specific port number or the f option. | |
| m | Clears all phantom locks. | |
| o{f{fid}} | Clears all group read-only locks for a specific frame-ID, specified as a decimal number. See the note for the f option. | |
| q | Clears all spooler locks. | |
| r{f{fid}} | Clears all group retrieval locks for a specific frame-ID, specified as a decimal number. See the note for the f option. | |
| u{f{fid}} | Clears all group update locks for a specific frame-ID, specified as a decimal number. See the note for the f option. | |
| s | Clears all system locks. | |
| t | Clears Transaction Log locks. | |

## Description

Review the following information about the clear-locks
 command:

- When a lock is cleared, an entry indicating the type of lock that was cleared is logged to the errors file.

- If the clear-locks command is run without any parameters specified, it is no longer possible to stack data into the command.

## Example(s)

**Example 1**

Clears all group locks for port
3.

```
clear-locks (g3
```

 **Example 2**

Clears all group locks for decimal frame 12345.

```
clear-locks (gf12345
```

 **Example 3**

Clears all group and item locks for the group starting
at FID 12345.

```
clear-locks (f12345
```

 **Example 4**

Clears all item locks for the group starting at FID 12345.

```
clear-locks (if12345
```

 **Example 5**

 Clears all group and item locks for the group starting at FID 12345.

This result is the same as clear-locks (f12345 in Example 3 because both the
 i and g options are specified.

```
clear-locks (igf12345
```

## See also

- [clear-basic-locks macro](https://d3codex.com/tcl/clear-basic-locks-macro/)
- [clear-group-locks command](https://d3codex.com/tcl/clear-group-locks-command/)
- [hosts file](https://d3codex.com/systemfiles/hosts-file/)
- [lock statement](https://d3codex.com/pickbasic-flashbasic/lock-statement/)
- [Locking scheme](https://d3codex.com/definitions/locking-scheme/)
- [System privileges](https://d3codex.com/definitions/system-privileges/)
- [unlock statement](https://d3codex.com/pickbasic-flashbasic/unlock-statement/)
- [unlock-file command](https://d3codex.com/tcl/unlock-file-command/)
- [unlock-group command](https://d3codex.com/tcl/unlock-group-command/)
- [unlock-item command](https://d3codex.com/tcl/unlock-item-command/)

---
Source: https://d3codex.com/tcl/clear-locks-command/ - part of the D3Codex reference.
