Problem solve Get help with specific problems with your technologies, process and projects.

Getting a check digit program to work

I am having trouble getting a check digit program to work using a nine-digit number to generate a tenth-check digit, I tried several ways, but I keep getting the wrong results. Any suggestions?

Try arithmetic... Without knowing which check digit algorithm you are using, I would not be able to comment. I would normally look at your code and run through the working and non-working values to see what was wrong --- pretty much what you would be doing. I would also check that the results I am TOLD I should get are in fact themselves correct!

But in general, you first have to understand the algorithm. Use paper and pen to run though the steps you would take to get a right answer every time.

Then take your successful method and design the code. You may need a few tweaks, but it should work.

Dig Deeper on iSeries ILE programming

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.