summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2022-11-28 17:24:14 +0200
committerIgor Pashev <pashev.igor@gmail.com>2022-11-28 17:24:14 +0200
commit10ae1088fe818eb9cb93f566d5e38a9f1c2fd77e (patch)
tree4c7c65dda36888d066c9d26dc8a585ca785327f0
parent88c3b6b694f37a4d74a095117370279f6483cf9e (diff)
downloadgcd-10ae1088fe818eb9cb93f566d5e38a9f1c2fd77e.tar.gz
COBOL: remove output hack
-rw-r--r--gcd.cob8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcd.cob b/gcd.cob
index b6ce0db..44a60f9 100644
--- a/gcd.cob
+++ b/gcd.cob
@@ -10,8 +10,9 @@
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-COUNT PIC 9(20).
- 01 WS-GCD PIC Z(20).
+ 01 WS-GCD PIC 9(20).
01 WS-NUM PIC 9(20).
+ 01 WS-OUT PIC Z(20).
PROCEDURE DIVISION.
ACCEPT WS-COUNT FROM ARGUMENT-NUMBER.
IF WS-COUNT = 0 STOP RUN.
@@ -21,7 +22,8 @@
CALL 'GCD2' USING WS-GCD, WS-NUM
SUBTRACT 1 FROM WS-COUNT
END-PERFORM.
- DISPLAY FUNCTION TRIM (WS-GCD LEADING).
+ MOVE WS-GCD TO WS-OUT.
+ DISPLAY FUNCTION TRIM (WS-OUT LEADING).
END PROGRAM GCD.
IDENTIFICATION DIVISION.
@@ -30,7 +32,7 @@
WORKING-STORAGE SECTION.
01 WS-C PIC 9(20).
LINKAGE SECTION.
- 01 L-A PIC Z(20).
+ 01 L-A PIC 9(20).
01 L-B PIC 9(20).
PROCEDURE DIVISION USING L-A, L-B.
PERFORM WITH TEST BEFORE UNTIL L-B = 0