|
地板
楼主 |
发表于 2004-5-16 08:07:01
|
只看该作者
It is something many SAS programmers got confused all the time. When you say that a macro variable is a character variable, it implies that some macro variable can be numeric. Is there any numeric macro variables? None. Besides, eventhough all the macro variables are in character format, it is treated differently compared with the character variables in data set. Your previous question gave a good example. For character variable in data set, X='ABC' give the value ABC to X; for a macro variable %let X='ABC' gives value 'ABC' to macro variable X. The best way to understand macro variable is to think macro language to be a tool to generate SAS program syntax, so if &i=5, the SAS statement IF ID=5; has no problem at all. For many SAS novice users, it may take some time to be comfortable with it, since it is SAS specific, not similar to any other languages. |
|