Search code examples
sasprocsas-macro

Changed byte value solved this, but why? SAS: this range is repeated, or values overlap


My BI department just ran into the SAS error: this range is repeated, or values overlap.

I found some links they looked at and found that there was an error in a macro. The error was that the length of a numeric variable byte value was changed from 7 to 6 bytes created this error. Now when they changed it back to it's previous value everything is ok.

What is this behaviour all about? Are there some logic in this?


Solution

  • When reducing the length of a variable from 7 to 6 bytes, some numbers might get "truncated". 7 bytes can store integers up to 35,184,372,088,832 while 6 bytes can store only integers up to 137,438,953,472. Decimal numbers should always be length 8. See here for details.