본문 바로가기

전체 글

(510)
Chapter 1. SAS Programs 1. How many step boundaries does this program contain? [프로그램 step boundaries] (c) RUN, QUIT, DATA, and PROC statements function as step boundaries, which determine when SAS statements take effect and indicate the end of the current step or the beginning of a new step. 2. Which of the following is a SAS syntax requirement? [SAS syntax] (d) All SAS statements must end with a semicolon, but they ar..
Chapter 13. Data Transformations 1. The variable Address2 contains values such as Piscataway, NJ. Select the statement that extracts and assigns the two-letter state abbreviation to a new variable named State. [SCAN 함수] (a) d 선택해서 틀림 In this case, you do not need to specify delimiters, because the blank and the comma are default delimiters. 'NJ' 만 추출하려면 scan 함수를 사용해야 한다. 2. Due to growth within the 919 area code, the telephone ..
Scenario 10 Open the ehs02 program from EHS folder and correct the errors in the program below. What is the number of observations where the variable Type is Sedan? How many observations are printed to the report titled, "Car With Average MPG Over 40" ? Example Code2 ehs02 Program : Fix the Errors [사용 코드] data work.mycars; set sashelp.cars; AvgMPG=mean(mpg_city, mpg_highway); run; title "Cars with Average M..
Scenario 9 This scenario uses the Cert.Empdata, Cert.Empdatu, and Cert.Empdatu2 data sets. Write a SAS program to do the following: Concatenate Cert.Empdata, Cert.Empdatu, and Cert.Empdatu2 to create Work.FlightEmpData. Create a macro variable named &Location and set the value for Country is the value of the macro variable. Include only the observation whose value for Country is the value of the macro vari..
Scenario 8 This scenario uses the Cert.Addresses data set. Write a SAS program to do the following: Create a temporary SAS data set that uses Cert.Addresses and store the results in Work.Scenario8. Extract the 5-digit ZIP codes from the State variable and store them in the ZipCode variable. Extract the two letters from the State variable and store them in the State variable. Create a one-way frequency tabl..
Scenario 7 This scenario uses the Cert.Temp18 data set. Write a SAS program to do the following: Create a temporary SAS data set that uses Cert.Temp18 and store the results as Work.Scenario7. Format the Day variable so that the date appears as 01JAN2018. Use a function to create a variable named Month that is equal to the numeric value of the month of the Day variable. For example, if the month is January,..
Scenario 6 This scenario uses the Excel file hear.xlsx. Write a SAS program to do the following and store the results in data set Work.Heart. Import the Excel file heart.xslx. Drop the AgeAtDeath and DearthCause variables from the Work.Heart data set. Include only the ovservations where Status=Alive in the Work.Heart data set. If the AgeCHDdiag variable has a missing value(.), then do not include the value..
Scenario 5 Open the ehs01 program from the EHS folder and correct the errors in the program. For instructions, see the commented code in the program that is marked by a slash(/) and an asterisk(*). Example Code1 ehs01 Program : Fix the Errors data work.aprilbills drop=Total, EquipCost; set cort.aprbills; if Days > 7 then Discount=(RoomCharge) * 20% else 0; TotalDue=Total - Discount; format DateIn DateOut d..