DATA Step, Macro, Functions and more

proc freq

Reply
Occasional Contributor
Posts: 6

proc freq

[ Edited ]

 I want to print the second output.

I've already tried this proc step.

 

proc freq;
table ID*A1;
run;

 

but data is too big so that proc step didn't work.

I wanna know there are other options. plz let me know.


a.PNG
Trusted Advisor
Posts: 1,228

Re: proc freq

Hi,

 

Proc sql will generate the desired output:

 

proc sql;

select ID, A1,count(*) as count from have

group by ID,A1;

quit;

Super User
Super User
Posts: 7,942

Re: proc freq

Some tips on posting questions - post example test data in the form of a datastep, post example output, explain your problem, what data is it that is so big that you cannot run a procedure over it, proc sql will not be much faster if at all on that data.  What system are you running, where is the data coming from, if its a database then extract the data locally then run procedures over it to avoid latency over the network, if the data is on a server check there are no bottlenecks etc.

Super User
Posts: 11,343

Re: proc freq

If you only want counts then it helps to suppress the percents

 

proc freq;

    table ID*A1 /norow nocol nocum nopercent;

 run;

 

That will also reduce the number of rows.

 

Please describe exactly how "proc step didn't work". Did it generate an error? The post the Error. Did it generate no output at all? Post the log, that normally occurs when the input data set has no records and the log will tell. Was the output unexpected? Describe exactly how the output was not as expected.

 

The most likely problem I would see with "too big" data and Proc freq is overflowing the results window.

If that is the case then use this to create a dataset of the output.

proc freq noprint;

    table ID*A1 /norow nocol nocum nopercent out=temp;

 run;

Then you can either view the data set or use an ODS destination to send proc print output of the results to document.

Ask a Question
Discussion stats
  • 3 replies
  • 293 views
  • 0 likes
  • 4 in conversation