Your SAS programs, embedded in web apps and elsewhere

Proc Summary Type

Accepted Solution Solved
Reply
Super Contributor
Posts: 480
Accepted Solution

Proc Summary Type

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;

odsFOUR_DIGIT_YEARACADEMIC_PERIOD_DESC_TYPE__FREQ_enrolledapplicationsadmissions
1 015909136418672264193728
2 Fall 2010130417723012676536984
3 Fall 2011131211760612902437648
4 Fall 2012132371723414175037952
5 Fall 2013132376717613859139440
6 Fall 2014132716717213613441704
72010 230417723012676536984
82011 231211760612902437648
92012 232371723414175037952
102013 232376717613859139440
112014 232716717213613441704
122010Fall 2010330417723012676536984
132011Fall 2011331211760612902437648
142012Fall 2012332371723414175037952
152013Fall 2013332376717613859139440
162014Fall 2014332716717213613441704

Accepted Solutions
Solution
‎08-17-2015 09:42 AM
Super Contributor
Posts: 480

Re: Proc Summary Type

http://www2.sas.com/proceedings/sugi27/p077-27.pdf

Type is based off of the class variables.  The above documentation spells it out.

View solution in original post


All Replies
Regular Contributor
Posts: 213

Re: Proc Summary Type

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

Solution
‎08-17-2015 09:42 AM
Super Contributor
Posts: 480

Re: Proc Summary Type

http://www2.sas.com/proceedings/sugi27/p077-27.pdf

Type is based off of the class variables.  The above documentation spells it out.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 464 views
  • 3 likes
  • 2 in conversation