Edited based on the clarification:
data validation;
set isbn;
array _nine [9] (10, 9, 8, 7, 6, 5, 4, 3, 2);
array nine [9];
do i=1 to 9;
nine{i}= input(substr(isbn,i, 1), best.)*_nine{i};
end;
_sum=sum(of nine:);
_remainder= mod(_sum, 11);
result= 11-_remainder;
if result eq 10 then checker= substr(isbn, 1, 9)||'X';
else if result eq 11 then checker= substr(isbn, 1, 9)||'0';
else checker= cats(substr(isbn, 1, 9), result);
if isbn=checker then isbn_validated= 'Yes';
else isbn_validated='No';
if isbn_validated='No';
keep title isbn:;
run;
proc print; run;
Fake books (N=19):
... View more