CSCI 465

Extra Credit Assignment 2

(20 points extra credit)

This is an extra-credit assignment. Its purpose is to give you some practice at debugging COBOL programs.


The COBOL program you will be using has already been written. You can find a copy here.

Use the JCL from Part 1 of Assignment 3 (the IGYWCG procedure) to compile and run the program. You can copy and paste the program into the COBOL.SYSIN in-stream data set. You will also need to provide DD statements:

      //GO.MESSAGES DD  DSN=KC02314.SUMMER09.CSCI465.EXTRA2.DATA,DISP=SHR
      //GO.PRINTER  DD  SYSOUT=*
      //GO.SYSOUT   DD  SYSOUT=*
      //GO.CEEDUMP  DD  DUMMY

To begin with, do not make any changes in the code.

The program will compile cleanly and then ABEND. You need to fix it, making as small a change to the code as possible, and you need to document what you have done. When you replace a line of code, make that line into a comment with an asterisk in column 7, and rewrite the line. Also write a comment line explaining what you have done and why.

Now rerun the job. If anything is wrong, you may need to fix it as above. You may need to do this several times.

Example: Suppose you find this line:

       01  Some-Counter            Pic 99  Value 19.
and you decide the value is wrong. After you make your change, it should look something like this:
      *01  Some-Counter            Pic 99  Value 19
       01  Some-Counter            Pic 99  Value 18.
      * Your explanation of why you changed this detail.


What does the program read?

The input file contains one header record, followed by records containing:

         Day of the Week         9 characters
                                 1 blank space
         Date                    8 digits in MMDDYYYY format 
                                 1 blank space 
         Message                 60 characters


What does the program do?

The program opens the files, reads all the input records, creating a report, and then closes the files. The header record is not included in the report.

The report has a page heading, column headings, the date and a page number. There should be 20 detail lines per page, double-spaced, in two groups of 10 each with a line of dashes between them.


Resources for debugging

As you work through this, you may encounter various return codes and File Status values. You can find the return code on the first page of the printout, and if there is a File Status value involved, it will be mentioned at the end of the last page: a 2-digit number such as 39 or 46 or 90.

You can read about some return codes in our Notes book, and likewise the Notes book contains a list of File Status values and their meanings. (You can also find File Status values in the COBOL textbook and on one of the links from the course web site, and for that matter, you can also do a web search for "File Status" and find many relevant pages.)

You may find it useful to insert Display statements into the code for debugging purposes. (You can read about Display in the COBOL textbook if necessary.) You should remove all the Display statements afterward.


How will this be graded?

This will be graded on the basis of:

Hint: You might think of this as between 5 and 10 points per error: more for ABENDS, less for smaller problems.