Cannot figure out how to import a cvs file. Appreciate any help.
My code:
options validvarname= any;
data Consumer;
proc import datafile="/courses/ddb976e5ba27fe300/NHANES 2013_2014/consumer.csv" out=Consumer dbms=csv replace;
getnames=no;
run;
proc contents data=Consumer;
run;
My errors:
ERROR: File WORK.CONSUMER.DATA does not exist.
ERROR: Import unsuccessful. See SAS Log for details.
My Task if needed:
The codebook, which shows the variable labels and formats, is available at:
https://wwwn.cdc.gov/Nchs/Nhanes/2013-2014/CBQ_H.htm
Import the consumer.csvdata into a temporary SAS data set called Consumer. The data values represent SEQN,CBD070,CBD090,CBD110,CBD120, and CBD130, respectively.
The variables in the Consumer data set should have permanently assigned variable labels.
How do I do that?
commenting your code means adding comments.
In SAS you can add a comment using *; or /* */
*this is my comment; proc means data=sashelp.class; class sex ; /*this is another comment*/ run;
It's considered good practice to comment your code. And I guarantee you'll save more time doing it because you'll find errors faster and avoid logical errors. And it's a good practice because it's hard to build in habits after you've already learned one way.
So comment every line in your code with what you think it is doing and you'll likely find your mistake. If not, past back with your code and comments and I'll tell you where the issue is.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: