| Date: | Wed, 7 Feb 2007 20:48:05 -0000 |
| Reply-To: | syner@PCHOME.COM.TW |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Simon Chang <syner@PCHOME.COM.TW> |
| Subject: | FW: counter variable ^ another question |
| Content-Type: | text/plain; charset="us-ascii" |
Private work costs
Unless you are prepared to pay, expose your learning curve, and ask
sas-L
Peter
-----Original Message-----
From: Simon [mailto:syner@pchome.com.tw]
Sent: 07 February 2007 16:57
To: 'Peter Crawford'
Subject: RE: counter variable
Dear Peter:
Could I ask you another question?
I tried to write a sas code to produce new variables (D2001-D2006,
actually
I ignore months in this example!) relating to old variables (P_01-P_99)
as
below and have some problems in doing so.
(1)Why can't I use "D&y" in the following sas code
(2)Should I write "output;"?
data test; set a;
array P(1:99) P_01-P_99;
do yyyy=2001 to 2006;
call symput('y',trim(left(yyyy)));
i= (yyyy - L1_yyyy)*12;
if i>=1 and i<=99 then
D&y= P(i);
output;
end;
run;
Thank You in advance for the kindly reply!
Simon
|