Question: I need help with SAS programming here is the question: PARTA QUESTION 1 Refer to the SAS dataset tm.subscribers. a) Arrange the subscribers in ascending

I need help with SAS programming here is the question:

I need help with SAS programming here is the question: PARTA QUESTION1 Refer to the SAS dataset tm.subscribers. a) Arrange the subscribers inascending order by the package that they subscribe and within the same

PARTA QUESTION 1 Refer to the SAS dataset tm.subscribers. a) Arrange the subscribers in ascending order by the package that they subscribe and within the same category of package, arrange the subscribers in descending order by tenure days. Do not replace the original data set. b) Display the sorted data set created in b). Display only Cust_ID, Age, Gender, Package and tenure days Select subscribers who subscribe the package after 31 December 2016. Group the subscribers by the package that they subscribe. Display an appropriate two-lines title. Display the label. C) Using the tm.subscribers as input data, create a new permanent SAS data set enjoy30 as follows: Select only subscribers who subscribe the package "WiFi Enjoy 30Mbps". Variables Superman_Pack, The_Flash_Pack, Batman_Pack, Hulk_Pack and Sports_Pack are formatted as Y = Yes and N = No, Include a new variable promotion whose values are as follows: Installation date Promotion Before or on 31 December 2016 Before Promotion After 31 December 2016 After Promotion Exclude variables termination month, termination reason code and termination_reason_category. QUESTION 2 The raw data files Five Mbps and TwentyMbps contain the following variables: Variable Field CUST_ID 1-7 AGE 9-10 GENDER 12-17 REGISTRATION DATE 20-26 PACKAGE 31-47 SPEED 51-56 TENURE 58-62 a) Convert both raw data files to SAS format. Use appropriate input style to read the variables. b) Create a new permanent SAS data set Overall that combines observations from both SAS data sets created in a). The registration date must be stored as SAS date values. c) Print the overall data set. Use CUST_ID as ID variable. PART B The results of a Mathematic Competition are stored in the SAS data set Marks. Variable Label STUDENT_ID Student's identification number SCHOOL School (1 = SMK Puteri, 2 = SMK Cabang Tiga, 3 = SMK Dato' Harun) M1 Mark for first round M2 Mark for second round Mark for third round a) Use the Marks data set to create a new permanent SAS data set Results. The new data set should contain the followings: i) An array that contains the marks for the three rounds. ii) A temporary array that contains the passing mark for each round as follows: Round Passing Mark First 70 Second 60 Third 50 ii) An array that stores the status (passed/failed) for each round. iv) A new variable Average that stores the average mark for the three rounds. Your data (first three observations) should appear as follows: Obs STUDENT_ID SCHOOL M1 M2 M3 $1 S2 1 STTO01 1 85 80 83 Passed Passed 2 STTOO 1 84 75 74 Passed Passed 3 STT003 1 77 56 53 Passed Failed b) The winner of the Mathematic Competition is the one who passed all three rounds and obtain the highest average mark. Display the data set with the winner appears on top. c) Use PROC SQL to create new temporary SAS data set Over80 which contain only students who obtain average mark more than 80. Do not include the variable status (S1-53) to the new data set. d) Consider the following SAS codes: proc print data - Over 80; where School = 1; run; proc print data = Over 80; where School = 2; run: proc print data - Below80; where School = 2; run; Modify the above SAS codes by using macro variable so that only a single PROC PRINT is needed to display observations from different schools stored in both Over80 and Below 80 data sets. END OF QUESTIONS

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!