- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Make sure that the dataset exists. Why do you think it should be there?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Make sure that the dataset exists. Why do you think it should be there?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I uploaded the file from my canvas. But it is giving me the error because it does not recognize the file. How do I determine what the library name is?
Here is my code
data SAS2023.YRBS1;
set SAS2023.YRBS2017;
keep q1-q5 q23-q29;
run;
proc contents data=SAS2023.YRBS1; run;
proc format;
value $age '1'= '12 years old or younger' '2' = '13 years old' '3' = '14 years old' '4' = '15 years old' '5' = '16 years old' '6' = '17 years old' '7' = '18 years old';
value $sex '1'= 'Female' '2' = 'Male';
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
For SAS to be able to work with the file, it should be named
yrbs2017.sas7bdat
All lowercase!
Or are you trying to use an Excel file with spreadsheets?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I uploaded the file from my canvas. But it is giving me the error because it does not recognize the file. How do I determine what the library name is?
Here is my code
data SAS2023.YRBS1;
set SAS2023.YRBS2017;
keep q1-q5 q23-q29;
run;
proc contents data=SAS2023.YRBS1; run;
proc format;
value $age '1'= '12 years old or younger' '2' = '13 years old' '3' = '14 years old' '4' = '15 years old' '5' = '16 years old' '6' = '17 years old' '7' = '18 years old';
value $sex '1'= 'Female' '2' = 'Male';
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The LIBREF you need to use depends on the LIBNAME statement you submitted.
In your code you are using the LIBREF of SAS2023. So you need to have submitted a LIBNAME statement that defines SAS2023 to point to the directory (what some might call a "folder") where you uploaded the file. So something like:
libname sas2023 "~/homework";
If you are running SAS on a Unix machine then make sure the name of the file you uploaded is exactly yrbs2017.sas7bdat since Unix filenames are case sensitive and SAS will be looking for a name using only lowercase letters.