Question: MS 3 2 5 1 Analytics Using SAS Assignment 1 - You must complete the assignment by yourself. Exchanging ideas with classmates is Showing your

MS3251 Analytics Using SAS
Assignment 1
- You must complete the assignment by yourself. Exchanging ideas with classmates is Showing your work to your classmates is a non-acceptable collaboration. All identified
- Complete all questions. Put all of your SAS code into one PDF file. It would be best to
mark each question's answer as SAS comment statements in the code, such as /*Question \(1^{*}/\). Name your code file as nnnnnnnn.pdf, where nnnnnnnn is your full name.
You should set all irrelevant statements in your code as SAS comment statements. Be aware that your SAS code created under a non-English operating system may contain
extraneous characters when viewed in an English operating system. You are responsible for ensuring your submitted code is free of these characters. All extraneous characters in Utilising codes not included in the course notes will not be accepted as correct answers,
even though they are not wrong. of the course on Canvas. If you submit your file more than once, only the latest submitte shall be deducted for every 1 minute or less late. The submission link will be closed at Question 1(10 marks)
Suppose the raw data file PurchaseRecords. dat (not provided) has already been referred to definition in your code.) PurchaseRecords contains each customer's purchase records. Fo order: customer's identity (at most 12 characters, no embedded blank), number of visits the units purchased in each visit (standard numeric), if applicable. The exact number of fields he customer had purchased any units during the visit. A visit without purchase will have \( n \) units in two of the three visits. Each customer in PurchaseRecords made at least one visit, table shows a subset of the records in PurchaseRecords.
Write a SAS DATA step that reads each record of PurchaseRecords into a SAS data set named Purchases. The data set Purchases must contain only three variables: a customer's identity,
the number of visits, and the total number of units purchased in all visits by the custome
There is one observation for each unique customer's identity. For a visit without purchase,
the purchased number of units of that visit should be set to 0. The following table shows subset of Purchase
are meaningful and valid SAS variable names. You must accomplish the task with only one
SAS DATA step. Using any other procedures is not allowed. Question 2(20 marks)
Suppose the raw data file Sales.txt (not provided) has already been referred to by the
defeference 'DataB' in SAS Studio. You do not need to submit the FILENAME (
1234567890123456789012345678901234567890
"David Wong" 1/Aug/202313200
"David Wong" 1/Aug/202313200
"Brian Leung" 15/Sep/202323450
10/Sep/202333000
"Mary Chan" 3/Jul/202345600
\(20/\) Aug/202337800
20/Aug/202337800
1/Dec/202321500
30/Aug/202342000
The first line in the shown table is not part of the data file. The records in the data set ar alesperson's name (at most 20 quoted characters, including the quotes and embedded field of the record always starts from the first column. Subsequent records of the same (
dd/mon/yyyy) and the sales amount (standard numeric). The sales date field in these the data set does not contain in any column. All fields are separated by a blank space, and ne or more lines of records, and the same salesperson's records are not listed in date order. Write a SAS DATA step that reads each record of SalesRecords.txt into a SAS data set named It contains only one observation for each salesperso
It contains only the following variables: a salesperson's name without quotes, the
salesperson's latest sales date in SAS date values, the number of days between the sales date is \(30/\) Dec/2023, then the number of days equal to 1)., the salesperson's total
number of sales (equivalent to the salesperson's number of records in Sales), and the for reference only. You don't need to define them in your SAS DATA step. You may name th You must accomplish the task with only one SAS DATA step. Using any other procedures is t allowed.
\begin{tabular}{|l|r|r|r|r|r|}
\hline Name & Last sales date & Number of sales & Running sales total & Days between last sales and 31 Dec 2023\\
\hline David Wong & 23223 & 1 & 13200 & 152\\
\hline Brian Leung & 23268 & 2 & 69650 & 107\\
\hline Mary Chan & 23345 & 4 & 21650 & 30\\
\hline John Tam & 23265 & 1 & 251550 & 110\\
\hline
\end{tabular} example, Var1='1/jan/2023'd assigns a SAS date value constant to the variable Var1. The
difference between two SAS date values (recent SAS date value - earlier SAS date value)
returns the number of days between two dates.\}
MS 3 2 5 1 Analytics Using SAS Assignment 1 - You

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 Programming Questions!