MOVE, Arithmetic, Numeric Computation, and Business Logic Basics
Perform calculations and data movement in COBOL using the operations that drive many business-processing programs.
Inside this chapter
- MOVE Statement
- Arithmetic Statements
- COMPUTE
- Business Accuracy Matters
- Practical Example
Series navigation
Study the chapters in order for the clearest path from COBOL basics to enterprise batch processing, operational context, and modernization strategy. Use the navigation at the bottom to move smoothly through the full tutorial series.
MOVE Statement
MOVE 100 TO MONTHLY-SALARY.
MOVE CUSTOMER-NAME TO REPORT-NAME.
MOVE is one of the most common COBOL statements because programs frequently transform, copy, and route data between working storage, input records, and output structures.
Arithmetic Statements
ADD TAX-AMOUNT TO TOTAL-AMOUNT.
SUBTRACT DISCOUNT FROM INVOICE-TOTAL.
MULTIPLY HOURS BY RATE GIVING PAY-AMOUNT.
DIVIDE TOTAL-BONUS BY EMPLOYEE-COUNT GIVING BONUS-PER-EMPLOYEE.
These operations appear constantly in payroll, billing, accounting, and report generation programs.
COMPUTE
COMPUTE NET-AMOUNT = GROSS-AMOUNT - TAX-AMOUNT - DEDUCTION-AMOUNT.
COMPUTE supports more expressive formulas and is often easier to read for multi-part calculations.
Business Accuracy Matters
In COBOL systems, arithmetic is not just academic. It may determine salaries, pension amounts, loan balances, premium calculations, or tax totals. Small logic mistakes can have real financial consequences, so calculations must be designed carefully.
Practical Example
A payroll program may move employee data from an input record into working storage, compute gross and net pay, and write the results into an output record for downstream reporting. That kind of flow is classic COBOL programming.