另外,目前我想了一个比较弱智的方法,就是用用datasets过程,将数据集中所有的标签先显示出来,然后手动黏贴到excel,跟变量名对应起来。下面是我使用的命令和结果:
proc datasets library=tmp1;
contents data=m07cropt;
run;
结果:
The SAS System 18:45 Thursday, June 10, 1
The DATASETS Procedure
Data Set Name TMP1.M07CROPT Observations 21542
Member Type DATA Variables 21
Engine V9 Indexes 0
Created Monday, January 28, 08:46:29 AM Observation Length 160
Last Modified Monday, January 28, 08:46:29 AM Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted YES
Label
Data Representation WINDOWS_32
Encoding wlatin1 Western (Windows)
Engine/Host Dependent Information
Data Set Page Size 16384
Number of Data Set Pages 212
First Data Page 1
Max Obs per Page 102
Obs in First Data Page 79
Number of Data Set Repairs 0
File Name D:\stata\data\Agriculture_July\m07cropt.sas7bdat
Release Created 9.0101M3
Host Created XP_PRO
Alphabetic List of Variables and Attributes
# Variable Type Len Label
16 COMMID Num 8 COMMUNITY ID
1 E11 Num 8 CROP TYPE NUMBER
2 E13 Num 8 # OF KG OF CROP GROWN LAST YEAR
3 E14 Num 8 # OF KG OF CROP SOLD TO GOVT LAST YEAR
4 E15 Num 8 GOVT PRICE (YUAN/KG) FOR CROP LAST YR
5 E16 Num 8 # OF KG OF CROP SOLD TO FREE MKT LST YR
6 E17 Num 8 FREE MKT PRICE (YUAN/KG) FOR CROP LST YR
8 E13B Num 6 12-MO: AMT SPENT ON RAISING THIS CROP
9 E14B Num 6 12-MO: PRODUCE FROM HH FARM CROP SOLD?
10 E15B Num 6 12-MO: AMT RECD--SALE OF HH FARM CROP
11 E16B Num 6 12-MO: PRODUCE FROM HH FARM CROP KEPT?
12 E17B Num 6 12-MO: AMT RECD IF KEPT-FARM-CROP SOLD
13 E18B Num 6 12-MO: PRODUCE FROM HH FARM CROP GIVEN?
14 E19B Num 6 12-MO: AMT RECD IF GIVEN-FARM-CROP SOLD
15 HHID Num 8 MOST CURRENT HOUSEHOLD ID ON C05MAST
17 T1 Num 8 PROVINCE
18 T2 Num 8 1=URBAN SITE(U) 2=RURAL SITE(R)
19 T3 Num 8 U:1-2=CITY NUM/R:1-4=COUNTY NUM
20 T4 Num 8 U:12569=URB 3478=SUB/R:15=TWN 2-4,6-8=VIL
21 T5 Num 8 HOUSEHOLD NUMBER
7 WAVE Num 8 Survey Year
Sort Information
Sortedby HHID E11 WAVE
Validated YES
Character Set ANSI
不过这么手动处理比较土,而且变量名是安字母书序显示的,跟导出到到excel中变量出现的数据不一样,要一样的话还可以直接把那一列标签名转置一下跟变量名对应。
这方法比较土,还请高手指点!