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!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.