The NVE / SSCC check digit is calculated the same way as UPC/EAN number. Here are the steps:
- From the right to left, start with odd position, assign the odd/even position to each digit.
- Sum all digits in odd position and multiply the result by 3.
- Sum all digits in even position.
- Sum the results of step 3 and step 4.
- divide the result of step 4 by 10. The check digit is the number which adds the remainder to 10.
You have to reconstruct the barcode (EAN and Mod-10) check digit function with the customary functions of TFORMer.
a) Create new data fields: NVE_17 (string) and NVE_Checkdigit (long).
b) As Pre-Evaluation in the detail area, the following check digit extension is the result of:
// first add odd positions from right to left
(index is zero based)
NVE_Checkdigit = CLng (Mid (NVE_17, 16, 1))
+ CLng (Mid (NVE_17, 14, 1))
+ CLng ( Mid (NVE_17, 12, 1))
+ CLng( Mid (NVE_17, 10, 1))
+ CLng( Mid (NVE_17, 8, 1) )
+ CLng(Mid (NVE_17, 6, 1))
+ CLng (Mid (NVE_17, 4, 1) )
+ CLng ( Mid (NVE_17, 2, 1) )
+ CLng ( Mid (NVE_17, 0, 1) )
// multiply with 3
NVE_Checkdigit = NVE_Checkdigit * 3
// sum of digits in even pos
NVE_Checkdigit = NVE_Checkdigit
+ CLng (Mid (NVE_17, 15, 1))
+ CLng (Mid (NVE_17, 13, 1))
+ CLng ( Mid (NVE_17, 11, 1))
+ CLng( Mid (NVE_17, 9, 1))
+ CLng( Mid (NVE_17, 7, 1) )
+ CLng(Mid (NVE_17, 5, 1))
+ CLng (Mid (NVE_17, 3, 1) )
+ CLng ( Mid (NVE_17, 1, 1) )
// at last perform mod 10 with remainder calculation
NVE_Checkdigit = (10 - (NVE_Checkdigit % 10)) % 10
After that, check the NVE-Check digit if the same check digit is in the barcode.