-
Notifications
You must be signed in to change notification settings - Fork 0
/
eiger05.cbl
58 lines (44 loc) · 1.53 KB
/
eiger05.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
51
52
53
54
55
56
57
58
IDENTIFICATION DIVISION.
PROGRAM-ID. EIGER03.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 THE-MESSAGE PIC X(50).
01 THE-NUMBER PIC 9(2).
01 A-SPACE PIC X.
PROCEDURE DIVISION.
PROGRAM-BEGIN.
* Initialize the space variable
MOVE " " TO A-SPACE.
* Start THE-NUMBER at 0
MOVE 0 TO THE-NUMBER.
* Set up and display line 1
MOVE "There once was a lady from Eiger,"
TO THE-MESSAGE.
PERFORM ADD-NUMBER-AND-DISPLAY.
* Set up and display line 2
MOVE "Who smiled and rode forth on a tiger."
TO THE-MESSAGE.
PERFORM ADD-NUMBER-AND-DISPLAY.
* Set up and display line 3
MOVE "They returned from the ride" TO THE-MESSAGE.
PERFORM ADD-NUMBER-AND-DISPLAY.
* Set up and display line 4
MOVE "With the lady inside," TO THE-MESSAGE.
PERFORM ADD-NUMBER-AND-DISPLAY.
* Set up and display line 5
MOVE "And a smile on the face of the tiger."
TO THE-MESSAGE.
PERFORM ADD-NUMBER-AND-DISPLAY.
PROGRAM-DONE.
STOP RUN.
ADD-NUMBER-AND-DISPLAY.
PERFORM ADD-THE-NUMBER.
PERFORM DISPLAY-THE-MESSAGE.
ADD-THE-NUMBER.
ADD 1 TO THE-NUMBER.
DISPLAY-THE-MESSAGE.
DISPLAY
THE-NUMBER
A-SPACE
THE-MESSAGE.