BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi Folks,

I have been going through help file section after help file section to find what I think should be something obvious/easy to do but cannot find what I am looking for.

Here is what I am trying to do:

a frequency distribution of variable_x in/of sas_table_y.

IN spss I could do this by opening the file, finding the field name I want and choosing from the menu Analysis,Frequencies{x},OK ...or... writing syntax like:

Frequencies x.
execute.

In SPSS I can lookup in the help and find the command and all of it's parameters.

I was trying to do this today in SAS and I first looked under report. When I try to 'build a report' in SAS, I select the dataset and then it automatically gives me all of the fields(and doesn't let me drop any) (I only have 7 fields, so it's like looking at the raw table.

I tried looking in the sas help under proc freq, but it just tells me to give it a table name - I just want to see a frequency dist of one field not all. Where can I find a simple readable doc that lists all of the parameters for proc freq?


Sergio the dimwit
2 REPLIES 2
deleted_user
Not applicable
Hi Sergio,

The SAS help has all the resources you need, but sometimes I find it easier to navigate on a more text-link-based page, as opposed to the Java-dependent SAS OnlineDoc.

Check out this resource: http://www.csc.fi/cschelp/sovellukset/stat/sas/sasdoc/sashtml/main.htm and click on "SAS Procedures Guide" under Base SAS. If all you're looking for is a simple frequency, I'd still suggest Proc Freq, as you had previously attempted.

proc freq data = table_y;
tables x;
run;

"Tables" in proc freq works kind of like "Var" in proc print, if that makes it easier to grasp. If you had to do a two-way frequency between x and z, the line would read "tables x*z", for instance.

You can click through the various links within to see the options of proc freq/tables/output/etc so you have a better idea of how to tweak your code. The examples (once again, taken directly from the SAS OnlineDoc) are very good and helped me figure my way through many programming projects when I was a student.

Elayne
deleted_user
Not applicable
If you have it, I would also encourage you to check out Analyst. Look on the menu bar under Solutions, Analysis.

What I like about this is that it will create the code for you which you can then modify to fit your needs.

Nice little prototyping tool. You can learn more about in the online manual as well.

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
  • 2 replies
  • 707 views
  • 0 likes
  • 1 in conversation