E********9 发帖数: 7 | 1 请教大家一个问题:
I'd like to import several .csv file to SAS, but how come I can't use
statement like
MIXED=YES;
USEDATE=YES;
SCANTIME=YES;
in the proc import procedure?
Here is my code:
proc import datafile="---.csv" out=sasuser.trial dbms=csv replace;
delimiter=",";
getnames=yes;
MIXED=YES;
USEDATE=YES;
SCANTIME=YES;
run;
I'm working on UNIX, so didn't try converting csv files to excel before
importing them. Without the statements mentioned above, I have a lot of
error mes |
S******t 发帖数: 1437 | 2 Can u give a few examples in detail?
In my opinion, proc import is the most convenient way to import csv files
into SAS. But if it doesn't work, you may try data step, that way you can
define each variable to be numerical or character. |
E********9 发帖数: 7 | 3 Thank you for your reply.
Below is the log I got:
proc import datafile="---.csv" out=sasuser.trial dbms=csv replace;
NOTE: The previous statement has been deleted.
NOTE: The previous statement has been deleted.
3 delimiter=",";
4 getnames=yes;
5 MIXED=YES;
-----
180
6 USEDATE=YES;
-------
180
7 SCANTIME=YES;
--------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
8 run;
I |
s*r 发帖数: 2757 | |
E********9 发帖数: 7 | 5 恕我愚钝, where is that extra ; ? |
S***e 发帖数: 108 | 6 MIXED=yes|no,USEDATE=yes|no,SCANTIME=yes|no are options for reading excel
files, not for csv files.
If you want to use those options in SAS, you'd better convert your csv file
to excel file first. |
E********9 发帖数: 7 | 7 That's what I'm wondering.
I'm working on unix so I can't import data in excel files.
Any idea on how to read data stored in csv files like dates in SAS? |
y******0 发帖数: 401 | 8 using Data xx; infile ..; |