2

I am new for SAS. I have an urgent requirement to report , I have just started with ODS

Data looks like :

ID      PLAN DOB(MMYYYY) SEX ZIPCODE 
1000000 A    101970      M    11111 
1000001 A    101971      F    11112 
1000002 A    101972      F    11113 
1000003 A    101973           11114


The report should look like the following tabular form :

Nbr of rec  2 
Nbr of id   2 
Female 2 ,and percentage compared to overall count 
Male 1 ,and percentage compared to overall count 
gender missing 1, percentage compared to overall count 
Age = need to calculate the age by DOB - sysdate.

Then based on the calculated age , to be loaded in a temporary variable and then need to break up by range

like

0  - 10  count - 55 
11 - 20  count - 13


I am trying with proc freq , but not sure how to report different results in different columns as tabular form Can someone give me jump start please , even someone could let me know where exactly I need to look in the help for the reporting would help too.

flag

2 Answers

1

You can use the proc tabulate which gives you the possibility to choose the statistics you want for each column. For the calculated age, you can do the same (you could use the proc format to build groups for the report but you can also do it in a Data Step).

PROC TABULATE DATA=test MISSING;
CLASS sex;
TABLE sex ALL, N PCTN;
RUN;

Kind regards, CC

link|flag
1

You can also use Proc Freq to get the Percentages, but the report will not be pretty as Proc Tabulate one...

Proc Freq data=test; TABLE sex/missing nocum; RUN;

sarath www.studysas.blogspot.com

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.