Proc format;
* create value labels for schtyp;
value scl 1='public'
2='private';
*create value labels for grade;
value adcdf 0 = 'F'
1 = 'D'
2 = 'C'
3 = 'B'
4 = 'A';
*create value labels for female;
value fm 1 = 'female'
0 = 'male';
Run;
*create data file hs1 label it;
data hs1(label='high school and beyond');
*read in the sas file f:\sas_data\hs0;
set 'f:\sas_data\hs0';
*label the variable schtyp;
label schtyp='type of school';
* apply value labels to schtyp;
format schtyp scl.;
*the if-then statements create a new variable, called prog, which is
numeric variable;
if prgtype = 'academic' then prog = 1;
if prgtype = 'general' then prog = 2;
if prgtype = 'vocational' then prog = 3;
*create a new variable, called female,which is idential to the variable gender;
*and then use drop statement to remove the variable gender from the dataset;
female = gender;
drop gender;
*label the variable prog;
label prog = 'type of program';
*label the variable female;
label female = "student's gender";
*apply value labels to female;
format female fm.;
*the if statement recodes values of 5 in the variable race to be missing (.);
if race = 5 then race= .;
*create a variable called total that is the sum of read, write, math, and science ;
total = read + write + math + science;
*create a variable statements recode the variable total into the variable grade;
if (total < 80) then grade = 0;
if (80 <= total < 110) then grade= 1;
if (110 <= total < 140) then grade= 2;
if (140 <= total < 170) then grade= 3;
if (total >= 170) then grade= 4;
if (total= .) then grade= .;
*label the variable grade;
label grade ='combined grades of read write math and science';
*apply value labels to variable grade';
format grade abcdf.;
Run;
log里面报错!
110 format grade abcdf.;
------
48
ERROR 48-59: The format ABCDF was not found or could not be loaded.
为什么会这样啊,高手求助啊!