Prev Up Next
Go backward to 4.3 Enter a PASCAL program
Go up to 4 Labs
Go forward to 4.5 Pascal program compile and run

4.4 Run a COBOL program

COBOL is a common business language. In this lab you will copy an existing program into your area, go through the necessary steps to compile and link the program, and then you will run the executable version of the program. You will also produce a listing file, a symbolic map file, a relocatable object file and an executable binary file while doing this lab.
  1. Use the copy command to copy the COBOL program class:mortgage.cob to your area.
    $ copy class:mortgage.cob *
    
    into your directory.
  2. Compile the program using the COBOL compiler, requesting a listing
     
    $ cobol /list mortgage
    
    This produces the object (.OBJ) and listing (.LIS) files.
  3. Type MORTGAGE.LIS on your terminal. Press ^Y when you have seen enough.
  4. Link-load the object file producing a link map. This produces the executable (.EXE) and map (.MAP) files.
     
    $ link /map mortgage
    
  5. Type out part of MORTGAGE.MAP. Press ^Y after a few screens.
  6. Execute the program.
     
    $ run mortgage
    
  7. The program will request some input answer as follows (use the numbers provided please)
     
    YEAR BEGIN:    1996 
    MONTH BEGIN:   10 
    BEG-BAL:       10000.00 
    PAYMENT AMT:   500.00 
    INTEREST RATE: 0.12
    
  8. The program should print some values on your terminal, and also create a detailed report file on disk called MORTGAGE.RPT. See what files you have.
     
    $ dir mortgage.*
    
  9. Print out the report with the delete option. (This will cause it to be automatically deleted after printing.)
     
    $ purge mortgage.rpt 
    $ print/delete mortgage.rpt
    
  10. Clean up by deleting the rest of the files not needed.
     
    $ delete mortgage.cob;*
    $ delete mortgage.lis;*
    $ delete mortgage.obj;*
    $ delete mortgage.map;*
    $ delete mortgage.exe;*
    
On the print out from step hand print the following:
Your-Name
Lab 4.4: Mortgage
TABER CSC135
Place the lab in the instructor hand-in box in BUS R6E, the "terminal room".
Instructor: ltaber@pima.edu** Red's Home page** The Pima College Site

Prev Up Next