Date: Wed, 6 Jun 2007 19:51:59 +0000 toby dunn "SAS(r) Discussion" toby dunn Re: PROC FREQ--DATA STEP--MODELING QUESTION To: tw2@MAIL.COM <20070606193438.2C04E1BF281@ws1-1.us4.outblaze.com> text/plain; format=flowed

Tom ,

You seem to think that the problem lies with Proc Freq rather than the fact that what you asked Proc Freq to do is outside the realm of possibilities of your current hardware limits.

You want Proc Freq to do this then you have one of two solutions:

1) Jack with your system setting to eek out more efficicncy. 2) If number 1 doesnt work then buy more freakin memory.

Now if neither one of those is an option, then perhaps you should look at these other solutions of either breaking down the combinations Proc Freq has to deal with at any given time or switch procedures.

Toby Dunn

If anything simply cannot go wrong, it will anyway. Murphys Law #2.

The buddy system is essential to your survival; it gives the enemy somebody else to shoot at. Murphys Law #

Tell a man there are 300 billion stars in the universe and he'll believe you. Tell him a bench has wet paint on it and he'll have to touch to be sure. Murphys Law #9

From: Tom White <tw2@MAIL.COM> Reply-To: Tom White <tw2@MAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: PROC FREQ--DATA STEP--MODELING QUESTION Date: Wed, 6 Jun 2007 14:34:38 -0500

Hi Muthia,

I know Matthew's solution seems the simplest.

But no one has yet responded:

How can I get this PROC FREQ

proc FREQ data = foo; tables ID * CODE/ noprint outpct out=TEST1; run;

to run on my real data set of 10 million records?

The above code and Matthew's code do different things because his code counts ONLY inside the ID group, whereas mine does the cross tabulation ID * CODE.

Both PROC FRECs (Matthew's and mine) are important for my problem. Except that mine does not run.

The only way I suspect for my PROC FREQ to run is to convert it into a data step. But how?

Thank you.

tom

----- Original Message ----- From: "Muthia Kachirayan" To: SAS-L@LISTSERV.UGA.EDU Subject: Re: PROC FREQ--DATA STEP--MODELING QUESTION Date: Wed, 6 Jun 2007 15:13:30 -0400

Tom,

Use of array might be little difficult for you. The solution given by Matthew is far simpler. In the new output using the code

proc sort data=foo; by ID; run; proc freq data=foo; tables CODE/ noprint out=TEST2; by ID; run;

your PCT_Row is the PERCENT in the output. To get your Percent, you need to add COUNT for all IDs having non-blank CODE. Let it be K. Then divide each COUNT by K and multiply by 100. Your PCT_Col is 100 always.

Regards,

Muthia Kachirayan