Two and Three dimension tables
These slides will show two and three dimension tables.
This the the two dimension table example out on the Web. The name is twodim.cbl.
The IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, FILE SECTION of the DATA DIVISION and the beginning of the WORKING-STORAGE SECTION of the DATA DIVISION are shown on this slide. The rest of the WORKING-STORAGE and the PROCEDURE DIVISION are shown on the remaining slides.
This is the fare table drawn out and the definition of it in WORKING-STORAGE.
This shows the tables that are set up in the WORKING-STORAGE section.
On the program on the Web, I called the 05 under the redefines TO-CITIES which was a poor name. I am changing it here to a more appropriate name FROM-CITIES. Notice that this has no impact on the program. The names used are for programmers to help them understand.
This is the area in WORKING-STORAGE that controls the page printing and the headers.
This shows the lines that MOVE the data from the tables to the fields on the print line.
This is the part of the PROCEDURE DIVISION that deals with the headers, the date and the file closing.
This is the output report that was produced.
Looking at this table you can see that this table sets up the columns first and then the rows. The other table set up the rows first and then the columns.
The TO-CITY code is the first subscript so it points to the 05 level and the FROM-CITY code is the second subscript so it points to the 10 level.
This shows a three dimensional table. It is for phone calls. I call TO a place at Day, Evening or Night rates and within each rate it is station-to-station or person-to-person.
Do they even have rates like this any more?