Make sure that the dataset exists. Why do you think it should be there?
Make sure that the dataset exists. Why do you think it should be there?
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';
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?
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';
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.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.