Question: SAS On Demand Script You have decided that you need to brush up on your script development skills, so you have pulled the following information
SAS On Demand Script
You have decided that you need to brush up on your script development skills, so you have pulled the following information from Wikipedia to use as a sample data to show president and number of days in office from each state. Your analytics will help news channel to the presidential election pattern.
Your script should use a conditional statement and print only presidents who are from Ohio. You will then calculate a total number of days for each president from Ohio based on Took office and left office columns.
| Presidency | President | Tookoffice | Leftoffice | Party | HomeState |
| 1 | William Henry Harrison | 04/03/1841 | 04/04/1841 | Whig | Ohio |
| 2 | William McKinley | 14/03/1897 | 14/09/1901 | Republican | Ohio |
| 8 | William Howard Taft | 14/03/1909 | 14/10/1913 | Republican | Ohio |
| 9 | Warren G. Harding | 14/03/1921 | 10-Dec-23 | Republican | Ohio |
| 10 | Herbert Hoover | 24/03/1929 | 14/12/1933 | Republican | Iowa |
| 11 | Richard Nixon | 20/01/1969 | 11-Oct-74 | Republican | California |
| 12 | Jimmy Carter | 20/01/1977 | 20/01/1981 | Democratic | Georgia |
| 13 | Ronald Reagan | 20/01/1981 | 20/01/1989 | Republican | California |
| 14 | Barack Obama | 20/01/2009 | 31/12/2012 | Democratic | Illinois |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
