In-Class Debugging Assignment
(0 points)
This is a no-credit learning assignment. It should not take long. When instructed, bring all 3 jobs to class. We will discuss each job in some detail. It will be easier to follow the discussion if you have your own printed copy.
In each part, use the IGYWCG procedure (which you used in Assignment 3) to compile and load a short COBOL program, TESTPGM, using the indicated parameters.
The test program is listed below. Copy it into your code using the COBOL.SYSIN DD statement:
//COBOL.SYSIN DD * /*
The program also requires the following DD statements:
//GO.SYSOUT DD SYSOUT=* //GO.PRINTER DD SYSOUT=*
The TESTPGM source code is listed starting on the next page.
Part 1
Use MAP and LET as Loader options: PARM.GO='_____'.
Use OFFSET, XREF, FLAG(I,I) and APOST as compiler options: PARM.COBOL='_______'.
Add a statement: //GO.CEEDUMP DD DUMMY
Part 2
Use MAP and LET as Loader options.
Use LIST, VBREF, FLAG(W,W) and APOST as compiler options.
Add a statement: //GO.CEEDUMP DD DUMMY
Part 3
Use MAP and LET as Loader options.
Use MAP, TEST and APOST as compiler options.
Use TERMTHDACT(DUMP) as a run-time parameter: PARM.GO='MAP,LET//TERMTHDACT(DUMP)'.
Add a statement: //GO.CEEDUMP DD SYSOUT=*
Listing of TESTPGM
Identification Division.
Program-Id. TESTPGM.
Environment Division.
Configuration Section.
Source-Computer. IBM-370.
Object-Computer. IBM-370.
Input-Output Section.
File-Control.
Select Print-File Assign To PRINTER.
Data Division.
File Section.
FD Print-File
Record Contains 133 Characters.
01 Print-Line.
05 Pic X(10)
05 Out-Message Pic X(100).
05 Pic X(23).
Working-Storage Section.
01 Group-Item.
05 Field-1 Pic X(5).
05 Field-2 Pic S9(5).
05 Field-3 Pic 9(4) Comp.
01 Numbers.
05 Num-1 Pic 9(4) Value 23.
05 Num-2 Pic 9(3) Comp Sync Value 256.
05 Num-3 Pic 9(5) Comp-3 Value 128.
05 Num-4 Pic 9(6) Value 50400.
01 Demos.
05 Demo-1 Pix X(8) Value 'Long Name'.
05 Demo-2 Pic X(12) Value 'Short Name'.
01 Result Pic S9(6).
Eject
Procedure Division.
000-Main.
Open Output Print-File.
Move 'We are beginning the test program." to Out-Message.
Write Print-Line.
Display 'Although this is printed after the first message'
Display 'is printed, it will show up first in the printout'
Display 'because SYSOUT is listed before PRINTER.'
Move Spaces To Group-Item.
Perform 100-Move-It.
Add 1 To Field-2 Giving Result.
Move 'If this prints, all went well.' To Out-Message.
Write Print-Line.
Close Print-File.
Stop Run.
100-Move-It.
Move Num-4 To Num-1.
Move 12345 to Num-3.
Compute Num-2 =Num-2 + 1.