09-10-2016 09:00 PM
I am trying to import data from a csv file into SAS studio. When I run the program, the notes tell me that there were zero observations and two variables. There are two variables, but there should be 39. What am I doing wrong? I have attached my code, as well as a screen shot of my csv file. Thank you for your help.
data CitynameSTinSAS; infile "/folders/myfolders/CitynameSTforSAS.csv" dlm="," firstobs=2; input Temp Met; run;
09-11-2016 09:10 AM
Thank you for replying. I thought I had listed my variables; I only have two. It is just not bringing the data along with them. What am I missing in that statement to bring all of the temperature and metabolism data along with the variable names?
Thank you again for your time,
09-11-2016 04:27 PM
@timgpp In your first post you included two screenshots of your error message but not a screenshot of your CSV.
Include either the CSV or at the minimum a screenshot for help. It's likely an easy solution.
09-11-2016 10:34 AM
Your error message is saying that there 221 bytes, but no records in file past the first line. Perhaps your data is all on one line?
Try just telling SAS to read the file and show you want is in it.
data _null_; infile '/folders/myfolders/CitynamesSTforSAS.csv' ; input; list; run;
Then you can look and see what is there.
Perhaps the data is just all on one line?
data want; infile '/folders/myfolders/CitynamesSTforSAS.csv' dsd; input Temp Met @@; run;
09-13-2016 08:29 AM
Thank you all for your help. You were right. It was the CSV file. Only the first line of the Excel sheet saved for some reason ( Thanks Tom for the tip about 221 bytes). I resaved the file as a CSV and it contained all the data. Life is good.