Defining files

You can define a new file definition from scratch or by copying and modifying an existing file.

1. From the File Definitions list,

The File Definition input window is displayed.

1. Defining a file.

2. Enter or modify data in each field as instructed below.

Filename

Enter a unique file definition name. The file name can have a maximum of 30 characters and must begin with a letter. The remaining characters can be letters, digits, underscores (_), or dollar signs ($).

File type

Select the file type you want to assign:

ASCII

DBL ISAM

RELATIVE

USER DEFINED

If a structure definition with the same name as your file exists, the file type defaults to that of the structure.

Note

If you try to modify the file type when structures have already been assigned to the file, an error message is displayed when you try to save your changes. To modify a file definition’s file type, you must first disassociate all structures from that definition. The file type of the file definition and the file type of the structures assigned to it must match.

Description

Enter a unique and meaningful description (up to 40 characters) for the file definition. This description is available when Repository displays a list of files, and ReportWriter can use it, along with the structure description, to identify your files.

Open filename

Enter the name of the actual data file, including the path specification. The filename can have a maximum of 64 characters; however, the field allows you to enter only 40 characters. To enter a longer value, select Edit File Functions > Edit Entire Text.

To edit a filename that exceeds 40 characters, you must also use the Edit Entire Text option. (If you edit it in the Open filename field, the portion that is not displayed will be lost. Similarly, deleting the 40 characters that are displayed in the field will delete the entire filename.)

Repository enables you to “map” a filename to simulate multiple copies of the same file definition with slightly different open filenames. For more information, see RPS_FILNAM_METHOD.

Structure

This read-only field displays the name of the structure assigned to the file (if there’s only one) or the number of assigned structures (if there are none or more than one). If this is a new file, the Structure field contains the text “0 structures assigned”. It will be filled with a structure name or a number of structures after you assign one or more structures to your file, as explained in Assigning structures to files.

Record type

This field applies only to ISAM files. Select the format of the records in this file: Fixed (fixed-length records; the default), Variable (variable-length records.), Multiple (multiple fixed-length records).

Page size

This field applies only to ISAM files. Select index block page size for this file:

1024 (default)

512

2048

4096

8192

16384

32768

Key density

Enter a value between 50 and 100, inclusive, to override the default key density percentage used for all keys in the file. The default density is around 50%. This field applies only to ISAM files. You can also override the density percentage for a specific key; see the description Key density for more information.

Addressing

This field applies only to ISAM files. Select the file addressing for this file: 32-bit (default) or 40-bit.

Size limit

Enter the maximum number of megabytes that the data file (.is1) is allowed to reach. This field applies only to REV 6 or greater ISAM files.

Record limit

Enter the maximum number of records that the file is allowed to contain. This field applies only to REV 6 or greater ISAM files.

Temporary

Select Temporary if you do not want this file to be a selectable file in ReportWriter. If set, the file is considered “temporary” and you will not be able to select the file for inclusion in a report generated by ReportWriter. The “temporary” flag can optionally be honored by xfODBC to exclude tables attached to temporary files from the system catalog. For more information on how xfODBC handles temporary files, see Setting catalog generation options.

Compress:

Select this option if the data in this file is compressed. This field applies only to ISAM files.

Static RFA

Select this option if records in this file will retain the same RFA across WRITE operations. This field applies only to ISAM files.

Stored GRFA

Select this option if the CRC-32 portion of an RFA is to be generated and stored to each record header on each STORE or WRITE operation. This field applies only to ISAM files.

Track changes

Select this option to enable change tracking in this file. This field applies only to REV 6 or greater ISAM files. Selecting Track changes also selects Terabyte.

No rollback

If you selected Track changes, indicate whether you want to prohibit rollbacks on this file. This field applies only to REV 6 or greater ISAM files.

Terabyte

Select this option if this is a 48-bit terabyte file. This field applies only to ISAM files and is selected automatically when Track changes is selected.

Network encrypt

Select this option to indicate that clients that access this file must use encryption. This field applies only to ISAM files.

Portable ints

This field allows for the definition of one or more non-key portable integer data specifications that can be passed as an argument to the ISAMC subroutine. Non-key integer data specifications apply only to ISAM files. Use this syntax:

I=pos:len[,I=pos:len][,...]

where pos is the starting position of non-key portable integer data and len is its length in bytes (1, 2, 4, or 8). No validation is performed on the contents of this field.

The maximum string length is 120 characters, but the Portable ints field allows you to enter only a 40-character string. To enter or edit a longer string, select Edit File Functions > Edit Entire Text. (Note: If you edit a string longer than 40 characters in the Portable ints field, the portion that is not displayed will be lost. Deleting the 40 characters that are displayed in the field will delete the entire string.)

File text

This field allows for the specification of text to be added to the header of the file and space to be allocated for user-defined text. This option applies only to REV 6 or greater ISAM files. There are three options for the syntax:

text_size[K]
"text_string"
text_size[K]:"text_string"

where text_size is the amount of space to allocate in bytes (rounded to the nearest kilobyte) for user-defined text, and text_string is a text string to add to the file header. No validation is performed on the contents of this field.

The maximum string length is 1800 characters, but the File text field allows you to enter only a 40-character string. To enter or edit a longer string, use the Edit Entire Text option, as described above for the Portable ints field.

Note

You can assign structures to your file or disassociate assigned structures at this point, without exiting the File Definition input window. See Assigning structures to files for more information.

3. Exit the window to save the new file definition.

Your next step is to assign a structure to your file, if you haven’t done so already. Follow the instructions in Assigning structures to files.

Assigning a long description to a file definition

You can assign an 1,800-character description to the file definition. A long description is a place to store more detailed information about your file definition and its use.

1. From the File Definitions list, highlight the file to which you want to assign a long description.
2. Select File Functions > Edit Long Description.
3. Enter your long description.
4. Exit the window to save your changes.

Assigning a user text string to a file definition

You can associate a 60-character user-defined text string with the file definition to store additional information you want to access at runtime with the Repository subroutine library.

1. In the File Definitions list, highlight the file to which you want to assign a user-defined text string.
2. Select File Functions > Edit User Text.
3. Enter your user text string.
4. Exit the window to save your changes.

Modifying a file definition

1. From the File Definitions list, highlight the file definition you want to modify and press Enter.
2. In the File Definition window, modify data as desired. The file definition name cannot be modified. For assistance in completing the fields, see step 2 under Defining files.
3. Exit the window to save your changes.
Note

You can assign structures to your file at this point (or disassociate assigned structures), without exiting the File Definition input window. See Assigning structures to files for more information.

Deleting a file definition

1. Highlight the file in the File Definitions list.
2. Select File Functions > Delete File.
3. At the prompt, select Yes to delete the file definition or No to cancel the deletion.