|
|
|
|
|
|
|
|
|
|
* |
|
|
IDENTIFICATION |
|
DIVISION. |
|
|
PROGRAM-ID. |
|
SAMPLE4. |
|
* |
|
|
ENVIRONMENT |
|
DIVISION. |
|
|
CONFIGURATION |
|
SECTION. |
|
|
SOURCE-COMPUTER. |
|
SAMSUNG. |
|
|
OBJECT-COMPUTER. |
|
SAMSUNG. |
|
|
INPUT-OUTPUT |
|
SECTION. |
|
|
FILE-CONTROL. |
|
|
|
|
|
SELECT P-F ASSIGN TO OUTPUT
"SAMPLE4.OUT". |
|
* |
|
|
DATA |
|
DIVISION. |
|
|
FILE |
|
|
|
SECTION. |
|
|
FD |
|
P-F |
LABEL RECORD IS STANDARD. |
|
|
01 |
|
P-R |
PIC |
X(80). |
|
* |
|
|
|
|
|
|
|
|
WORKING-STORAGE |
|
SECTION. |
|
* |
|
|
77 |
|
I |
PIC |
9(3). |
|
|
|
77 |
|
J |
PIC |
9(3). |
|
|
|
77 |
|
K |
PIC |
9(3). |
|
|
|
01 |
|
PR-L. |
|
|
|
|
|
|
03 |
FILLER |
PIC |
X(50) VALUE SPACES. |
|
|
|
03 |
PI |
|
PIC |
ZZ9. |
|
|
|
03 |
FILLER |
PIC |
X(4) VALUE " * ". |
|
|
|
03 |
PJ |
|
PIC |
ZZ9. |
|
|
|
03 |
FILLER |
PIC |
X(4) VALUE " = ". |
|
|
|
03 |
PK |
|
PIC |
ZZ9. |
|
|
|
03 |
FILLER |
PIC |
X(13) VALUE SPACES. |
|
* |
|
|
PROCEDURE |
|
DIVISION. |
|
|
START-RTN. |
|
|
|
|
|
|
|
OPEN OUTPUT P-F. |
|
|
|
PERFORM A-RTN 9 TIMES. |
|
|
|
CLOSE P-F. |
|
|
|
STOP RUN. |
|
|
A-RTN. |
|
|
|
|
|
|
|
ADD 1 TO I. |
|
|
|
MOVE 0 TO J. |
|
|
|
PERFORM B-RTN 9 TIMES. |
|
|
B-RTN. |
|
|
|
|
|
|
|
ADD 1 TO J. |
|
|
|
COMPUTE K = I * J. |
|
|
|
MOVE I TO PI. |
|
|
|
MOVE J TO PJ. |
|
|
|
MOVE K TO PK. |
|
|
|
DISPLAY PR-L. |
|
|
|
WRITE P-R FROM PR-L
AFTER 1. |
|
|
|
|
|
|
|
|
|
|