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

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.

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
  • 2184 views
  • 0 likes
  • 2 in conversation