BookmarkSubscribeRSS Feed
PICKME
Calcite | Level 5

 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
3 REPLIES 3
stat_sas
Ammonite | Level 13

Hi,

 

Proc sql will generate the desired output:

 

proc sql;

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

group by ID,A1;

quit;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

ballardw
Super User

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 871 views
  • 0 likes
  • 4 in conversation