Question: Question 1 ( 1 0 marks ) Suppose the raw data file PurchaseRecords.dat ( not provided ) has already been referred to by the FILENAME
Question marks
Suppose the raw data file PurchaseRecords.dat not provided has already been referred to by the FILENAME reference 'DataA' in SAS Studio. You do not need to submit the FILENAME definition in your code. PurchaseRecords contains each customer's purchase records. For each record, the fields are separated by a comma. These fields are arranged in the following order: customer's identity at most characters, no embedded blank number of visits made by the customer standard numeric and followed by a list of numbers representing the units purchased in each visit standard numeric if applicable. The exact number of fields for the units purchased depends on the number of visits made by the customer and whether the customer had purchased any units during the visit. A visit without purchase will have no unit purchased field in the record. For example, customer C only purchased and units in two of the three visits. Each customer in PurchaseRecords made at least one visit. Each record ends with a numeric digit. There is no empty field in the record. The following table shows a subset of the records in PurchaseRecords.
C
AD
ABC
FEG
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 customer.
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 The following table shows a subset of Purchases.
The column headers shown in the above table are for reference only. You don't need to define them in your SAS DATA step. You may name the variables in any way you want as long as they 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
