Please clarify why type 3 returns a dataset that has values for all three of my sum columns. I found that when I use the below syntax and then only select where type = 3 that I receive values for all three columns. What I am concerned about is that I could end up with a situation where I dynamically feed in three columns and there is no type 3 or type 3 is type 4. Is type three always all three columns combined?
proc summary data= enrollment;
var enrolled applications admissions;
class FOUR_DIGIT_YEAR ACADEMIC_PERIOD_DESC;
output out = yieldRateSummaryTable sum = enrolled applications admissions;
where FOUR_DIGIT_YEAR ne '';
run;
data yieldRateSummaryTable; set yieldRateSummaryTable;
where _type_ = 3;
run;
ods | FOUR_DIGIT_YEAR | ACADEMIC_PERIOD_DESC | _TYPE_ | _FREQ_ | enrolled | applications | admissions |
1 | 0 | 159091 | 36418 | 672264 | 193728 | ||
2 | Fall 2010 | 1 | 30417 | 7230 | 126765 | 36984 | |
3 | Fall 2011 | 1 | 31211 | 7606 | 129024 | 37648 | |
4 | Fall 2012 | 1 | 32371 | 7234 | 141750 | 37952 | |
5 | Fall 2013 | 1 | 32376 | 7176 | 138591 | 39440 | |
6 | Fall 2014 | 1 | 32716 | 7172 | 136134 | 41704 | |
7 | 2010 | 2 | 30417 | 7230 | 126765 | 36984 | |
8 | 2011 | 2 | 31211 | 7606 | 129024 | 37648 | |
9 | 2012 | 2 | 32371 | 7234 | 141750 | 37952 | |
10 | 2013 | 2 | 32376 | 7176 | 138591 | 39440 | |
11 | 2014 | 2 | 32716 | 7172 | 136134 | 41704 | |
12 | 2010 | Fall 2010 | 3 | 30417 | 7230 | 126765 | 36984 |
13 | 2011 | Fall 2011 | 3 | 31211 | 7606 | 129024 | 37648 |
14 | 2012 | Fall 2012 | 3 | 32371 | 7234 | 141750 | 37952 |
15 | 2013 | Fall 2013 | 3 | 32376 | 7176 | 138591 | 39440 |
16 | 2014 | Fall 2014 | 3 | 32716 | 7172 | 136134 | 41704 |
http://www2.sas.com/proceedings/sugi27/p077-27.pdf
Type is based off of the class variables. The above documentation spells it out.
David,
Check this Help Doc related to the Proc Means which is very similar to Proc Summary.
Go to the "Output Data Set" section, and in there you should find an explanation on how the _type_ value is calculated.
Hope this helps,
Ahmed
http://www2.sas.com/proceedings/sugi27/p077-27.pdf
Type is based off of the class variables. The above documentation spells it out.
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.
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.