# File reference (Access Query Language)

A file reference is a standardized mechanism for designating
a particular file within D3.

There are a number of ways to reference files within D3.
Any command that requires or allows a file reference accepts any of
the following references:

| filename | Accesses the data section of a given file. |
| --- | --- |
| dict filename DICT filename | Accesses the dictionary level of the file. |
| dict.filename,data.filename | Accesses a data section in the given dictionary, when the data section’s name is different than the dictionary’s name. This is the case when a file has multiple data sections. |
In all of the above cases, it does not matter to D3 if
the file is local or remote. The D-pointer can reside in the current
master dictionary or elsewhere. This account has a Q-pointer already
present in the current master dictionary.

## D3 File References and File Paths

The following
file reference formats are available in D3, and make use of the new
feature called file paths.

| account.name,, | Accesses another master dictionary (account), or any file-defining item found in the mds file. Alternately, the fully-qualified form is also valid for referencing another master dictionary: mds,md.name |
| --- | --- |
| account.name,filename, | Accesses the data section of the specified file in the designated account. The account name must exist as a D-pointer in the mds file and the file name must exist as a D-pointer in the given account. Note the , (comma) at the end of the reference; the file reference is invalid without it. The data level reference is not required, but the trailing comma must be included: ```
list dm,bp,
``` This is the same as: ```
list dm,bp,bp
``` |
| dict account.name,filename, | Accesses the dictionary section of the specified file in the designated account. The account name must exist as a D-pointer in the mds file and the file name must exist as a D-pointer in the given account. Note the , (comma) at the end of the reference; the file reference is invalid without it. |

## Specifying Alternate File Names

File references
within certain processes, such as copy and filing operations, require
a leading ( (left parenthesis) in cases where an
alternate file reference is to be designated.

A variety of commands
allow or require the character, including: `copy` (TCL), me (merge, in Editor processor), CTRL+CR (Update processor),
CTRL+CW (Update processor), CTRL+ZR (Update processor), CTRL+ZW (Update
processor), sreformat (AQL), reformat (AQL), fi (Editor processor), and fs (Editor processor).

## Example(s)

The left parenthesis is vital
in this operation. It indicates that the string immediately following
it (customer, in this case) is to be treated as an alternate file
name. Without the `(` character, customer is treated
as an item-ID and item-ID 100 would subsequently be copied to customer
in the data section of the entity file.

```
list entity
list dict entity
list invoices,archive
list dm,,
list dm,bp,
list dict dm,entity,

copy entity ’100’
to: (customer 120
```
The `(` indicates that the copy is to be
directed to a different file.

```
copy entity ’100’
to: (production.account,entity, ’120’
```

## See also

- [Access Query Language](https://d3codex.com/access/access-query-language/)
- [account-maint command](https://d3codex.com/tcl/account-maint-command/)
- [b (bridge) processing code](https://d3codex.com/processingcodes/b-bridge-processing-code/)
- [catalog command](https://d3codex.com/tcl/catalog-command/)
- [check-sum command](https://d3codex.com/access/check-sum-command/)
- [AQL command categories](https://d3codex.com/access/aql-command-categories/)
- [compare command](https://d3codex.com/tcl/compare-command/)
- [compile-catalog command](https://d3codex.com/tcl/compile-catalog-command/)
- [compile-run command](https://d3codex.com/tcl/compile-run-command/)
- [count command](https://d3codex.com/access/count-command/)
- [exchange command](https://d3codex.com/tcl/exchange-command/)
- [File name](https://d3codex.com/definitions/file-name/)
- [clearfile statement](https://d3codex.com/pickbasic-flashbasic/clearfile-statement/)
- [File-defining items](https://d3codex.com/definitions/file-defining-items/)
- [footing modifier](https://d3codex.com/access/footing-modifier/)
- [hash-test command](https://d3codex.com/access/hash-test-command/)
- [istat command](https://d3codex.com/access/istat-command/)
- [lfd macro](https://d3codex.com/tcl/lfd-macro/)
- [list command](https://d3codex.com/access/list-command/)
- [list-item command (Access Query Language)](https://d3codex.com/access/list-item-command-access-query-language/)
- [list-label command](https://d3codex.com/access/list-label-command/)
- [listdict command](https://d3codex.com/tcl/listdict-command/)
- [md.name](https://d3codex.com/attributedefiningitem/md-name/)
- [root statement](https://d3codex.com/pickbasic-flashbasic/root-statement/)
- [set-file command](https://d3codex.com/tcl/set-file-command/)
- [Synonym-defining items](https://d3codex.com/definitions/synonym-defining-items/)

---
Source: https://d3codex.com/access/file-reference-access-query-language/ - part of the D3Codex reference.
