Hello, I just started learning SAS and I need to create a temporary dataset 'distance' using the following data.
Miles = 26.22;
Kilometers = 1.61 * Miles.
That's close! I have modified the code so that I think it will work
data distance;
Miles=26.22;
Kilometers=1.61*Miles;
run;
proc print data = distance;
run;
You don't need an INPUT statement unless you plan to read data from somewhere (a file, or a CARDS or DATALINES statement)
Show us what you have tried.
data distance;
input Miles Kilometers;
if Miles=26.22 then Kilometers=(1.61*Miles);
run;
proc print data = distance;
run;
That's close! I have modified the code so that I think it will work
data distance;
Miles=26.22;
Kilometers=1.61*Miles;
run;
proc print data = distance;
run;
You don't need an INPUT statement unless you plan to read data from somewhere (a file, or a CARDS or DATALINES statement)
Thank you so much for your help. Thank you for teaching me!
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.