I am working through the 2nd practice question in the Programming Essentials class and continue to get errors when running the code.
The task is:
I am working in SAS Studio, so my code is:
proc contents data="/home/u497000996/EPG1V2/data/storm_summary.sas7bdat";
run;
However, when I run the code I get the error:
I haven't taken that class, and I'm using Enterprise Guide at the moment, not Studio, but I would normally create a Libname rather than trying to go straight to the sas7bdat file.
Something like the following:
Libname PrgEssnt "/home/u497000996/EPG1V2/data";
proc contents data=PrgEssnt.storm_summary;
run;
For the Libname, I just use the path. For the Data= parameter of Proc Contents, I use a two part data set name consisting of Libname.Datasetname. Notice that nowhere do I actually code ".sas7bdat". The extension is assumed.
Why don't you give that a shot and see how it goes?
Jim
Lately i have seen many programs using direct path to datasets instead of library+dataset. Using the path in every place is such a bad idea, that i wonder why this is even part of official tutorials. @Sas: Please stop this madness, as it reduces readability and increase the efforts necessary to maintain the code.
How did you end up resolving this? I am having the same exact issue.
Same solution: define a libname and use that.
Right-click on the file in the navigation pane and copy/paste the path from the properties. Maintain the spelling, as UNIX is case sensitive.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.