DATA Step, Macro, Functions and more

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

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 119
Accepted Solution

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

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 ;
       
 

Accepted Solutions
Solution
‎01-18-2018 02:55 PM
Contributor
Posts: 27

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

Posted in reply to ManitobaMoose

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


All Replies
Solution
‎01-18-2018 02:55 PM
Contributor
Posts: 27

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

Posted in reply to ManitobaMoose

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 ;

Frequent Contributor
Posts: 119

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

Posted in reply to ManitobaMoose
I got it to work. The problem was that I needed to write by Gender Schoolsize not var Gender Schoolsize.
☑ This topic is solved.

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

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