Question 1 (10 marks) Suppose the file reference label Purchase refers to raw data file PurchaseRecords.txt (not provided) in SAS Studio. PurchaseRecords.txt contains each customer’s purchase records in the form of one record per customer. For each record, each pair of fields is separated by a comma, and the fields are arranged in the following order: customer’s identity (at most 10 characters, no embedded blank), number of visits made by the customer (standard numeric), and a units-purchased field for each visit (standard numeric). The exact number of units-purchased fields depends on the number of visits made by the customer. An empty units-purchased field indicates the customer did not make any purchase in the respective visit. For example, customer C23005A6 made 3 visits and purchased 15 and 39 units in the first and third visits. There is no missing value for the customer’s identity and number of visits fields, and there is no shortage of fields in each record. A few records in PurchaseRecords.txt are shown in the table below for your reference. You are asked to accomplish all of the following tasks within the same DATA step. Using any other procedures are not allowed. The tasks are: Create a SAS data set named ItemPurchased. Reside the created data set in the library Mywork of SAS studio. You may assume the Mywork library has already been defined in SAS Studio. Read the records in PurchaseRecords.txt into SAS to create an observation for each visit with purchases only. For example, create only two observations for customer C23005A6 because the customer made only two purchases out of 3 visits. The data set ItemPurchased must contains only two variables, namely customer’s identity (character type in at least length of 10), and the number of units purchased by the customer in a visit (standard numeric type). The observations must be grouped by the respective customer’s identity
- Assignment status: Already Solved By Our Experts
- (USA, AUS, UK & CA PhD. Writers)
- CLICK HERE TO GET A PROFESSIONAL WRITER TO WORK ON THIS PAPER AND OTHER SIMILAR PAPERS, GET A NON PLAGIARIZED PAPER FROM OUR EXPERTS
