Date: Mon, 1 Aug 2005 18:14:49 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject: Re: PROC FREQ
If only the counts are needed (no percents or cumulatives), PROC SUMMARY
can pack everything into one output data set. For example:
proc summary data=sashelp.class;
class age sex;
ways 1;
output out=counts;
run;
Each of the CLASS variables will be a variable in the output data
set. "Stacking" them together is a problem because generally there will be
type and attribute differences.
On Mon, 1 Aug 2005 14:37:15 -0700, Jairaj Sathyanarayana
<jairajs@GMAIL.COM> wrote:
>Daniel,
>The OUT option as used on the TABLES statement will only include the
>freq for the last variable listed. You can either use multiple tables
>statements- one for each variable- to get a variable-specfic OUT
>dataset or consider using the ODS output.
>
>proc freq data=d1;
>tables var1/out=var1tab;
>tables var2/out=var2tab;
>run;
>
>OR
>
>proc freq data=d1;
>tables var1 var2;
>ods output table1.onewayfreqs=var1tab
> table2.onewayfreqs=var2tab;
>run;
>
>Use the ODS generated datasets to do whatever processing you need to.
>
>Hope this helps.
>
>Jairaj
>
>
>On 8/1/05, Daniel Boisvert <djboisvert@hotmail.com> wrote:
>> Dear SASers,
>>
>> I'm trying to do something simple.
>>
>> I need to do frequencies on a lot of variables and have the output in a
>> dataset.
>>
>> ie.
>>
>> PROC FREQ DATA=dummy;
>> TABLES var1 var2 var3 var4 ... /OUT=freqs;
>> RUN;
>>
>> When I do this, I only get the values from the last variable in the
output
>> dataset. How do I get them all in the same dataset without doing
multiple
>> proc freqs???
>>
>> Thanks,
>> Dan
>>
|