全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
5505 3
2017-03-20
选择格式文本格式创建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;

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-3-20 21:03:03
里面有些地方转行没显示出来 分号转行哈
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-3-22 14:42:36
您好,我想请教一下,我在国泰安下载个股数据,有20多个txt文件,怎么导入到同一个数据文件里并实现排序呢?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2019-11-6 11:05:19
现在需要把utf-8那里改成utf-16le了
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群