Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please answer this in SAS, th.e data set is attached. Thanks Refer to the attach

ID: 3357132 • Letter: P

Question

Please answer this in SAS, th.e data set is attached. Thanks

Refer to the attached data set Q1, listing names, year of Ph.D., faculty rank, and salary

(a) Write an INPUT statement to read in the variables FullName, PhDYear, Rank, and Salary

(b) write the INPUT statement to read in the variables FirstName, LastName, PhDYear, Rank, Salary

(c) Suppose you had read in FirstName and LastName. Write a SAS statement that creates the variable FullName from these two variables

(d) What format might you use to print Salary?

Data set Q!:

/*--5---10---15---20---25---30---35---40---45*/

Elizabeth Bennett 1813 Full 120000

Jane Eyre 1847 Asst 82000

Bathsheba Everdene 1874 Asst 95000

Tess Derbyfield 1891 Full 110000

Emma Woodhouse 1815 Assoc 92000

Fanny Price 1814 Full 125000

Eustacia Vye 1878 Asst 82500

Catherine Earnshaw 1847 Assoc 93000

Explanation / Answer

Data ds1;

infile cards firstobs=2;

input fullname & $30. PhDYear Rank $ Salary;

cards;

Elizabeth Bennett 1813 Full 120000

Jane Eyre 1847 Asst 82000

Bathsheba Everdene 1874 Asst 95000

Tess Derbyfield 1891 Full 110000

Emma Woodhouse 1815 Assoc 92000

Fanny Price 1814 Full 125000

Eustacia Vye 1878 Asst 82500

Catherine Earnshaw 1847 Assoc 93000

;

run;

Solutionb:

Data ds1;

infile cards;

input firstname $ lastname $ PhDYear Rank $ Salary;

cards;

Elizabeth Bennett 1813 Full 120000

Jane Eyre 1847 Asst 82000

Bathsheba Everdene 1874 Asst 95000

Tess Derbyfield 1891 Full 110000

Emma Woodhouse 1815 Assoc 92000

Fanny Price 1814 Full 125000

Eustacia Vye 1878 Asst 82500

Catherine Earnshaw 1847 Assoc 93000

;

Solutonc:

data ds2;

set ds1;

fullname=catx(' ',firstname,lastname);

run;

Solutiuond:

Proc print data=ds2;

format salary dollar9.;

run;