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

Hi,

 

I am trying to run a program and I am getting this error message in the log:

ERROR: Variable Gender in list does not match type prescribed for this list.
ERROR: Variable SchoolSize in list does not match type prescribed for this list.

 

Does anyone know what this means and perhaps what to do to fix it?

Thanks...

 

Below is the entire log:

----------------------------------------------------

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 /* Chapter 16
63 Problem 16.1*/
64
65 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
66 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
67 Proc format library=Myformat ;
68
69
69 ! value $yesno 'Y', '1' = 'Yes'
70 'N', '0' = 'No'
71 ' ' = 'Not Given' ;
NOTE: Format $YESNO is already on the library MYFORMAT.FORMATS.
NOTE: Format $YESNO has been written to MYFORMAT.FORMATS.
72
72 ! value $size 'S' = 'Small'
73 'L' = 'Large'
74 ' ' = 'Missing' ;
NOTE: Format $SIZE is already on the library MYFORMAT.FORMATS.
NOTE: Format $SIZE has been written to MYFORMAT.FORMATS.
75
75 ! value $gender 'F' = 'Female'
76 'M' = 'Male'
77 ' ' = 'Not Given' ;
NOTE: Format $GENDER is already on the library MYFORMAT.FORMATS.
NOTE: Format $GENDER has been written to MYFORMAT.FORMATS.
78 run ;
 
NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
78 !
 
79
80 Proc sort data=learn.college ;
81 by Gender SchoolSize ;
82 run ;
 
NOTE: There were 100 observations read from the data set LEARN.COLLEGE.
NOTE: The data set LEARN.COLLEGE has 100 observations and 6 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.00 seconds
cpu time 0.02 seconds
 
 
83
84 Proc means data=learn.college n nmiss mean median min max maxdec=2 ;
85 var Gender SchoolSize ;
ERROR: Variable Gender in list does not match type prescribed for this list.
ERROR: Variable SchoolSize in list does not match type prescribed for this list.
86 run ;
 
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE MEANS used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
87
88
89 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
102
---------------------------------------
 
Below is the code:
/* Chapter 16
Problem 16.1*/

Libname Learn '/folders/myfolders/Learn' ;
Libname Myformat '/folders/myfolders/sasuser.v94' ;
Proc format library=Myformat ;

        value $yesno     'Y', '1' = 'Yes'
                         'N', '0' = 'No'
                         ' '      = 'Not Given' ;
        value $size      'S'      = 'Small'
                         'L'      = 'Large'
                         ' '      = 'Missing' ;
        value $gender    'F'      = 'Female'
                         'M'      = 'Male'
                         ' '      = 'Not Given' ;
run ;         

Proc sort data=learn.college ;
    by Gender SchoolSize ;
run  ;

Proc means data=learn.college  n nmiss mean median min max maxdec=2 ;
    var Gender SchoolSize ;     
run ;
       
 
1 ACCEPTED SOLUTION

Accepted Solutions
utrocketeng
Quartz | Level 8

i suspect you want the Gender as a BY variable

 

Proc means data=learn.college  n nmiss mean median min max maxdec=2 ;
    var SchoolSize ;     

   by Gender ;
run ;

View solution in original post

2 REPLIES 2
utrocketeng
Quartz | Level 8

i suspect you want the Gender as a BY variable

 

Proc means data=learn.college  n nmiss mean median min max maxdec=2 ;
    var SchoolSize ;     

   by Gender ;
run ;

ManitobaMoose
Quartz | Level 8
I got it to work. The problem was that I needed to write by Gender Schoolsize not var Gender Schoolsize.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2824 views
  • 0 likes
  • 2 in conversation