Date: Tue, 23 Oct 2007 17:29:53 -0000
Reply-To: Pat <PLarkin2@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Pat <PLarkin2@GMAIL.COM>
Organization: http://groups.google.com
Subject: Newbie wants to program
Content-Type: text/plain; charset="iso-8859-1"
I work with financial data at a university using SAS 9.1. In the past,
I've manipulated my data using an assembly language program that I'm
too embarrassed to name (but it starts with an F and ends with a tran)
and then entered it into SAS to do regressions and other statistical
procs. I've heard that this is a waste of time and that I can just do
all of the manipulations in SAS. I am having trouble figuring out how
to do that. I know that SAS has an array statement, but I don't think
that I really want to make an entire row into an array. Let me try to
explain what I'd like to do. It's pretty simple:
x1 y1 z1
x2 y2 z2
. . .
. . .
xn yn zn
I would like to be able to create a variable, call it w, and make it
an array with dimensions n-3 rows by 1 column. Then, do something like
this, but using SAS code:
do i=1,n-3
if x(i+3) not equal to -99
then w(i) = x(i+3) + y(i+3) / z(i+3)
else
w(i) = -99
end if
end do
Thanks for your attention
|