In this example we see how a Relative file may be read. The program allows the file to be
read either directly, using a key, or sequentially.
Below we see the results produced by two runs of the program.
RUN USING SEQUENTIAL READING
Enter Read type (Direct=1, Seq=2)-> 2
01 VESTRON VIDEOS OVER THE SEA SOMEWHERE IN LONDON
02 EMI STUDIOS HOLLYWOOD, CALIFORNIA, USA
03 BBC WILDLIFE BUSH HOUSE, LONDON, ENGLAND
04 CBS STUDIOS HOLLYWOOD, CALIFORNIA, USA
05 YACHTING MONTHLY TREE HOUSE, LONDON, ENGLAND
06 VIRGIN VIDEOS IS THIS ONE ALSO LOCATED IN ENGLAND
07 CIC VIDEOS NEW YORK PLAZZA, NEW YORK, USA
RUN USING DIRECT READ
Enter Read type (Direct=1, Seq=2)-> 1
Enter supplier key (2 digits)-> 05
05 YACHTING MONTHLY TREE HOUSE, LONDON, ENGLAND
If you downloaded the first example program and its data file you should already have the
Relative file (it was produced when you ran the first example program). You can use this
file with the second Relative file example program.
Download ReadRelative.cbl