08-23-2016 07:02 PM
There is no result and no errors. There are too many variables, so I don't want to write all variables, what is the efficient way to read all variables name from CSV file.
filename tax1 '~/data/0001.csv';
proc print data=tax;
08-23-2016 07:05 PM
Hi, @pingsu. You might just take the easy way out and use the Import CSV task and then you can review the code once the file has been imported successfully! That's what I would do because I enjoy seeing how the Task chose to implement the code.
08-23-2016 08:12 PM
If you use Proc Import or a Import Task you will get the code and can then customize the code to your requirements.
If using Proc Import, I recommend setting GUESSINGROWS option high to allow SAS to scan all rows before determine a variable type. This means its more likely to read the data accurately.
I'm not sure you're specifying your filename correctly as well for SAS UE. Assuming you're using SAS UE the code below is more likely correct. Otherwise if using SAS for Academics On Demand then you may need a different filename.
proc import data='/folders/myfolders/data/0001.csv' dbms=csv replace; guessingrows=30000;run;
08-24-2016 04:20 AM
It sounds like your input datafile is innefficiently exported from the previous step if you have many variables, therefore any subsequent steps will be innefficient as well. Me, I would do my upmost to get data in the format I want - create import agreement, get signoffs etc. If file format can't be changed then explain additional costs etc. At the end of the day you have to work with it.