如下需求,请教各位大侠如何实现!
需求:
外部csv格式的文件,实例格式如下:
---------------------------csv文件------------------------------------------
Time,Price,Volume,Amount,SP1,SP2,SP3,SP4,SP5,SV1,SV2,SV3,SV4,SV5,BP1,BP2,BP3,BP4,BP5,BV1,BV2,BV3,BV4,BV5,isBuy
2009-01-05 9:15:18,1.386,0,0,1.386,0,0,0,0,4245,0,0,0,0,1.386,0,0,0,0,4245,447,0,0,0,1
2009-01-05 9:15:46,1.386,0,0,1.386,0,0,0,0,4245,0,0,0,0,1.386,0,0,0,0,4245,477,0,0,0,1
2009-01-05 9:15:55,1.386,0,0,1.386,0,0,0,0,4405,0,0,0,0,1.386,0,0,0,0,4405,657,0,0,0,1
2009-01-05 9:16:3,1.386,0,0,1.386,0,0,0,0,4920,0,0,0,0,1.386,0,0,0,0,4920,982,0,0,0,1
2009-01-05 9:16:16,1.386,0,0,1.386,0,0,0,0,5317,0,0,0,0,1.386,0,0,0,0,5317,738,0,0,0,1
-------------------------------------------------------------------------------
现在想生成如下的SAS数据集,
---------------------------sas数据集------------------------------------------
Date Time Price Volume Amount,
2009-01-05 9:15:18 1.386 0 0
2009-01-05 9:15:46 1.386 0 0
2009-01-05 9:15:55 1.386 0 0
2009-01-05 9:16:3 1.386 0 0
2009-01-05 9:16:16 1.386 0 0
即只选用原来的time,price,Volume,Amount四项,且把原来的time拆分成date和time两项,date为日期格式,time为时间格式,其他几项为数值型变量。
谢谢各位了 |