BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

I have a hypothetical question.

 

How many humming birds does it take to lift an elephant? 

 

I know that everyone knows humming birds are the incorrect tool for the job, but in my scenario it is the only tool available in order to lift the elephant.  Besides the string that will be used to attach the humming birds to the elephant.

 

How would I go about writing in SAS a process where I could change the weight of the elephant and predetermine the number of humming for the job? 

 

elephant_weight = 100

humming_bird_lift_ability = ?

other_weight = ?

 

 

 

 

Thanks for any interaction with this scenario.

BTW the answer is 1 really smart humming bird that can indicate humming birds are the incorrect tool for the job.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
%let elephant_weight = 1000;
%let birds_wgt_capacity = 5;
%let num_birds_needed = %sysfunc(floor(%sysevalf(&elephant_weight/&birds_wgt_capacity)));

data have;
sentence = "With an elephant that weights &elephant_weight. 
     and birds able to carry &birds_wgt_capacity., 
     then you need &num_birds_needed birds.";
run;

proc print data=have;
run;

View solution in original post

1 REPLY 1
Reeza
Super User
%let elephant_weight = 1000;
%let birds_wgt_capacity = 5;
%let num_birds_needed = %sysfunc(floor(%sysevalf(&elephant_weight/&birds_wgt_capacity)));

data have;
sentence = "With an elephant that weights &elephant_weight. 
     and birds able to carry &birds_wgt_capacity., 
     then you need &num_birds_needed birds.";
run;

proc print data=have;
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 1 reply
  • 539 views
  • 3 likes
  • 2 in conversation