BookmarkSubscribeRSS Feed
larsonnic
Calcite | Level 5

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:

  • Write a PROC CONTENTS step to generate a report of the storm_summary.sas7bdat table.
    • SAS Studio: Specify the path to your EPG1V2/data folder and the full name of the table

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:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
SYMBOLGEN: Macro variable _SASWSTEMP_ resolves to /home/u49700996/.sasstudio/.images/9c2f11a4-e2fc-4d68-b371-f66d6148b2af
SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing.
SYMBOLGEN: Macro variable GRAPHINIT resolves to GOPTIONS RESET=ALL GSFNAME=_GSFNAME;
72
73 proc contents data="/home/u497000996/EPG1V2/data/storm_summary.sas7bdat";
ERROR: Create of library failed.
74 run;
 
I am able to pull up the data when I click on the file itself, so I know that it is there, but the code isn't working.
 
Any insight would be much appreciated!
4 REPLIES 4
jimbarbour
Meteorite | Level 14

@larsonnic,

 

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

 

 

andreas_lds
Jade | Level 19

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.

ckazarov
Calcite | Level 5

How did you end up resolving this? I am having the same exact issue.

Kurt_Bremser
Super User

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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 3749 views
  • 4 likes
  • 5 in conversation