10.9 FILE Declarations

Syntax

FILE fname IS filename ;

Fname is the internal name of the file. This name will be used by the report program in place of filename, which is the system filename for the file. Filename may be either a character string, "somefilename" or a shell parameter, $shellparm. The string may contain shell parameters which will be substituted as necessary. For example, if the shell parameter MASTER has the value of "data/sub", the string "demo/$MASTER" will use the file demo/data/sub. Filename must be the name of a C/Base RMS data file. The internal name used must be a valid Report Writer internal name and be unique to other declared internal file names.

Purpose

Every file being read by a report program must have a FILE declaration which will make the link with the file's internal name and the system filename for the file.

Examples:

FILE vend_mst IS "vendor"

FILE master IS $MASTER;

Notes

When a report contains statements that can change files the files that those statements reference are locked when the report starts and remain locked until the report finishes. This happens even if the file change statements are never executed.