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 open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.
Find more tutorials on the SAS Users YouTube channel.