Date: Thu, 4 Sep 2008 09:54:33 -0400
Reply-To: Nagakumar_Sridhar@BD.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Kumar Sridhar <Nagakumar_Sridhar@BD.COM>
Subject: Can not decipher this..
Content-Type: text/plain; charset="US-ASCII"
Hey All:
Can some one please tell me what is wrong with this piece of code:
data dm(drop=servtim servdate);
format servdate worddate.;
set dm;
by csubject csrvrtm cuserid cstatus crevisn caction;
servdate=datepart(csrvrtm);
servtim=timepart(csrvrtm);
dateonly=servdate;
if ((servtim-lag(servtim) < 3600) and (dateonly=lag(dateonly)))
then flag="X";
if flag='X' then lag(flag)=flag /* THIS IS WHERE I AM TRYING TO
PUT AN "X" TO THE PREVIOUS OBSERVATION ALSO */;
run;
I am getting the following error in my log:
3156 data dm(drop=servtim servdate);
3157 format servdate worddate.;
3158 set dm;
3159 by csubject csrvrtm cuserid cstatus crevisn caction;
3160
3161 servdate=datepart(csrvrtm);
3162 servtim=timepart(csrvrtm);
3163 dateonly=servdate;
3164 if ((servtim-lag(servtim) < 3600) and (dateonly=lag(dateonly)))
then flag="X";
3165 if flag='X' then lag(flag)=flag;
ERROR: Undeclared array referenced: lag.
ERROR: Variable lag has not been declared as an array.
3166
3167 run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.DM may be incomplete. When this step was
stopped there were 0
observations and 8 variables.
WARNING: Data set WORK.DM was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
TIA
Kumar
-----------------------------------------
*******************************************************************
IMPORTANT MESSAGE FOR RECIPIENTS IN THE
U.S.A.:
This message may constitute an advertisement of
a BD group's products or services or a
solicitation of interest in them. If this is
such a message and you would like to opt out of
receiving future advertisements or
solicitations from this BD group, please
forward this e-mail to optoutbygroup@bd.com.
*******************************************************************
This message (which includes any attachments)
is intended only for the designated
recipient(s). It may contain confidential or
proprietary information and may be subject to
the attorney-client
privilege or other confidentiality protections.
If you are not a designated recipient, you may
not review, use, copy or distribute this
message. If you received this in error, please
notify the sender by reply e-mail and delete
this message. Thank you.
*******************************************************************
Corporate Headquarters Mailing Address: BD
(Becton, Dickinson and Company) 1 Becton Drive
Franklin Lakes, NJ 07417 U.S.A.
*******************************************************************