Disk Memory System
•
file-organization
-
The records in a file can be accessed either
sequentially or randomly. Records accessed sequentially are read or
written one after the other. Records accessed randomly can be read or
written in any order. including one after the other.
To indicate which access method you wish to use. enter either
SEQUENTIAL for sequential accessing or RELATIVE for random
accessing. If you are creating a file. you may optionally specify the
number of records on a file by following the word SEQUENTIAL or
RELATIVE with a number or a numeric expression. If you do not specify
the
file-organization.
the default is SEQUENTIAL.
•
file-type
-
Files can be stored on diskettes either in easily readable
ASCII characters or in machine-readable binary form. If the information
is going to be printed or displayed for people to use. ASCII format is
usually a better choice. In most cases. binary records are preferred
because they take up less space and are processed faster by the
computer.
To specify that you wish the file to be in ASCII format. enter DISPLAY.
(The length of a DISPLAY-type record is limited to approximately
150
bytes.) To specify binary format. enter INTERNAL. If you do not specify
afile-type.
the default is DISPLAY.
•
open-mode
-
This entry Instructs the computer that the file may be
both read and written upon (UPDATE). may only be read (INPUT). may
only be written to (OUTPUT). or may only be added to (APPEND).
If a file is marked as protected. it cannot be written to and may only be
opened for input. Also. APPEND mode can only be specified for
VARIABLE length records. If you do not specify an
open-mode.
the
computer assumes the default UPDATE.
Note:
If an unprotected file already exists on a diskette. specifying an
open-mode
of OUTPUT to the same file name writes over the existing
file with the new file. You can prevent this by opening in the update mode
and reading all the existing records so that you move to the end' of the
file or by using the RESTORE statement with the proper record number.
•
record-type
-
File records may be all the same length (FIXED) or may
vary in length (VARIABLE). If they are all FIXED. shorier records are
padded to make up the difference. Any that are longer may be truncated
to the proper length. Files that have FIXED-length records are processed
faster than files with VARIABLE-length records but usually take up
more space on a diskette.
If you like. you may specify a maximum length of a record by following
VARIABLE or FIXED with
a
numeric expression. The maximum length
for a VARIABLE file is
254
bytes. and the maximum for a FIXED file is
255
bytes. If you do not specify a record length. the default is
80.
RELATIVE files must have FIXED-length records. If you do not specify a
record-type
for a RELATIVE file. the default is FIXED.
3 1
Summary of Contents for PHP1240
Page 1: ......