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 ;