Date: Wed, 13 Jul 2005 08:39:48 -0700
Reply-To: Jairaj Sathyanarayana <firstname.lastname@example.org>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jairaj Sathyanarayana <jairajs@GMAIL.COM>
Subject: Re: Create an Excel Table in SAS
Content-Type: text/plain; charset=ISO-8859-1
When you use the out= option in proc freq with more than one table
request, the dataset output will correspond ONLY to the last table
request in the tables statement. For what you are trying to do, you
should consider using the ODS datasets from the proc freq.
proc freq data=in;
tables prepcode*(old young)/out=age;
ods output crosstabfreqs=xtf1 crosstabfreqs2=xtf2;
The datasets xtf1 & xtf2 will have the data you'll want to export
(after dropping anything you don't need).
Hope this helps.
On 7/13/05, Xu Libin <Libin.Xu@irs.gov> wrote:
> Dear Listers,
> I notice the following syntax create an Excel file with only the
> frequency distribution of the last variable. In this case, only young is
> proc freq data=in;
> tables prepcode*(old young)/out=age;
> proc export outfile="i:\age.csv" dbms=csv data=age replace;
> Do I have to run separate freq on each var and generate one file for each
> var? Thanks you in advance for your advice.