Date: Tue, 15 Jan 2008 10:29:21 -0600
Reply-To: "data _null_," <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_," <datanull@GMAIL.COM>
Subject: Re: Question on Do-Whitlock (DOW) loop.
In-Reply-To: <2C6B65AAC3623140922DE580669C456A03B7A7DC@LTA3VS001.ees.hhs.gov>
Content-Type: text/plain; charset=ISO-8859-1
I fail to see how this program relates to IW's argument about
enclosing DO UNTIL(LAST.byvar) in DO UNTIL(EOF);
Assuming that the first published reference is the 1983 SUGI paper by
DH. Why was DO UNTIL(LAST.byvar) never offered as a solution to a
question on SAS-L before IWs post in 2000. I tried searching via
Google groups and found nothing. But the fact that I did not find it
means little, my search may have been flawed.
On Jan 15, 2008 9:59 AM, Fehd, Ronald J. (CDC/CCHIS/NCPHI) <rjf2@cdc.gov> wrote:
> Okay, I sit corrected.
> Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
>
> *test-DOW;
>
> options fullstimer;
>
> DATA Testing;
> do until(EndoFile);
> set sashelp.Class end = EndoFile;
> do i = 1 to 1e6;
> output;
> end;
> end;
> stop;
>
> NOTE: There were 19 observations read from the data set SASHELP.CLASS.
> NOTE: The data set WORK.TESTING has 19000000 observations and 6
> variables.
> NOTE: DATA statement used (Total process time):
> real time 1:09.17
> user cpu time 3.12 seconds
> system cpu time 8.84 seconds
> Memory 181k
>
> PROC Sort data = Testing;
> by Sex;
>
> NOTE: There were 19000000 observations read from the data set
> WORK.TESTING.
> NOTE: The data set WORK.TESTING has 19000000 observations and 6
> variables.
> NOTE: PROCEDURE SORT used (Total process time):
> real time 5:47.96
> user cpu time 23.79 seconds
> system cpu time 22.98 seconds
> Memory 66033k
>
>
> DATA Read1;
> do until(EndoFile);
> set Testing end = EndoFile;
> by Sex;
> if last.Sex then output;
> end;
> stop;
>
> NOTE: There were 19000000 observations read from the data set
> WORK.TESTING.
> NOTE: The data set WORK.READ1 has 2 observations and 6 variables.
> NOTE: DATA statement used (Total process time):
> real time 49.20 seconds
> user cpu time 4.89 seconds
> system cpu time 1.20 seconds
> Memory 205k
>
> DATA Read2;
> do until(EndoFile);
> do until(last.Sex);
> set Testing end = EndoFile;
> by Sex;
> end;
> output;
> end;
> stop;
>
> NOTE: There were 19000000 observations read from the data set
> WORK.TESTING.
> NOTE: The data set WORK.READ2 has 2 observations and 6 variables.
> NOTE: DATA statement used (Total process time):
> real time 10.82 seconds
> user cpu time 4.75 seconds
> system cpu time 1.39 seconds
> Memory 205k
>
> DATA Read3;
> *do until(EndoFile);
> do until(last.Sex);
> set Testing end = EndoFile;
> by Sex;
> end;
> output;
> *end;
> stop;
>
> NOTE: There were 9000001 observations read from the data set
> WORK.TESTING.
> NOTE: The data set WORK.READ3 has 1 observations and 6 variables.
> NOTE: DATA statement used (Total process time):
> real time 4.18 seconds
> user cpu time 2.15 seconds
> system cpu time 0.61 seconds
> Memory 205k
>
> !*! NOTE THE NUMBER OF OBSERVATIONS READ: 9000001 not 19000000
>
> DATA Read4;
> *do until(EndoFile);
> *do until(last.Sex);
> set Testing;* end = EndoFile;
> by Sex;
> if last.Sex then output;
> *end;
> *output;
> *end;
> *stop;
> run;
>
> NOTE: There were 19000000 observations read from the data set
> WORK.TESTING.
> NOTE: The data set WORK.READ4 has 2 observations and 6 variables.
> NOTE: DATA statement used (Total process time):
> real time 11.54 seconds
> user cpu time 4.76 seconds
> system cpu time 1.45 seconds
> Memory 205k
>
|