我正在尝试创建一种 proc 格式,该格式可以读取邮政编码并将标签相应地应用于其状态。
出于某种原因,尽管我的开始和结束字段都是数字,但它一直返回一个错误,说明:
“未找到或无法加载 ZONENEW 格式。”
我想出的唯一解决方法是将我的 Pcode 数据更改为文本,并将我的开始和结束格式字段也更改为文本。
这是我现有的代码,仍然是数字格式。
data Fmt_All_zones;
set all_zones end=eof;
retain type 'c';
fmtname = 'zonenew';
start = pcode_fr;
end = pcode_to;
label = key;
output;
if eof then do;
start = 'other';
end = 'other';
label = "Error";
output;
end;
run;
proc format cntlin = fmt_all_zones library = work;
run;
data TestPostcodes;
input Pcode;
datalines;
2050
2065
3000
2879
9999
1999
6488
;
run;
data FilteredPcode;
set TestPostcodes;
Pcode_Label = put(Pcode, zonenew.);
run;
我将不胜感激解释,以帮助我对该过程的概念性理解!谢谢。