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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.