Careful. In Canada the first four digits identify the issuer. - -teD - Original Message From: Gerhard Postpischil Sent: Tuesday, February 18, 2014 23:57 To: IBM-MAIN@LISTSERV.UA.EDU Reply To: IBM Mainframe Discussion List Subject: Re: Packed decimal (again!)
On 2/18/2014 2:08 PM, Phil Smith wrote: > The same applies in spades to credit card numbers, which you're even > less likely to be doing math on, though I suppose there's a bit more > prefix analysis or IINs and the like, so maybe x'04000123456789123' > for CCN 4000123456789123 might be a bit easier to process. Does COBOL > make packed easier to work with? Yes, COBOL isn't my strongest > language - "You say that like it's a negative thing", as Woody Allen > would put it :) You're wrong about math use with credit card numbers. The leading three/four digit identify the bank, and the last digit is a checksum calculated from the remaining 8/9 digits. Keeping the number in unsigned packed form can speed verification, especially considering that some common devices don't have the arithmetic capability of handling 10-digit numbers in binary form. Not to mention the delights of converting big-endian to little-endian and v.v. I worked as a contractor at a government agency where they kept files with hundreds of millions of records, and unsigned hex was a compromise between file size and CPU time for data conversion. They had an even more bastardized form where the last byte was processed with a translate table to see if the number was negative. Gerhard Postpischil Bradford, Vermont ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN