-
Notifications
You must be signed in to change notification settings - Fork 16
/
simple_geo3x3.cbl
50 lines (50 loc) · 1.95 KB
/
simple_geo3x3.cbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
IDENTIFICATION DIVISION.
PROGRAM-ID. geo3x3_test.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WK-AREA.
03 LAT PIC S9(03)V9(6).
03 LNG PIC S9(03)V9(6).
03 UNT PIC S9(03)V9(6).
03 LEVEL PIC 9(02).
01 RES PIC X(31).
01 COD PIC X(31).
PROCEDURE DIVISION.
MAIN-01.
MOVE 14 TO LEVEL.
MOVE 35.65858 TO LAT.
MOVE 139.745433 TO LNG.
MOVE SPACE TO RES.
DISPLAY "LAT = " LAT.
DISPLAY "LNG = " LNG.
DISPLAY "LEVEL= " LEVEL.
CALL "geo3x3_encode" USING BY REFERENCE LAT
BY REFERENCE LNG
BY REFERENCE LEVEL
BY REFERENCE RES
END-CALL.
DISPLAY "RES = " RES.
*
MOVE RES TO COD.
INITIALIZE WK-AREA.
CALL "geo3x3_decode" USING BY REFERENCE COD
BY REFERENCE LAT
BY REFERENCE LNG
BY REFERENCE LEVEL
BY REFERENCE UNT
END-CALL.
DISPLAY "LAT = " LAT.
DISPLAY "LNG = " LNG.
DISPLAY "LEVEL= " LEVEL.
DISPLAY "UNIT = " UNT.
*
MOVE SPACE TO RES.
CALL "geo3x3_encode" USING BY REFERENCE LAT
BY REFERENCE LNG
BY REFERENCE LEVEL
BY REFERENCE RES
END-CALL.
DISPLAY "RES = " RES.
MAIN-99.
STOP RUN.
END PROGRAM geo3x3_test.