Using the SAS data set Bicycles, create two temporary SAS data sets as follows: Mountain_USA consists of all observations from Bicycles where Country is USA and Model is Mountain Bike. Road_France consists of all observations from Bicycles where Country is France and Model is Road Bike. Print these two data sets.
here is my code what am i doing wrong?
data Mountain_USA;
set '/home/u62245181/Today/bicycles.sas7bdat';
where Country = "USA" and Model = "Mountain_Bike";
run;
And what happens when you run it? Do you get error messages? If it works how is the result different than you expected.
Does the value of MODEL include the underscore you used in the code? Or the space you used in your description?
When you have code that isn't working, SHOW US the log (we need to see the ENTIRE log for this DATA step, not parts of the log).
That is NOT the code you originally posted. Can you see the difference?
set clean.'/home/u62245181/Today/bicycles.sas7bdat';
set '/home/u62245181/Today/bicycles.sas7bdat';
You can either reference the data with a quoted physical filename such as one of these :
set '/home/u62245181/Today/bicycles.sas7bdat';
set '/home/u62245181/Today/bicycles';
Or you can create a libref pointing to the directory and use normal SAS syntax instead.
libname clean '/home/u62245181/Today' ;
....
set clean.bicycles;
...
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.