概述
data MainTable; /* main table */
input ID City_Code District_code Admin_code;
datalines;
1001 100 101 10020
1002 200 102 20031
1003 300 103 30022
1005 500 104 50010
; run;
data Admin; /* lookup table for admin name */
input Admin_code AdminName $15.;
datalines;
10020 AdminName1
20031 AdminName2
30022 AdminName3
40031 AdminName4
50010 AdminName5
; run;
Data City; /* lookup table for city */
input City_code CityName $15.;
datalines;
100 CityName1
200 CityName2
300 CityName3
400 CityName4
500 CityName5
; run;
/* Create a format table for admin */
data Admin_fmt (rename=(admin_code=Start AdminName=label));
set Admin;
retain fmtname 'Admin' type 'n';
run;
/* create a format table for city */
Data city_fmt (rename=(city_code=start cityName=label));
set City;
retain fmtname 'City' type 'n';
run;
/* create the formats for City and Admin */
proc format lib = work Cntlin = admin_fmt; run;
proc format lib = work cntlin = city_fmt; run;
/* display the results */
proc sql;
select ID, City_code as City format=city., admin_code as Admin format=admin.
from maintable;
quit;
data MainTable_with_name (rename=(City_code = City Admin_code = Admin));
set MainTable;
format city_code city.;
format admin_code admin.;
run;
最后
以上就是专注保温杯为你收集整理的matlab数据字典怎么用,求教,如何使用数据字典功能的全部内容,希望文章能够帮你解决matlab数据字典怎么用,求教,如何使用数据字典功能所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复