CSCI 465 Assignment 1

QSAM

(100 points)

The games division of AttoSoft has been developing a game called Fake Life for some time. A number of people have been playing the game as testers. The company needs to have a list of players and their high scores and average scores.


Input

The input file is named KC02314.SUMMER09.CSCI465.HW1, and it is catalogued. Each record in it contains various fields as follows:

  Member Last Name        12 characters
  Member First Name       12 characters
  Scores                  0 to 10 nonnegative values, each 5 digits long
  Filler                  5 blank spaces

The records are all the same length. If a score is missing, we have blanks, not digits.


Processing

The steps in your program should be:

  1. Read each record in the input file.

    Print a first report containing, for each record, a line listing the member's first name, last name, number of games played, high score and average score, with a page heading and column headings. (See the sample output.) At the end of the report, we need summary lines stating the number of players who played at least one game, the overall average score, and the number of players who played no games at all.

    If a player has played no games at all, print "none" as the high score and average score, and do not include that player in computing the overall average score.

  2. If a player has an average score of 50,000.0 or greater, write a record containing that individual's last name, first name, high score and average score into a temporary file. All numbers in the temporary file should be in packed decimal format to save space.

  3. Next, close the temporary file, open it for input, and read each record in it.

    Print a second report, with a page heading and column headings, containing the information from each record on one line.

    At the end of the report, print a summary line stating the number of players listed in the second report.


Programming Notes

  1. You may find it useful to print a copy of the input file with IEBPTPCH. The JCL for IEBPTPCH is in the course notes book or in Extra Credit Assignment 1. You need to put in the correct record length in the Record Field statement.

  2. Use the JCL listed at the end of this document.

  3. All I/O in this program will be done using QSAM. Do not use XREAD or XPRNT.

  4. Your program must use both the MOVE and LOCATE versions of both the GET and PUT macros. Your program should also make at least some use of the NIU structured macros.

  5. Upon normal termination, put a return code of 0 in register 15 before returning control to the operating system.

  6. Whenever you open or close a file, check for successful completion by examining the value in register 15. If any such operation is not successful, call the ABEND macro with a return code value (different in each case) that indicates what happened. Include the various return codes you are using in the program documentation.

  7. You may want to expand macros using PRINT GEN as you develop your program. On the final run, turn off macro expansion with PRINT NOGEN.

  8. Use packed decimal fields for the various counters, totals and averages. Print the average scores with 1 digit to the right of the decimal point.

  9. All numbers printed in the reports should be formatted neatly, suppressing leading zeros and inserting commas and decimal points as needed. Do not use XDECI or XDECO to read or write numbers.

  10. The title of the first report should be "Fake Life Score Report" and the title of the second report should be "Fake Life High Scorers". A second title line should say 'Prepared by Your Name'. (Put your own name in place of 'Your Name'.)

  11. When you create the temporary file, use an LRECL as small as you can manage without omitting any data.

  12. Use the TIME macro to obtain the date and time. These will be included in the page head lines. You can print the date in the format 2007.DDD, where DDD is the Julian date. Print the time in the format 14:15:24, without including fractions of a second.

  13. In printing the reports, triple-space between the page heading and the column headings. Double-space between players. Print no more than 20 detail lines per page in each report. Triple-space the summary lines.

  14. Your output does not have to match the sample output exactly. You may be able to compress column headings into only one line per page, for instance. Center the output neatly on the page.

  15. Include an XSNAPOUT DD statement in the Loader step. XSNAP can be used in the source code to help you debug your program. Remove all calls to XSNAP before the final run.

  16. You do not need to use any tables in this assignment (other than the table in the input record). You may write the whole program as one long CSECT without writing any subroutines.


JCL for this assignment

Use the following JCL to assemble and execute your program. In the first two lines of the text, you must substitute your own logon ID and name.

//KC0nnnnA JOB ,'your name',MSGCLASS=U
//*
//STEP1      EXEC  PROC=ASMACG
//C.SYSLIB   DD    DSN=KC00NIU.SYS2.MACLIB,DISP=SHR
//           DD    DSN=SYS1.MACLIB,DISP=SHR
//           DD    DSN=KC00NIU.CSCI464.MACLIB,DISP=SHR
//C.SYSIN    DD  *
  (your assembler program goes here--and delete this line)
/*
//G.SYSLIB    DD  DSN=KC00NIU.SYS2.CALLIB,DISP=SHR
//G.STEPLIB   DD  DSN=KC00NIU.CSCI464.LOADLIB,DISP=SHR
//G.INFILE    DD  DSN=KC02314.SUMMER09.CSCI465.HW1,DISP=SHR
//G.EXTFILE   DD  UNIT=SYSALLDA,SPACE=(TRK,(2,1))
//G.PRINTER   DD  SYSOUT=*
//G.XSNAPOUT  DD  SYSOUT=*
//G.SPX$DUMP  DD  SYSOUT=*
//G.SYS$DUMP  DD  SYSOUT=*
//

Note: The names INFILE, EXTFILE and PRINTER seen in the JCL lines above will also be coded in your DCB macros as the relevant DDNAME parameters for the three files.