# Synonym-defining items

Also known as Q-pointers, synonym-defining items are used
in account master dictionaries to point to other files. A Q-pointer
is a file alias that defines a path to an existing file that resides
in the system under another name, or in another account, or both.
A Q-pointer can reference any file in the system, including those
within the same account.

Synonym-defining items reside in the account’s master
dictionary. In general, only the first four attributes are used (attributes
0, 1, 2, and 3).

| Attribute | Description |
| --- | --- |
| 0 | Item-ID of the synonym. |
| 1 | Dictionary code. Contains the character q to indicate that the current item is a synonym-defining item. |
| 2 | Account (master dictionary) where the item-ID of the file named in attribute 3 resides. If the account name is not specified, the current account is used for the destination account. |
| 3 | Name of the file to which the item points. If the file name is not specified, the item-ID (synonym name) is used for the destination file. If no such file name exists, then the current account master dictionary is used for the destination file. |
A Q-pointer can reference another Q-pointer, which references
yet another Q-pointer, for up to 15 aliases away. Ensure that the
aliases do not eventually refer back to each other. If it does, the
system reports the error [230]. D3 also provides dynamic file paths,
which prevents having to create a Q-pointer to look at a file elsewhere
in the system.

Note: Q-pointers point only to other files, not
commands. To create a synonym for a command, use a macro.

## Example(s)

This points to the cust file
in the production account.

```
cust
 001 q
 002 production
 003 cust
```
This points to the history data section of the cust file
in the production account.

```
ch
 001 q
 002 production
 003 cust,history
```
This points to the prod file in the production account,
if it exists, otherwise it points to the master dictionary level file
in the production account.

```
prod
 001 q
 002 production
```
This points to the customer-file in the current account.
Note that attribute 2 is null, which indicates the current master
dictionary.

```
cust
 001 q
 002
 003 customer-file
```

## See also

- [Account](https://d3codex.com/definitions/account-glossary/)
- [check-dx command](https://d3codex.com/tcl/check-dx-command/)
- [create-nqptrs command](https://d3codex.com/tcl/create-nqptrs-command/)
- [File reference](https://d3codex.com/definitions/file-reference/)
- [filename](https://d3codex.com/attributedefiningitem/filename/)
- [list-files command](https://d3codex.com/tcl/list-files-command/)
- [listfiles command](https://d3codex.com/tcl/listfiles-command/)
- [mds file](https://d3codex.com/systemfiles/mds-file/)
- [Header files](https://d3codex.com/definitions/header-files/)
- [set-dptr command](https://d3codex.com/tcl/set-dptr-command/)
- [set-file command](https://d3codex.com/tcl/set-file-command/)
- [touch command](https://d3codex.com/tcl/touch-command/)

---
Source: https://d3codex.com/definitions/synonym-defining-items/ - part of the D3Codex reference.
