Accessing Files Programmer's Guide (32650-90885)

Chapter 3 73
Specifying a File Designation
User-Defined Files
User-Defined Files
You can reference any user-defined file by writing its name and descriptors in the
filereference
format, as follows:
filename
[/
lockword
][.
groupname
][.
accountname
]
In no case must any file designator written in the
filereference
format exceed 35
characters, including delimiters.
When you reference a file that belongs to your logon account and group, you need only use
the
filereference
format in its simplest form, which includes only a file name that may
range from one to eight alphanumeric characters, beginning with a letter (unless, of
course, the file has a lockword, in which case you must specify the lockword and a
delimiter). In the following examples, both formal and actual designators appear in this
format:
Formal designator
|
FILE ALPHA=BETA <---- Actual designator
FILE REPORT=OUTPUT
FILE X=AL126797
FILE PAYROLL=SELFL
A file reference is always qualified, in the appropriate directory, by the names of the group
and account to which the file belongs, so you need ensure only that the file's name is
unique within its group. For instance, if you create a file named FILX under GROUPA and
ACCOUNT1, the system recognizes your file as FILX.GROUPA.ACCOUNT1; a file with the same
file name, created under a different group, could be recognized as FILX.GROUPB.ACCOUNT1.
File groups serve as the basis for your local file references; thus, when you log on, if the
default file system file security provisions are in effect, you have unlimited access to all
files assigned to your logon group and your home group. Furthermore, you are permitted to
read, and execute programs residing in, the public group of your logon account. This group,
always named PUB, is created under every account to serve as a common file base for all
users of the account. In addition, you may read and execute programs residing in the PUB
group of the System Account. This is a special account available to all users on every
system, always named SYS.
When you reference a file that belongs to your logon account, but not to your logon group,
you must specify the name of the file's group within your reference. In this form of the
filereference
format, the group name appears after the file name, separated from it by a
period. Embedded blanks within the file or group names, or surrounding the period, are
prohibited. As an example, suppose your program references a file under the name LEDGER,
which is recorded in the system by the actual designator GENACCT. This file belongs to your
home group, but you are logged on under another group when you run the program. To
access the file, you must specify the group name as follows:
FILE LEDGER=GENACCT.XGROUP <------- Group name
RUN MYPROG <------- Program file (in logon group)