|
|
|
|
|
|
|
|
|
|
* |
|
|
IDENTIFICATION |
|
DIVISION. |
|
|
PROGRAM-ID. |
|
T4. |
|
* |
|
|
ENVIRONMENT |
|
DIVISION. |
|
|
CONFIGURATION |
|
SECTION. |
|
|
SOURCE-COMPUTER. |
|
SAMSUNG. |
|
|
OBJECT-COMPUTER. |
|
SAMSUNG. |
|
* |
|
|
DATA |
|
DIVISION. |
|
|
WORKING-STORAGE |
|
SECTION. |
|
* |
|
|
77 |
|
I |
PIC |
99 |
VALUE 0. |
|
|
77 |
|
J |
PIC |
99 |
VALUE 0. |
|
|
77 |
|
C |
PIC |
99 |
VALUE 0. |
|
|
77 |
|
D |
PIC |
99 |
VALUE 0. |
|
|
77 |
|
E |
PIC |
99 |
VALUE 0. |
|
|
01 |
|
TAB1-ENTRY |
VALUE "112233445566778899". |
|
|
|
03 |
A1 |
OCCURS 3 TIMES. |
|
|
|
|
05 |
A |
PIC |
99 |
OCCURS 3 TIMES. |
|
|
01 |
|
TAB2-ENTRY |
VALUE "112233445566778899". |
|
|
|
03 |
B1 |
OCCURS 3 TIMES. |
|
|
|
|
05 |
B |
PIC |
99 |
OCCURS 3 TIMES. |
|
* |
|
|
PROCEDURE |
|
DIVISION. |
|
|
START-RTN. |
|
|
|
|
|
|
|
DISPLAY " " ERASE. |
|
|
|
PERFORM DIS1-RTN |
|
|
|
|
|
VARYING I FROM 1
BY 1 UNTIL I > 3 |
|
|
|
|
|
AFTER J FROM
1 BY 1 UNTIL J > 3. |
|
|
|
PERFORM MOVE-RTN |
|
|
|
|
|
VARYING I FROM 1
BY 1 UNTIL I > 3 |
|
|
|
|
|
AFTER J FROM
1 BY 1 UNTIL J > 3. |
|
|
|
PERFORM DIS2-RTN |
|
|
|
|
|
VARYING I FROM 1
BY 1 UNTIL I > 3 |
|
|
|
|
|
AFTER J FROM
1 BY 1 UNTIL J > 3. |
|
|
END-RTN. |
|
|
|
|
|
|
|
STOP RUN. |
|
|
|
|
|
DIS1-RTN. |
|
|
|
|
|
|
|
COMPUTE C = I + 7. |
|
|
|
IF J = 1 MOVE 1 TO
D ELSE MOVE 0 TO D. |
|
|
|
DISPLAY A(I, J) LINE C
POSITION D. |
|
|
|
DISPLAY " "
LINE C POSITION 0. |
|
|
DIS2-RTN. |
|
|
|
|
|
|
|
COMPUTE C = I + 12. |
|
|
|
IF J = 1 MOVE 1 TO
D ELSE MOVE 0 TO D. |
|
|
|
DISPLAY B(I, J) LINE C
POSITION D. |
|
|
|
DISPLAY " "
LINE C POSITION 0. |
|
|
MOVE-RTN. |
|
|
|
|
|
|
|
MOVE A(I, J) TO B(J, I). |
|
|
|
|
|
|
|
|
|