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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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