Question 101
A SAS programmer is analyzing a dataset containing customer demographics. They want to create a new variable called 'AgeGroup' that categorizes customers into three groups based on their age: 'Young' (18-30), 'Middle-Aged' (31-50), and 'Senior' (51 +). Which of the following statements correctly illustrates the use of the LENGTH statement and the IF-THEN/ELSE logic within the DATA step to achieve this?
Question 102
You have a dataset with customer purchase records. You want to identify customers who have made more than 3 purchases in a single day. You will use a data step to create a new variable 'HighFrequencyPurchaser' that will flag these customers with a value of 1 . Which of the following code snippets correctly implements this logic using the IF-THE-NIELSE structure?
Question 103
You have a dataset 'ProductData' with variables 'ProductlD', 'ProductName', 'Price', 'Quantity', and 'Category'. You need to update the 'Price' variable based on the following criteria: 1. If 'Category' is 'Electronics' and 'Quantity' is greater than 10, apply a 10% discount on the 'Price'. 2. If 'Category' is 'Books' and 'Price' is greater than 50, apply a 5% discount on the 'Price'. 3. Otherwise, leave the 'Price' unchanged. Which of the following DATA step code snippets will achieve this correctly?
Question 104
You are working on a project that involves analyzing customer data from multiple sources. You have three SAS datasets: 'CUSTOMER A', 'CUSTOMER B', and 'CUSTOMER C. Each dataset has different variables and potentially different observation counts. You want to create a single dataset called 'COMBINED CUSTOMERS' that includes all the observations from the three datasets, regardless of their structure. Which of the following options would achieve this, ensuring no data duplication and maintaining the original variable order for each dataset?
Question 105
You have three SAS data sets: 'CUSTOMERS', 'ORDERS', and 'PRODUCTS'. You want to combine them vertically to create a single dataset 'COMBINED DATA' where each observation represents either a customer, an order, or a product. How would you accomplish this using the SET statement?

