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.
Hi,
Proc sql will generate the desired output:
proc sql;
select ID, A1,count(*) as count from have
group by ID,A1;
quit;
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.
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.