Date: Mon, 19 Jul 2004 09:40:36 -0400
Reply-To: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject: Re: creating a scalar variable
Content-Type: text/plain; charset="iso-8859-1"
Zio:
I hope that your instructor doesn't subscribe to SAS-L! Whatever his or her
skill level, it does turn out that SAS, like many other so-called 'database
programming languages', operates on actual or virtual tables. A table can
degenerate to a one-column, one-row cell that has many of the properties of
a scalar. More typically, a database programmer combines tabular datasets to
produce solutions to programming problems.
It takes a while to learn how to combine tabular datasets effectively. Once
you learn how, you will be able to do more in less time and with fewer
errors.
Sig
-----Original Message-----
From: SAS(r) Discussion
To: SAS-L@LISTSERV.UGA.EDU
Sent: 7/19/2004 4:40 AM
Subject: creating a scalar variable
I apologize if the question may seem too banal. I'm a university
student, and I have to do an exam on SAS. My instructor told us that SAS
only "thinks" row by row, and that it's not possible to create a scalar
variable. Is this true? The instructor does not seem very skilled, and
it seems to me unthinkable that a programming language cannot manage
scalar variables.
For instance, can I create a scalar variable that equals the maximum (or
the mean, or whatever... )of a dataset?
If I have to compare every observation with a scalar variable, how could
I do it? E.g. : I have to read a number from a file and wanna assign it
to a scalar variable. Then I have to compare every observation in the
dataset with this variable, and, according to the comparison, take some
action. The instructor said the only way to do it is to create a field
in which every observation takes the same value! Is it really like that?
|