01 ISBN-NUMBER PIC 9(13).
01 CHECK-DIGIT PIC 99.
Procedure division.
Display 'Enter ISBN Number (13 digits) :'.
ACCEPT ISBN-NUMBER.
DIVIDE ISBN-NUMBER INTO 10 GIVING ISBN-NUMBER
REMAINDER CHECK-DIGIT.
DISPLAY " ISBN NUMBER AFTER DIVIDE: "
DISPLAY " CHECK DIGIT IS: "
01 CHECK-DIGIT PIC 99.
Procedure division.
Display 'Enter ISBN Number (13 digits) :'.
ACCEPT ISBN-NUMBER.
DIVIDE ISBN-NUMBER INTO 10 GIVING ISBN-NUMBER
REMAINDER CHECK-DIGIT.
DISPLAY " ISBN NUMBER AFTER DIVIDE: "
DISPLAY " CHECK DIGIT IS: "
I enter 9780306406157
ISBN NUMBER AFTER DIVIDE: 0000000000000 (note: there are 13 digits)
CHECK DIGIT IS: 10
Supposed to be 978030640615 and 7.
What am I doing wrong?