FILE Verb

Syntax

FILE string1{,string2}{,MODE=options}{,ERR=lineref}

Description

The FILE verb defines any disk file type except a disk directory.

Parameter Description
string1

File identification information, in the same format as used by the FID() function.

string2

Key definition data for multikeyed MKEYED files, as derived from FIN(86). Information ignored for all files other than multikeyed MKEYED and C-ISAM files.

MODE=options A string containing comma-separated mode options from the table below.
ERR=lineref

Branch to be taken if an error occurs during execution.

MODE Options

Mode

Description

CRYPTPASS=

In PRO/5 5.00 and higher, and BBj 4.00 and higher, creates an encrypted file with the specified password. BASIS recommends a password of at least 20 characters when using AES-128 and at least 40 characters when using AES-256.

Note: Encrypted files tend to perform slower than non-encrypted files due to the overhead of encrypting and decrypting each time the file is accessed.

CRYPTALG=
Value Description
AES-128 Uses AES-128 bit encryption, which is also the default.
AES-256

In BBj 6.00 and higher, and PRO/5 6.00 and higher, uses AES-256 bit encryption.

JDK version 8 and lower

To utilize AES-256 in BBj, install the "Java Cryptography Extension (JCE)". Current JDKs do not need these additional files.

The FILE statement is used in an erase-redefine procedure, as shown in the examples below. The examples remove all data from the file.

Example 1

1000 OPEN (1)"afile"
1010 LET FID$=FID(1)
1020 CLOSE (1)
1030 ERASE "afile"
1040 FILE FID$
Example Type: BBj Console

Example 2 (For MKEYED and C-ISAM files only)

1000 OPEN (1)"afile"
1010 LET FID$=FID(1),FIN$=FIN(1)
1020 CLOSE (1)
1030 ERASE "afile"
1040 FILE FID$,FIN$(86)
Example Type: BBj Console

See Also

INITFILE Verb

XFILE Verb

Data Server Syntax

Modifying Programs to Access the Data Server

Verbs - Alphabetical Listing