@caerbannog wrote: Even though I've been able to put together that example, I haven't written the original code but I've been asked to maintain it and run it. I'm familiar with 8 programming languages and proficient (professionally) with at least half of them. Still, I think this is the only case where I've seen such an unclear distinction between integer and non-integer logical operations, and the error message tells something about a character operand. In addition, 1.0, 2.0 and 0.0 might look like integers to a human being, but usually, a parser should interpret them as non-integer numbers, so I also assumed that was the case for SAS.
It is probably helps to understand that SAS code and macro code are two different languages.
In SAS code there is only one type of number, floating point numbers. But in some languages support other type of numbers including integers. Try calculating 5/3 and 5.0/3.0 in one of the languages and see if you get the same results. In SAS code you always get the same answer since SAS only using floating point numbers.
But the macro processor is just a text manipulation tool. Everything is a character string to the macro processor. But to support things like %DO loops they needed to include some recognition of numbers. So they build in some integer arithmetic (including integer comparison operators) with the %EVAL() function. That is what is used by %IF and %DO loops to deal with integer arithmetic. Since integers do not need a decimal place, that is why something with a period is seen as a string.
To support the occasional need for floating point arithmetic they added the %SYSEVALF() function.
... View more