Date: Thu, 29 Mar 2001 12:59:16 +0000
Reply-To: JA <donotreply@INTERBULLETIN.BOGUS>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: JA <donotreply@INTERBULLETIN.BOGUS>
Organization: BBS InterBulletin.com
Subject: SAS Question
I'm using SAS V6.8 in the mainframe platform. My input flat file contains a field defined as packed-decimal. When I tried to compare it with literal zero, it does not give me the correct evaluation even if the field actually contains a zero value packed-decimal.
e.g.,
INPUT @01 varnum PD8.3; /* varnum has X'000000000000000F' */
...
IF (varnum NE 0.00) or (varnum NE .)
THEN varvalid = 'N';
ELSE varvalid = 'Y';
I got varlid equal to 'N'. Why?
I was able to go around it by changing the condition to :
IF ((varnum * 1) NE 0)
Why do I have to perform a numeric operation before it arives to the correct answer?
Thanks for your help in advance.
_______________________________________________
Submitted via WebNewsReader of http://www.interbulletin.com