BookmarkSubscribeRSS Feed
RichardAD
Obsidian | Level 7

 

v = substr('1234567890X',11-mod(vsum,11)) =: substr(isbn,10,1) ;

 

has a bug. The 0X is transposed. It should be

 

v = substr('123456789X0',11-mod(vsum,11)) =: substr(isbn,10,1) ;

 

 

Based on the other solutions withs+r*i[r]there seems to be a mathematical tautology.

golf.png

The righthand side being the algorithm steps stated initially.

FreelanceReinh
Jade | Level 19

@RichardAD wrote:

Based on the other solutions withs+r*i[r]there seems to be a mathematical tautology.

golf.png

The righthand side being the algorithm steps stated initially.


Unless you actually mean (11 − (S...)) mod 11 on the right-hand side, it should rather be (11 − (S...) mod 11) mod 11, where the outer (...) mod 11 corresponds to the last bullet point in Chris' description of the algorithm. For example, if all di are zero, the left-hand side is zero and so must be the right-hand side. The validity of the equation can be proved easily by applying the calculation rules of what mathematicians call the quotient ring Z11=Z/11Z.

ChrisHemedinger
Community Manager

The response here have been of very high quality. Proc Studley thanks you all for your service!

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 17 replies
  • 2468 views
  • 22 likes
  • 7 in conversation