Date: Thu, 18 Nov 1999 17:54:28 -0500
Reply-To: WHITLOI1 <WHITLOI1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: WHITLOI1 <WHITLOI1@WESTAT.COM>
Subject: Re: Do Over in v7+
Content-Type: text/plain; charset=US-ASCII
John,
I don't know about your code, but here is a log from version 7.
NOTE: Copyright (c) 1998 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software Version 7 (TS P1)
Licensed to westat, Site XXXXXXXXXXXX.
NOTE: This session is executing on the WIN_95 platform.
NOTE: SAS initialization used:
real time 27.84 seconds
1 data w ;
2 array x x1 - x4 ;
3 do over x ;
4 x = ranuni (68605 ) ;
5 end ;
6 run ;
NOTE: The data set WORK.W has 1 observations and 4 variables.
NOTE: DATA statement used:
real time 1.87 seconds
Ian Whitlock <whitloi1@westat.com>
____________________Reply Separator____________________
Subject: Do Over in v7+
Author: John Iwaniszek <john_iwaniszek@WORLDNET.ATT.NET>
Date: 11/18/1999 9:12 AM
I just found out that the DO OVER construct is not supported in version
7 (per SAS OnlineDoc, v7-1). Has anyone used this form in a verson 7+
setting? I use it in a macro that initializes retained variables.
Clearly I can live without he form but it would be annoying to lose it
for what appears to be no good reason.
John
/* fdot.sas - This macro initializes a set of like type
(example - all numeric) variable
to some common initial value on the first. of a
legal by variable.
john Iwaniszek 7/2/99 2:18PM
*/
%macro fdot( _vlist, firstby=, initial=);
%global
_arr
;
%if &_arr= %then %let _arr=0;
%let _arr=%eval( &_arr+1);
array _f_&_arr &_vlist;
if first.&firstby then do;
do over _f_&_arr;
_f_&_arr=%unquote(&initial);
end;
end;
%put NOTE: &_vlist set to &initial on first &firstby in by
group.;
%mend fdot;