[Santa Clara University]
Department of Mathematics
and Computer Science
[Return to Math 169 Homepage]

Math 169 Notes -- COBOL


Contents


A. Sample Program

This sample COBOL program reads in a file containing an identification number on each line, followed by a name, followed by a balance. The formatting of this input line is reflected in the "INLINE" working record variable.

The "BALANCE" section of each of these lines is summed together to produce a "TOTAL" which is printed out after all the lines are repeated.

In order to switch formatting to introduce a $ sign in the output, the input balance is moved into a temporary variable with appropriate editing and then back to the output balance section.

This is the link to file TEST2.COB.

B. Input

This is the link to input file MP2INA.INP.

This file contains several lines of data as described above (id number, name, balance).

C. Output

This is the link to output file MP2OU.OUT.


This page is maintained by Dennis C. Smolarski, S.J. dsmolarski@math.scu.edu
Last updated: 2 May 2000.