BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavidPhillips2
Rhodochrosite | Level 12

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
1 ACCEPTED SOLUTION

Accepted Solutions
DavidPhillips2
Rhodochrosite | Level 12

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

2 REPLIES 2
AhmedAl_Attar
Rhodochrosite | Level 12

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

DavidPhillips2
Rhodochrosite | Level 12

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

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

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
  • 1551 views
  • 3 likes
  • 2 in conversation