BookmarkSubscribeRSS Feed
RichardAD
Quartz | Level 8

 

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!

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—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
  • 6557 views
  • 22 likes
  • 7 in conversation