Hi all, Might be a silly question, non the less I struggle on this one, mostly due to similar coding having worked smoothly in the past. So I am formatting a register data set, and have some struggles converting a character variable into a cathegorical numeric variable. So the data in question is about local regions in Denmark and the coding is looking like the following: proc format;
value $MunicipalityRegion
"101","147","155","185","165","151","153","157","159","161",
"163","167","169","183","173","175","187","201","240","210",
"250","190","270","260","217","219","223","230","400","411"
= "Region Capital"
"253","259","350","265","269","320","376","316","326","360",
"370","306","329","330","340","336","390"
= "Region Zealand"
"420","430","440","482","410","480","450","461","479","492",
"530","561","563","607","510","621","540","550","573","575",
"630","580"
= "Region Southern Denmark"
"710","766","615","707","727","730","741","740","746","706",
"751","657","661","756","665","760","779","671","791"
= "Region Central Denmark"
"810","813","860","849","825","846","773","840","787","820",
"851"
= "Region Northern Jutland"
" "
= "Region Missing";
value $RegionCathegory
"Region Capital" = 1
"Region Zealand" = 2
"Region Southern Denmark" = 3
"Region Central Denmark" = 4
"Region Northern Jutland" = 5
"Region Missing" = 6;
run;
....
RegionText = put(Municipality , $MunicipalityRegion.);
Region = put(RegionText , $RegionCathegory.); Hence Region should be a 1-6 variable ready to use. The above has been working in the past, but now I get the following warning and error: WARNING: Municipality has already been defined as numeric
Error 48-59: the format REGIONS was not be found or could not be loaded I'm still a very entry level SAS programmer, and mostly use STATA for coding, hence I might be missing some obvious error in the above. Any suggestions to why regions could not be found or loaded? Best regards, oggylang
... View more