[AI-generated Proc Studley]Here's the situation: The adventures of Proc Studley -- a popular Sci-Fi/Fantasy book series -- is under threat by a string of counterfeit/fake versions that have hit the marketplace. Your task is to find the fakes. All of the authentic books have valid ISBN 10-digit numbers, which is how world libraries track books. The counterfeit books have invalid ISBN values.
(This challenge first premiered in SAS Analytics Explorers, a special group for customers who want to do more with their SAS learning and earn rewards in the process!)
The algorithm for validating ISBN-10 values uses a checksum approach. Here are the steps:
Multiply each of the first 9 digits by a number in the descending sequence from 10 to 2, and sum the results.
Divide the sum by 11.
Subtract the remainder (not the quotient) from 11.
For the 10th digit, use the difference from the previous step. If that difference is 11, use the number 0; if 10, use the letter X.
Here are the book titles and their purported ISBN values. Write a the shortest possible SAS program that reads the book list, validates each ISBN value, and create a report of the real and fake books. Include your code and the output in your response!
(Note: obviously all of these books are made up, but the ISBN number scheme and algorithm is a real thing! You can check your work ad hoc with the ISBN Checker.)
Here's the data, all ready to run in SAS.
data isbn;
infile datalines dsd;
length title $ 70 isbn $ 10;
input title isbn;
datalines;
Proc Studley and the Starship of Destiny,0434488665
The Chronicles of Proc Studley: The Lost Realm,2018166516
Proc Studley and the Quantum Key,9405643837
The Legend of Proc Studley: The Celestial Quest,6032522768
Proc Studley and the Enchanted Nebula,4394205952
The Adventures of Proc Studley: The Galactic Rift,2353276079
Proc Studley and the Time Crystal,6493135591
The Saga of Proc Studley: The Forbidden Planet,6776994355
Proc Studley and the Alien Alliance,2227835451
The Epic of Proc Studley: The Cosmic War,8018735913
Proc Studley and the Dragon of Andromeda,0841779538
The Odyssey of Proc Studley: The Stellar Siege,8730652341
Proc Studley and the Phoenix Star,1594122350
The Journey of Proc Studley: The Nebula Nexus,224320418X
Proc Studley and the Shadow Realm,6857923406
The Quest of Proc Studley: The Celestial Citadel,3967006111
Proc Studley and the Interstellar Insurrection,9537581977
The Trials of Proc Studley: The Quantum Paradox,1283514257
Proc Studley and the Martian Rebellion,566485052X
The Legacy of Proc Studley: The Galactic Guardians,6994588902
Proc Studley and the Eternal Eclipse,9236137644
The Chronicles of Proc Studley: The Andromeda Enigma,7649918275
Proc Studley and the Infinite Horizon,458574645X
The Adventures of Proc Studley: The Alien Dawn,7601111520
Proc Studley and the Black Hole Conspiracy,1911465988
The Legend of Proc Studley: The Cosmic Code,266671036X
Proc Studley and the Celestial Shadows,4287030303
The Saga of Proc Studley: The Stellar Saga,2561407012
Proc Studley and the Quantum Quest,6933010252
The Epic of Proc Studley: The Celestial Conflict,4278675463
Proc Studley and the Galactic Gambit,351049735X
The Odyssey of Proc Studley: The Nebula Knights,0566910450
Proc Studley and the Cosmic Crusade,9802436077
The Journey of Proc Studley: The Andromeda Ascension,195432331X
Proc Studley and the Stellar Struggle,8421179217
The Quest of Proc Studley: The Alien Artifact,0979272564
Proc Studley and the Celestial Saga,3584795834
The Trials of Proc Studley: The Galactic Genesis,0713565068
Proc Studley and the Quantum Conundrum,9074601407
The Legacy of Proc Studley: The Cosmic Odyssey,0168786583
;
run;
... View more