Preview

sas homework Solutions

Good Essays
Open Document
Open Document
746 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
sas homework Solutions
Homework 5 - Solutions

1. Download the external file HW5-States.txt from the Blackboard. Read it into SAS. It contains the Statehood Order, State Name, and Statehood Date. Finish the following tasks.

Calculate the days and years between the statehood date and the Independence Day (4th of July, 1776) for each state.
For each state, what is its Bicentennial?
Summarize the number of statehood for each month (January to December, ignore the year). Note: only one row is expected for each month for your final result.

You need to write SAS programs to finish the above tasks. Show your programs and results.

data states; infile cards dlm="#" firstobs=2; length Order $2. State $20. Date $20.; input Order $ State $ Date $; cards;
Order#State#Admission
1#Delaware#December 7, 1787
2#Pennsylvania#December 12, 1787
3#New Jersey#December 18, 1787
4#Georgia#January 2, 1788
5#Connecticut#January 9, 1788
6#Massachusetts#February 6, 1788
7#Maryland#April 28, 1788
8#South Carolina#May 23, 1788
9#New Hampshire#June 21, 1788
10#Virginia#June 25, 1788
11#New York#July 26, 1788
12#North Carolina#November 21, 1789
13#Rhode Island#May 29, 1790
14#Vermont#March 4, 1791
15#Kentucky#June 1, 1792
16#Tennessee#June 1, 1796
17#Ohio#March 1, 1803
18#Louisiana#April 30, 1812
19#Indiana#December 11, 1816
20#Mississippi#December 10, 1817
21#Illinois#December 3, 1818
22#Alabama#December 14, 1819
23#Maine#March 15, 1820
24#Missouri#August 10, 1821
25#Arkansas#June 15, 1836
26#Michigan#January 26, 1837
27#Florida#March 3, 1845
28#Texas#December 29, 1845
29#Iowa#December 28, 1846
30#Wisconsin#May 29, 1848
31#California#September 9, 1850
32#Minnesota#May 11, 1858
33#Oregon#February 14, 1859
34#Kansas#January 29, 1861
35#West Virginia#June 20, 1863
36#Nevada#October 31, 1864
37#Nebraska#March 1, 1867
38#Colorado#August 1, 1876
39#North Dakota#November 2, 1889
40#South Dakota#November 2, 1889
41#Montana#November 8, 1889
42#Washington#November 11, 1889
43#Idaho#July 3, 1890
44#Wyoming#July 10, 1890

You May Also Find These Documents Helpful

Related Topics