选择格式文本格式创建sas文件 txt
国泰安数据库下载完会附带一个导入sas的代码 叫TRD_Dalyr[SAS]
但是用这个完全倒不进去小数点,而且我这个版本的中文label也不行
所以自己改了一下
DATA csmar.a1;(注释:这里可以改名字;把括号里的内容都删了)
Infile 'D:\csmar\1\TRD_Dalyr.txt'(注释:这里改路径) encoding="utf-8" delimiter = '09'x Missover Dsd lrecl=32767 firstobs=2;
Format Stkcd $6.;
Format Trddt $10.;
Format Opnprc 9.3;
Format Hiprc 9.3;
Format Loprc 9.3;
Format Clsprc 9.3;
Format Dnshrtrd 12.;
Format Dnvaltrd 16.3;
Format Dsmvosd 16.2;
Format Dsmvtll 16.2;
Format Dretwd 10.6;
Format Dretnd 10.6;
Format Adjprcwd 14.6;
Format Adjprcnd 14.6;
Format Markettype 10.;
Format Capchgdt $10.;
Format Trdsta 10.;
Informat Stkcd $6.;
Informat Trddt $10.;
Informat Opnprc 9.3;
Informat Hiprc 9.3;
Informat Loprc 9.3;
Informat Clsprc 9.3;
Informat Dnshrtrd 12.;
Informat Dnvaltrd 16.3;
Informat Dsmvosd 16.2;
Informat Dsmvtll 16.2;
Informat Dretwd 10.6;
Informat Dretnd 10.6;
Informat Adjprcwd 14.6;
Informat Adjprcnd 14.6;
Informat Markettype 10.;
Informat Capchgdt $10.;
Informat Trdsta 10.;
Label Stkcd="Trading code";
Label Trddt="Trading date";
Label Opnprc="open price";
Label Hiprc="highest price";
Label Loprc="lowest price";
Label Clsprc="closing price";
Label Dnshrtrd="dayly trading shares";
Label Dnvaltrd="dayly trading value";
Label Dsmvosd="dayly trading market value";
Label Dsmvtll="dayly total market value";
Label Dretwd="dayly return with dividend";
Label Dretnd="dayly return without dividend";
Label Adjprcwd="comparing clsprice with dividend";
Label Adjprcnd="comparing clsprice without dividend";
Label Capchgdt="capital changing date";
Label Trdsta="trading status";
Input Stkcd $ Trddt $ Opnprc Hiprc Loprc Clsprc Dnshrtrd Dnvaltrd Dsmvosd Dsmvtll Dretwd Dretnd Adjprcwd Adjprcnd Markettype Capchgdt $ Trdsta ;
Run;