输入数据集名应为:Trdindex。
PROC IMPORT OUT= WORK.Trdindex
DATAFILE= "C:\Documents and Settings\MyComputer\桌面\tradeindex.txt"
DBMS=TAB REPLACE;
GETNAMES=YES;
DATAROW=2;
RUN;
data test;
set trdindex;
if substr(Retindex,1,1)='-' then Retindex1=input(substr(Retindex,1,8),12.);
else Retindex1=input(substr(Retindex,1,7),12.);
format Retindex1 best12.;
run;