SASInstitute SAS Certified Associate: Programming Fundamentals Using SAS 9.4 - A00-215 Exam Practice Test
You have a SAS dataset named 'SALES with variables 'Region', 'Product', 'Sales_Amount', and 'Date'. You want to generate a report summarizing the total sales amount for each region, sorted in descending order of total sales. Which PROC PRINT statement with LABEL and NOOBS options would achieve this?
Correct Answer: E
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You're working with a dataset containing student records. You need to generate a report that shows the average grade for each student, but only for students who have taken at least two courses. Utilize the OUTPUT statement to control output timing and ensure only students with enough courses are included in the report. Which code snippet correctly implements this?
Correct Answer: D
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You have a dataset 'Sales' with variables 'Region', 'Product', 'SalesAmount', and 'Quantity'. You need to generate a report that summarizes the average 'SalesAmount' by 'Region' and 'Product' while also calculating the total quantity sold for each product across all regions. How would you modify the PROC MEANS statement to achieve this? Assume you want to generate a separate line in the output for each unique combination of 'Region' and 'Product'.
Correct Answer: D
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You have a SAS data set 'SALES DATA' with a variable 'DATE' representing the sale date. You need to create a new data set 'SALES BY MONTH' that summarizes sales by month. You want to include only the observations from the 'SALES DATA' dataset where the 'DATE' variable falls between January 1st and March 31st of the current year. How would you achieve this, using the SET statement and the IN T NX function?
Correct Answer: A
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You are working with a SAS dataset 'ORDERS' containing variables 'Order ID', 'Customer_lD', 'Product ID', 'Order _ Date', and 'Quantity'. You want to create a new dataset 'Active Orders' containing only orders placed in the current month, filtering out all other orders, and retaining all variables. Which code snippet will achieve this correctly?
Correct Answer: D
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You are analyzing a dataset containing customer information. You want to create a report that summarizes the average age of customers by their 'IncomeGroup' variable, but you want to display the IncomeGroup values with more descriptive labels. For example, instead of 'High', 'Medium', 'Low', you want to display 'High Income', 'Medium Income', 'Low Income'. How would you use the LABEL statement and PROC MEANS to achieve this?
Correct Answer: B
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You are working with a dataset called 'Transactions' that contains variables 'TransactionlD', 'CustomerlD', 'ProductlD', and 'TransactionDate'. You need to create a report that shows the number of unique customers who purchased a specific product (ProductlD = '1 23') in the month of January 2023. Which of the following PROC SQL statements would achieve this?
Correct Answer: A,B,C
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You are analyzing a SAS log and encounter the following message: "NOTE: The data set WORK. TEMP DATA has 0 observations and 10 variables.". Which of the following statements is TRUE regarding this message?
Correct Answer: E
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You have a dataset with a variable 'SalesAmount' representing sales figures. You need to create a new variable called 'SalesCategory' that categorizes sales based on thresholds: 0-1000 as 'Low', 1001-5000 as 'Medium', and above 5000 as 'High'. Which code snippet correctly uses a FORMAT statement to achieve this?
Correct Answer: E
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You have a SAS dataset named 'SALES' with variables 'CUSTOMER D', 'PRODUCT NAME', and 'SALES AMOUNT'. You want to export this dataset to a CSV file named 'sales data.csv', excluding the 'CUSTOMER ID' variable. Which PROC EXPORT statement will achieve this?
Correct Answer: A
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You have a dataset named 'SurveyResponses' containing responses to a survey about customer satisfaction. The dataset includes variables 'Product' (character), 'Rating' (numeric), and 'Comments' (character). You need to generate a two-way frequency table showing the distribution of 'Rating' by 'Product' and also calculate the chi- square statistic to determine if there is a significant association between 'Rating' and 'Product'. Which of the following code snippets would achieve this task?
Correct Answer: A,B
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You are working with a dataset containing a variable called 'SALES' with numeric values. You need to categorize the sales values into three groups: 'Low', 'Medium', and 'High' based on their ranges. Which code snippet correctly defines a custom format using PROC FORMAT and the VALUE statement to achieve this?
Correct Answer: A
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You have a SAS dataset named 'CUSTOMERS' with variables 'CustomerlD', 'Name', 'City', 'State', and 'Zipcode'. You want to create a report that displays only the 'CustomerlD', 'Name', and 'City' variables for customers residing in 'California' and 'Texas' but not in 'Los Angeles' city. Which PROC PRINT statement achieves this?
Correct Answer: C
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You have a dataset 'SalesData' with variables 'Region', 'Product', 'Sales', and 'Discount'. You need to create a new variable 'SalesCategory' that classifies sales based on the following logic: 1. If 'Sales' is greater than 1000 and 'Discount' is greater than 0.1, then assign 'High Sales with Discount'. 2. If 'Sales' is greater than 1000 and 'Discount' is less than or equal to 0.1, then assign 'High Sales without Discount'. 3. If 'Sales' is less than or equal to 1000 and 'Discount' is greater than 0.1, then assign 'Low Sales with Discount'. 4. If 'Sales' is less than or equal to 1000 and 'Discount' is less than or equal to 0.1 , then assign 'Low Sales without Discount'. Which of the following DATA step code snippets will achieve this correctly?
Correct Answer: B
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).
You need to import a CSV file containing financial data into a SAS dataset. The file has a header row and uses a comma as the delimiter. Which code snippet correctly imports the data into a SAS dataset named "financial data"?
Correct Answer: A
Explanation: Only visible for ExamsLabs members. You can sign-up / login (it's free).