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

 

 

I don't undersand why I am getting this message. Maybe someone can see what I do not. The log is here.

 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 61         
 62         Libname Review'/folders/myfolders/Review' ;
 NOTE: Libref REVIEW was successfully assigned as follows: 
       Engine:        V9 
       Physical Name: /folders/myfolders/Review
 63         Libname Learn'/folders/myfolders/Learn' ;
 NOTE: Libref LEARN refers to the same physical library as LEARN2.
 NOTE: Libref LEARN was successfully assigned as follows: 
       Engine:        V9 
       Physical Name: /folders/myfolders/Learn
 64         Libname myformat'/folders/myfolders/sasuser.v94' ;
 NOTE: Libref MYFORMAT refers to the same physical library as SASUSER.
 NOTE: Libref MYFORMAT was successfully assigned as follows: 
       Engine:        V9 
       Physical Name: /folders/myfolders/sasuser.v94
 65         Options fmtsearch=(myformat) ;
 66         
 67         Proc tabulate data=learn.college noseps ;
 68         class ClassRank ;
 69         Var GPA ;
 70         Tables (Schoolsize All),
 71            ((GPA Classrank)*(Median Min Max)*f=5.1) ;
 72         Label SchoolSize = 'School Size'
 73               ClassRank = 'Class Rank' ;
 74         Keylabel N = ' '
 75                  Min = 'Minimum'
 76                  Max = 'Maximum'
 77                  All = 'Total' ;
 78         run ;
 
 ERROR: The type of name (Schoolsize) is unknown.
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE TABULATE used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 78       !      
 79         
 80         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 93         

Below is the code

 

Libname Review'/folders/myfolders/Review' ;
Libname Learn'/folders/myfolders/Learn' ;  
Libname myformat'/folders/myfolders/sasuser.v94' ; 
Options fmtsearch=(myformat) ;

Proc tabulate data=learn.college noseps ; 
	class ClassRank ; 
	Var GPA ; 
	Tables (Schoolsize All),
		   ((GPA Classrank)*(Median Min Max)*f=5.1) ; 
	Label SchoolSize = 'School Size' 
	      ClassRank = 'Class Rank' ; 
	Keylabel N = ' ' 
	         Min = 'Minimum'
	         Max = 'Maximum'
	         All = 'Total' ;
run ;	 

Below is the code for the data set learn.college.

 

data learn.college;
   length StudentID $ 5 Gender SchoolSize $ 1;
   do i = 1 to 100;
      StudentID = put(round(ranuni(123456)*10000),z5.);
      if ranuni(0) lt .4 then Gender = 'M';
      else Gender = 'F';
      if ranuni(0) lt .3 then SchoolSize = 'S';
      else if ranuni(0) lt .7 then SchoolSize = 'M';
      else SchoolSize = 'L';
      if ranuni(0) lt .2 then Scholarship = 'Y';
      else Scholarship = 'N';
      GPA = round(rannor(0)*.5 + 3.5,.01);
      if GPA gt 4 then GPA = 4;
      ClassRank = int(ranuni(0)*60 + 41);  /* the + 41 is there because of missing data (my note) */
      if ranuni(0) lt .1 then call missing(ClassRank);
      if ranuni(0) lt .05 then call missing(SchoolSize);
      if ranuni(0) lt .05 then call missing(GPA);
      output;
   end;
   format Gender $gender1. 
          SchoolSize $size. 
          Scholarship $yesno.;
   drop i;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Proc tabulate needs to know how a particular variable is to be used. CLASS variables are for grouping, and by default will exclude records if the value for the class variable is missing. You can requested only count related statistics directly for Class variables such as N, PctN, RowPctN, ColPctN, RepPctN, PagePctN. VAR variables can have any of the available statistics requested but do not create groups or subgroups of results.

View solution in original post

2 REPLIES 2
ballardw
Super User

Proc tabulate needs to know how a particular variable is to be used. CLASS variables are for grouping, and by default will exclude records if the value for the class variable is missing. You can requested only count related statistics directly for Class variables such as N, PctN, RowPctN, ColPctN, RepPctN, PagePctN. VAR variables can have any of the available statistics requested but do not create groups or subgroups of results.

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
  • 10957 views
  • 0 likes
  • 3 in conversation