A colleague had a proc summary where a total count of positive and negative counts was zero on the data sheet in EG. The data manually pointed to a net result of zero. The total became a denominator in a percentage calculation and the business rule was to use the usual formula when the total was positive, a flag value when negative and a different flag value when it was zero. She used a SELECT and the negative flag value was produced instead of the zero flag value. We expanded the when (value < 0) statement out and putlog in each case printed zero using n=. The variable summed positive and negative whole numbers so floating point shouldn't have been a problem but tried k=fuzz(n) an putting y= and still got zero. Did an x=put(n, E12.) and putlog x= gave a left adjusted '0'. All this was in the do;...end; following the test on being less than zero.
I recall seeing reference to -0 being produced by proc summary and being displayed as '0' but taken to be less than plain vanilla 0 in SAS. I can't help wondering if this is such a case.
Thanks Patrick. It was the sum of integer counts so there shouldn't be any floating point issues. I'll check the manual for a hex format that may reveal the bit pattern and compare with the pattern for zero. Applying the ROUND or FUZZ function may also by forcing it to be zero, help or even adding 1 and comparing with 1 then subtracting the 1. We were scratching our heads till near 7:30pm Friday night before we thought it could wait till Monday
Problem solved. My colleague had set "options missing=0" and the value was missing rather than negative zero. I suggested she only use it in future just before ODS and then immediately issue "options missing=". again. A very dangerous option IMO. Seeing a '.' tells me I have my merges/joins wrong and that is important.