05-10-2017 12:23 AM
I am infant to SAS and this is my first post on SAS ,
Uploaded CSV file to one of my folder and also able to read the data from csv file .,But I would like to get all the columns of CSV file .Can any one help me how can I do it
data tableau; infile '/folders/myfolders/DataFiles/SuperstoreSales.csv' delimiter=',' firstobs=2 ; input RowID OrderID Order Date$ Profit$; run; proc print data=tableau; run;
05-10-2017 12:44 AM
How many columns do you have in the csv file?
According to your INPUT statement you get at most 5 colums.
If there are more - assign names and informats to the other columns too.
05-10-2017 04:57 AM
Do bear in mind that with the simplicity of proc import, you do lose the fine grained control you had with the datastep. For simple tasks proc import may work, but under the hood what it is doing is scanning the file and guessing what the best way to read data in. It may/may not get this right (causing you further work), and it may not do the same thing if the data changes in any way. Once you move from simple tasks I would really advise that you put a bit more effort into the import, write the datastep yourself (you can take the output from proc import which will be in the log and modify that to your needs), this way you know exactly how the data will import each time.
Need further help from the community? Please ask a new question.