When creating a file for sorting data, first determine the information to
include and its format. For example, the input file EMPLOYEE contains
four key data items in each record (employee's last name, first name,
job title, and employee number). The format for the first two lines of the file
EMPLOYEE is shown in Figure 3-1
"File Format For Sorting"Figure 3-1 File Format For Sorting
The file format shown in Figure 3-1 allots 11 characters (columns)
for last names beginning in position 1; 11 characters for first
names, beginning in position 12; 19 characters for jobs titles,
beginning in position 23; and 4 characters for employee numbers, beginning
in position 42. Use the starting position location for each key
data item as tab settings when creating the file. A single line
record can contain up to 80 characters.
For clarity in reading the report when it is printed, allow
enough characters for the longest piece of information in each key
data item, and some blank spaces between them.
When creating multiple files containing similar information
to be sorted and then merged, ensure the key data item starting
positions and data length are identical in all files.