| Date: | Wed, 21 Jan 2009 14:38:46 +0000 |
| Reply-To: | Paul Dorfman <sashole@BELLSOUTH.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Paul Dorfman <sashole@BELLSOUTH.NET> |
| Organization: | PDC |
| Subject: | Re: IFN function - strange behaviour |
|
| In-Reply-To: | <7dce49ae-d9f8-441a-aa80-564bd4702fe8@f40g2000pri.googlegroups.com> |
| Content-Type: | text/plain; charset="utf-8" |
GuyA,
Nothing strange. SAS just sets it to a .I, that is missing I. A simple experiment confirms it:
290 data _null_ ;
291 c = divide (1, 0) ;
292 is_c_null_i = (c = .I) ;
293 put is_c_null_i= ;
294 run ;
is_c_null_i=1
So, as any missing value, it is *printed* as whatever character follows the period in the missing value literal definition. Thus, if missing value is ._, the underscore is printed, if it is just .(dot-blank, standard missing value), then a space is printed, if it is .A, then A is printed, and so on to .Z, when Z is printed. And yes, any missing value is a SAS number selected by SAS from a number of real binary representations called NAN, i.e. "not a number". Double pun intended.
Kind regards
------------
Paul Dorfman
Jax. FL
------------ -------------- Original message from GuyA <guya.carpenter@GMAIL.COM>: --------------
> All interesting, thanks.
>
> I didn't know there was a divide function. Just a quick test though to
> check to myself that it exists seemed to bring up an unusual result:
>
> Code:
>
> data test;
> input var1 var2;
> var3=divide(var1,var2);
> put var3;
> datalines;
> 1 2
> 2 1
> 0 0
> 0 1
> 1 0
> ;
>
> Output:
>
> 74 input var1 var2;
> 75 var3=divide(var1,var2);
> 76 put var3;
> 77 datalines;
>
> 0.5
> 2
> .
> 0
> I
>
> The last observation output is not a number. It's the "pipe"
> character. And strangely, the variable was still numeric.
>
> Any ideas?
|