IBM 5110 User Manual page 157

Apl
Table of Contents

Advertisement

152
Determining Field Size
Field size depends on the nature of the data in the field. First, the
lenlgth of the data may vary. In the example, name is 20 characters.
The length of each customer's name varies, but 20 characters should
be sufficient for all names. Secondly, all data in a field might be the
same length. For example, customer number is eight positions, and all
eight positions are used in each record.
ThHre are no firm rules for determining field size. The major problem
involves fields with variable length data. For example, if a name is
planned as 15 characters, and a new customer has 19 characters in his
name, a problem arises when you add his record to the file. To avoid
this problem, try to estimate the largest length of data that will be
contained in a field. Use this length to determine the field size.
Providing for a Delete Code
Remember that records are not automatically deleted. You might want
to place a delete code in a record, and then when the file is processed
you must check for the delete code. In the example, if a customer
becomes inactive, we do not want to process his record. Thus, a
one-position field is included to provide for a delete code.
Of course, if you are using an index to find the records in a direct
access file, you do not need a delete code. Instead, you can remove
the record key from the index. See Organizing a Diskette File in this
chapter for information on creating an index.
Providing Extra Space
At this stage in planning, it is often wise to allow for data to be added
to a record. For example, suppose the name and address file was
created with the fields described, and at a later time each customer's
zip code is needed. If all positions in the record are used, there is no
place to add the zip code. Because the. record length is not yet
established, we can allow for such additions to this record. Although it
is often difficult at the planning stage to imagine what data might be
added, it is wise to reserve extra space. A minimum of 10% extra
space is suggested.

Advertisement

Table of Contents
loading

Table of Contents