CSCI 360
Assignment 7
100 points
Overview
As in some other assignments, we have a file containing various
pieces of information. In this case, however, the data is not
all lined up for us in neat columns, and the names are written
in a mixture of upper and lower case. We will need to use TRT
and EX to extract the data from the record, and we will need
to use TR to fix the upper/lower case problem.
For this assignment, we will write a program that will read a
file containing information about players: ID numbers, names,
a score and a date for each person. The information will be
stored in a table. We will print the table. After that, there
will be some updates carry out and then we will print the table
again.
The program will make use of external subroutines, character
data and packed decimal numbers.
Input
The input to the program will be a file with an unknown number of
records. Each record represents a single player in the
Greek Myth game and has the following format:
There are two groups of records. Each input record in the first
group contains:
ID Number (always 8 digits)
at least one space
First Name (up to 10 characters)
at least one space
Last Name (up to 12 characters)
at least one space
High Score (1-5 digits)
at least one space
Date of High Score (10 characters in DD/MM/YYYY format)
more spaces to make up 80 columns in all
The end of the first group of records is a record with ID Number=99999999
Each input record in the second group contains (all neatly lined up):
ID number (8 digits)
two spaces
a date (10 characters in DD/MM/YYYY format)
two spaces
a score (5 digits)
spaces to make up 80 columns in all
Use the following JCL statement to specify the input file:
//FT05F001 DD DSN=KC02314.SPRING20.CSCI360.HW7DATA,DISP=SHR
Processing Requirements
The main program will carry out the following steps:
- Call subroutine BUILD to read the file and store the data in
a table.
- Call subroutine PRINT to print the contents of the table,
using appropriate page and column headings.
- Call subroutine UPDATE to read the second group of records.
If the new score is higher than the previous High Score,
update the High Score and the date. UPDATE will print a
line about each transaction.
- Again call subroutine PRINT to print the contents of the table,
using appropriate page and column headings.
Other Notes
- You may assume that the table needs to hold no more than 50
values. (There are fewer than 50 players.) Each entry should
have the following format:
- ID Number (stored as a fullword)
- Last Name (10 characters)
- First Name (10 characters)
- High Score (3 packed decimal bytes)
- Date (5 packed decimal digits in 0DDMMYYYY format)
- Use this DSECT to describe a table entry:
$ENTRY DSECT
$ID DS F
$LNAME DS 10C
$FNAME DS 10C
$SCORE DS PL3
$DATE DS PL5
Each table entry should start on a fullword boundary (or better--see below).
- The BUILD subroutine reads data from the file and stores data
in the table until it finds a line with ID Number = 99999999.
The parameter list for BUILD contains:
- the address of the table
- the address of a fullword containing the address of the
first unused entry
- the address of the input buffer
- The PRINT subroutine prints the table contents.
The page header for each report should start at the top of a new
page. The page heading should be centered. The page heading
should include a page number.
The column headers should be triple-spaced from the page header.
Print no more than 20 lines of player information per page.
Print ID numbers as 8 digits including leading zeroes, as in "00123456".
Print dates as DD/MM/YYYY.
The parameter list for PRINT contains:
- the address of the table
- the address of a fullword containing the address of the
first unused entry
- the address of a caption to use in the page heading
- the address of the page counter
- The UPDATE subroutine will search the table for the specified
ID number. After that, if the new score is higher than the
High Score, replace the High Score value with the new score and
replace the date with the new date. Print a line about each
update operation. If the ID number is not found in the table,
print an error message.
The lines reporting on updates should be double-spaced.
You may assume all the update messages will fit on one page.
The parameter list for UPDATE contains:
- the address of the table
- the address of a fullword containing the address of the
first unused entry
- the address of the input buffer
- the address of the page counter
- Write this program incrementally, one subroutine at a time.
Start with BUILD and XDUMP the table to see whether BUILD is
correct. After that, write and test PRINT. Once you have PRINT
working, you can go on to UPDATE.
- The JCL for this assignment is the same as the JCL used in
Assignment 6 except for the line given above to provide the data.
- You may not use XDECI or XDECO anywhere in this assignment.
The scores should be stored in packed decimal format and
the ID numbers should be stored as binary fullwords.
- The input buffer and the page counter should both be
declared in the main routine.
- The table is printed twice. We will have a different caption
at the top of the page so we can tell them apart. To tell the
PRINT subroutine which caption to use, we pass it an extra argument,
the address of a character field of length 22. When we first
call PRINT, the caption should be "Initial Table Contents" and on
the second call, it should be " Table After Updates ".
- The UPDATE subroutine will have to print its own page heading
including a caption such as "Results of Updates" and the page
number (which is why the page counter is one of its arguments).
- As you work on this, you may need to XDUMP all or part of the
table to check your work. Each line of XDUMP prints 32 bytes of
data, and each table entry is 32 bytes long. It may be useful
to have the table start on a 32-byte boundary. Use the following
ORG trick to line up your table on a 32-byte boundary:
ORG MAIN+((*-MAIN+31)/32)*32)
TABLE DS 1600C