Example 3: Sort Program
This example is adapted from W.B.KHAN, figure 10.4, page 264. 
I called the input file: sort-in and the output file: sort-out.

I had to make a few changes to your textbook example to make it work.
The following, modified program has two sections:

Section 1:

a) I read the employee-file-in, including the line-feed character
b) I copy this file into a second file, called work2-file, but
   without the line feed.
c) I sort file work2-file, using work1-file as temporary storage,
   into an indexed file, called index-file

Section 2:

d) I read the index-file
e) I perform the computations
f) I write each record the file employee-file-out

The next slides include:

* the program source code
* the input data file
* the program compile and execute commands

You can download them to your account by accessing these slides, then type:

* a backslash (\) to access the HTML document
* a (p) to save the file to your account.

Or you can copy the examples from the following directory:

      ~jclevin/HTML/COURSE/COBOL/EXAMPLE