Question : Read the table Given the SAS data set SASUSER.HOUSES: Obs style bedrooms baths price sqfeet street 1 CONDO 2 1.5 80050 1200 MAIN 2 CONDO 3 2.5 79350 1300 ELM 3 CONDO 4 2.5 127150 1400 OAK 4 CONDO 2 2.0 110700 1100 FIFTH 5 TWOSTORY 4 3.0 107250 2100 SECOND 6 TWOSTORY 2 1.0 55650 1600 WEST 7 TWOSTORY 2 1.0 69250 1450 NORTH 6 TWOSTORY 4 2.5 102950 2000 SOUTH The following SAS program is submitted: proc report data = sasuser.houses nowd headline; column style price; where price It 100000; (insert DEFINE statement here) define price / mean width = 9 format = dollar12.; title; run; The following output is desired: styleprice ------------- CONDO$79,700 TWOSTORY$62550 Which DEFINE statement completes the program and produces the desired output? 1. define style / width = 9, 2. define style / orderwidth = 9; 3. define style / group width = 9; 4. define style / display width = 9;
Question : Given the SAS data set WORKAWARDS: WORK.AWARDS FNAME POINTS MONTH ---------------------------------- Amy 2 4 Amy 1 7 Gerard 3 3 Wang 3 3 Wang 1 12 Wang 1 8 The following SAS program is submitted: proc sort data = work.awards; by descending fname points; run; How are the observations sorted (Select the option from left image)? 1. 2. 3. 4.
Question : The following SAS program is submitted: libname temp `SAS data library'; data work.new; set temp.jobs; format newdate mmddw10.; mdate = month(newdate); ddate = weekday(newdate); run; proc print data = work.new; run; The variable NEWDATE contains the SAS date value for April 15. 2005. What output is produced if April 15, 2005 falls on a Friday?
Correct Answer : Get Lastest Questions and Answer : Finding the Day of the Week SAS has various functions that produce calendar dates from SAS date values. SAS date functions enable you to do such things as derive partial date information or use the current date in calculations. If the final payment for a tour is due 30 days before the tour leaves, then the final payment date can be calculated using subtraction; however, Tradewinds Travel is closed on Sundays. If the payment is due on a Sunday, then an additional day must be subtracted to make the payment due on Saturday. The WEEKDAY function, which returns the day of the week as a number from 1 through 7 (Sunday through Saturday) can be used to determine if the return day is a Sunday. The following statements determine the final payment date by subtracting 30 from the departure date , checking the value returned by the WEEKDAY function , subtracting an additional day if necessary , DueDate = DepartureDate - 30; if Weekday(DueDate) = 1 then DueDate = DueDate - 1; Constructing a data set with these statements produces a list of payment due dates. The following program includes these statements and assigns the format WEEKDATE29. to the new variable DueDate: options yearcutoff=1920 pagesize=60 linesize=80 pageno=1 nodate; data pay; set mylib.tourdates; DueDate = DepartureDate - 30; if Weekday(DueDate) = 1 then DueDate = DueDate - 1; format DueDate weekdate29.; run; proc print data=pay; var Country DueDate; title 'Date and Day of Week Payment Is Due'; run;