Information Technology Reference
In-Depth Information
account number file consists of nine fields. We must then thoroughly describe each field.
This gives us some keywords. The first is
define
and the others are
structure ,
integer ,
decimal ,
signed
and
character .
The actual program code to describe the account file record and its makeup is as
follows:
define acctfile record account-record structure
account-number integer( 9)
last-name character (18)
first-name character (15)
middle-initial character
street-address character (25)
city character (15)
state character (2)
zip-code integer( 5)
balance signed decimal (6.2)
Note that the ten lines above are not a program, which we'll get to in the next
chapter. Let us begin with the first line,
define fil e acctfile record account-record structure .
The keyword
define
spells out to the program the name of the file - indicated by what follows the keyword
file
and what fields make up each record. That's what the keyword
record
is for. The field
account-record
is a variable, as are the nine fields in the record that follow. The record is related to these
fields by the keyword
structure
which says that the variable
account-record
consists of nine fields. The end of the record is indicated by the next occurrence of the
keyword define ,
or some keyword, such as
read .
Search WWH ::




Custom Search