| Date: | Sat, 11 Apr 1998 13:37:54 GMT |
| Reply-To: | Tim Obrey <tobrey@MOOSEHEAD.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU> |
| From: | Tim Obrey <tobrey@MOOSEHEAD.NET> |
| Subject: | Re: AF variable with missing value\\ Solved |
| Content-Type: | Text/Plain; charset=ISO-8859-1 |
|---|
In article <NW6X.1025$XG.12255955@harpo.ctel.net>, tobrey@moosehead.net
says...
>
>I am trying to write an AF application that allows the user to enter values
>into 3 variables(watcode($),year(n), and gear($)). The user may enter a
value
>in none, one, two, or all three variables. The SCL program will then create
a
>subset of an existing SAS dataset based on the user entered values. This
>works fine if all three values are entered. However, if no year is entered,
>there is no assignment made. I would have thought it would have been assigned
>a missing value (.) as with other missing numeric values. So the problem is,
>if I have a subsetting if statement: if yr=&year; And there is no value for
>year it is translated as: if year=; This results in an error. I have tried
>every imaginable combination to try to assign some kind of a value to a
>non-existent value and I'm stumped. This seemed like a reasonably simple
task
>at the start(ha!,ha!) and perhaps I'm off the mark. Does anyone have any
>advice for trying to create such a subset based on the 8 possible
>permeatations of 3 variables (value entered or no value). TIA
>
Thanks for all the help. I've got it working now. I tried the following in
the SCL : if year ne _blank_ then do; but couldn't get it to work. I also
checked under globals -->options--> missing--> and found that despite being
set to . the AF variables still were left blank. The easiest way to solve
the problem was to enter a . on the INITIAL field in the ATTR window. Also,
I got it to work correctly by initializing the variables in the INIT: part of
the SCL :
INIT:
year=.;
watcode='';
return;
Thanks again,
Tim
|