|
John, If the ob one might consider LAST. is excluded by a WHERE, then the
previous ob becomes LAST. If it is excluded by an IF, then the results are
probably bad. Imagine the results of the code below if NAME is missing for
the last student in a class. Consider the result if the deletion is done in
a WHERE clause.
Tim
DATA SIZE;
SET GRADES;
BY CLASS;
RETAIN NUMSTU;
IF FIRST.CLASS THEN NUMSTU=0;
NUMSTU+1;
IF NAME EQ '' THEN DELETE;
IF LAST.CLASS THEN OUTPUT;
RUN;
> ----------
> From: medisci@powernet.com[SMTP:medisci@powernet.com]
> Sent: Thursday, April 22, 1999 12:44 PM
> To: Berryhill, Timothy; SAS-L@UGA.CC.UGA.EDU
> Subject: Re: The WHERE statement does not work for rawdata
>
> At 12:16 22/04/99 -0700, Berryhill, Timothy wrote:
>
> >John, One can only assume a programmer of your caliber has never had a
> >program neglect to write out, say, a subtotal for a BY group, after
> dropping
> >LAST. in an IF statement.
>
> Hmmm - well, quite honestly, Tim, I'm not sure exactly what 'subtotal for
> a
> BY group, I would actually expect to get if I had 'dropped LAST. in an IF
> statement' (or in a WHERE statement, come to that!) - unless I'm missing
> something, I reckon that probably counts as "potentially confusing
> programming'! Is this really the sort of thing Peter had in mind when he
> wrote of "... full and natural support for ... first. and last.
> processing" ?
>
> Regards,
>
> John
>
> ----------------------------------------------------------------
> Dr John Whittington, Voice: +44 (0) 1296 730225
> Mediscience Services Fax: +44 (0) 1296 738893
> Twyford Manor, Twyford, E-mail: medisci@powernet.com
> Buckingham MK18 4EL, UK mediscience@compuserve.com
> ----------------------------------------------------------------
>
|