BookmarkSubscribeRSS Feed
khalillx
Fluorite | Level 6

This is my first time ever doing this. Yet I was given the code for it and I'm not sure why it's not working. I'm trying to read in a permanent SAS data set and analyze the data. I put the data set into the folder I'm using, wrote down the exact code my professor gave us and I get the error message that the file does not exist. It's in my folder I assure you so I'm not sure what could be wrong. Yet, I've never done this before, I usually just import excel files into SAS so I don't understand what could be wrong. Here is my code, I hid my pathway:

 

libname session1 "C:\x";

 

data one;
set session1.hmda_subset_rev19;
proc conents;
run;

 

This is what's in the log:

libname session1 "C:\x";
NOTE: Libref SESSION1 was successfully assigned as follows:
Engine: V9
Physical Name: C:\x

2 data one;
3 set session1.hmda_subset_rev19;
ERROR: File SESSION1.HMDA_SUBSET_REV19.DATA does not exist.

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.ONE may be incomplete. When this step was stopped there were 0 observations and 0 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds

 

4 proc conents;
ERROR: Procedure CONENTS not found.
5 run;

 

I don't know what is going wrong. Thanks.

 

15 REPLIES 15
novinosrin
Tourmaline | Level 20

 

4 proc conents;
ERROR: Procedure CONENTS not found.
5 run;

 

 

typo error conents

 

Proc contents data=session1._all_ nods;

run;

 

run the above and verify

 

 


@khalillx wrote:

This is my first time ever doing this. Yet I was given the code for it and I'm not sure why it's not working. I'm trying to read in a permanent SAS data set and analyze the data. I put the data set into the folder I'm using, wrote down the exact code my professor gave us and I get the error message that the file does not exist. It's in my folder I assure you so I'm not sure what could be wrong. Yet, I've never done this before, I usually just import excel files into SAS so I don't understand what could be wrong. Here is my code, I hid my pathway:

 

libname session1 "C:\x";

 

data one;
set session1.hmda_subset_rev19;
proc conents;
run;

 

This is what's in the log:

libname session1 "C:\x";
NOTE: Libref SESSION1 was successfully assigned as follows:
Engine: V9
Physical Name: C:\x

2 data one;
3 set session1.hmda_subset_rev19;
ERROR: File SESSION1.HMDA_SUBSET_REV19.DATA does not exist.

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.ONE may be incomplete. When this step was stopped there were 0 observations and 0 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds

 

4 proc conents;
ERROR: Procedure CONENTS not found.
5 run;

 

I don't know what is going wrong. Thanks.

 


 

PaigeMiller
Diamond | Level 26

ERROR: File SESSION1.HMDA_SUBSET_REV19.DATA does not exist.

 

When SAS says a file does not exist, and the user says the file does exist, I believe SAS.

 

So, please show us a screen capture of this file in your operating system, so we can see it exists with that exact name, and so we can see that it is in folder "C:\x".

--
Paige Miller
khalillx
Fluorite | Level 6
I can assure you it’s in right folder. I’ve used sas plenty of times and I checked it plenty of times so I at least know how to put it in the right folder which isn’t a difficult thing to accomplish. I don’t know how to send a screen shot.
yabwon
Onyx | Level 15

Hi,

 

try following code on your location and file.

 

libname session1 "C:\x";

data _null_;

IF exist("session1.hmda_subset_rev19") 
  then putlog "I exist.";
  else putlog "I DON'T exits";

run;

 

all the best

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



khalillx
Fluorite | Level 6

Hi, I did that and SAS says it exists. What do I do not? Run the code again that I have in my question?

yabwon
Onyx | Level 15

Have you been using any macro quoting functions like %bquote(), %str(), or %superq() earlier in the code? e.g to create macrovariable with dataset name?

 

Maybe try:

 

data one;
set %UNQUOTE(session1.hmda_subset_rev19);
proc contents;
run;

second thought, are the dataset name in the code and in the folder in the same case? i.e. both lower case letters?

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



PaigeMiller
Diamond | Level 26

So now, we have a conflict, on the one hand SAS is saying that the file does not exist, but on the other hand, SAS is saying that the file does exist.

 

Can you show us a screen capture of the contents of library SESSION1? (Usually, SAS will show you the contents of libraries on the left hand side of the SAS workspace, but the specifics depend on what interface you are using)

--
Paige Miller
yabwon
Onyx | Level 15

One more thing, 

is there by any chance any space at the end of the dataset name?

 

Bart 

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



PaigeMiller
Diamond | Level 26

@khalillx wrote:
I can assure you it’s in right folder.

Well, then, quite simply, I believe SAS.


I don’t know how to send a screen shot.

Take the screen capture, and then send it by clicking on the Photo icon when you are typing your reply here at SAS communities.

--
Paige Miller
khalillx
Fluorite | Level 6
libname session1 "C:\econ385";

data one;
set session1.hmda_subset_rev19;
proc conents;
run;
PaigeMiller
Diamond | Level 26

@khalillx wrote:
libname session1 "C:\econ385";

data one;
set session1.hmda_subset_rev19;
proc conents;
run;

Show us a screen capture of the SAS contents of that library. It's on the left hand side of whatever SAS interface you are using.

 

And put a RUN; statement to end your SAS data step, before starting the next PROC.

 

And spell CONTENTS properly.

--
Paige Miller
PaigeMiller
Diamond | Level 26

Also, please show us the entire SAS log when you run this code, not just the error message.

 

To help us out, and preserve the appearance and formatting and spacing in the log, you need to copy the log as text (not a screen capture) and then click on the {i} icon when you reply here at SAS communities, and paste the log into the window that appears. Do not skip the step where you click on the {i} icon.

--
Paige Miller
yabwon
Onyx | Level 15

hmmm looks like folder is "C:\econ385" not "C:\x"

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 15 replies
  • 1720 views
  • 3 likes
  • 4 in conversation