LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2001, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 25 Jul 2001 12:18:58 -0400
Reply-To:     Quentin McMullen <QuentinMcMullen@WESTAT.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Quentin McMullen <QuentinMcMullen@WESTAT.COM>
Subject:      Re: Not Proc Summary: Proc Append
Content-Type: text/plain; charset="iso-8859-1"

Mark,

Have you been able to replicate the problem with proc append? Is it possible that you ran your code twice? If the base data set doesn't exist when proc append is run, it is created (with note to the log). After that, it just keeps on appending. So if you ran it twice, you would end up with 8 records.

For this reason, when I am expecting my first append to create a new base file, I often preface it with a step to check for existence of the base file, something like:

%if %sysfunc(exist(srvcva)) %then %do; proc datasets library=work; delete srvcva; quit; %end;

proc append...

--Q.

-----Original Message----- From: mark.k.moran@CENSUS.GOV [mailto:mark.k.moran@CENSUS.GOV] Sent: Wednesday, July 25, 2001 11:19 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Not Proc Summary: Proc Append

> have you taken your issue up with SAS tech support?

> i'll be happy to be the go between. how big is the dataset for which proc summary shows > these incorrect averages - if i can get a copy of the dataset and the sas program, i can > have the developers here in R&D investigate this more thoroughly

> Paul Kent > Director, BASE SAS Research > http://www.sas.com/rnd/base -- The Power to Know

There's news: My real problem is and was not questioning, fixing, or taking up issues on the Proc Summary. My problem was *not getting fired*, because a week ago I was told to take the averages from the COUNT cells of four more or less identical files. The first way I tried had syntax problems, so I posted the question to SAS-L. A couple people suggested Proc Appends followed by a Proc Summary. I just wanted the average values for the COUNT cells of these four files, what could be simpler? It turns out, I have just now figured out today, that the problem is *not* in the Proc Survey or Proc Means but in these *Proc Append*. These Proc Append's are literally taking my four little old files and giving me back eight rows where there should only be four, one from each file. So I take back what I said about Proc Survey -- I apologize for calling Proc Survey into disrepute -- and, based on the suggestions of people on SAS-L to use proc append, which I have done exactly as recommended, apply the comment to Proc Append. I will avoid Proc Append like the plague, because I fixed this problem by simply going back to the more familiar Datastep with set file1of4 file2of4 etc., instead of Proc Append!

proc append data=file1of4 base=srvcva; run; proc append data=file2of4 base=srvcva; run; proc append data=file3of4 base=srvcva; run; proc append data=file4of4 base=srvcva; run;

proc sort data=srvcva; by super k; run;

proc means data=srvcva; var count; by super k; output out=srvcva2 mean=; run;


Back to: Top of message | Previous page | Main SAS-L page