A00-215実際の問題解答PDFには100%カバー率リアル試験問題 [Q105-Q129]

Share

A00-215実際の問題解答PDFには100%カバー率リアル試験問題

A00-215試験問題解答

質問 # 105
You are analyzing data on customer purchases, and you need to generate a report showing the frequency distribution of purchase amounts categorized by customer age group (18-25, 26-35, 36-45, 46-55, 56+). You also want to examine the relationship between purchase amount and customer gender (Male, Female). Which of the following PROC FREQ statements would correctly accomplish this task and generate the desired output?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:B

解説:
Option E is the correct answer. It generates separate frequency distributions for Purchase_Amount by Gender and Age by itself. The FORMAT statement defines a custom AGEGROUP format for the age variable to group ages into the desired categories. Option A attempts to create a three-way table, which may not be the most effective for the analysis. Option B creates two separate tables, one for age and another for purchase amount and gender, which does not effectively address the goal. Option C creates two separate tables, one for purchase amount and another for age and gender. Option D also creates two separate tables, one for purchase amount and gender, and another for age, which does not address the goal. The key to the solution is creating separate tables for the desired analysis while using the correct formatting for the age variable to achieve the desired categorization.


質問 # 106
Given the program shown below:

Given the partial PROC PRINT report below:

Why are the labels for msbp, MPG_city, and MPG_Highway NOT displaying in the PROC PRINT report^

  • A. You must put the LABEL statement in the PROC PRINT step
  • B. You must put the LABEL statement after the KEEP statement In the DATA stop
  • C. You must use the LABEL option on the PROC PRINT statement
  • D. You must use a single LABEL statement for each variable.

正解:C

解説:
The reason the labels for MSRP, MPG_City, and MPG_Highway are not displaying in the PROC PRINT report is that the LABEL option was not used in the PROC PRINT statement. In SAS, even if you have label statements in your DATA step, you must also specify the LABEL option in the PROC PRINT statement for those labels to be used in the report output. Thus, the correct answer is Option A: You must use the LABEL option on the PROC PRINT statement.
References:
* SAS documentation on the PROC PRINT statement and LABEL option, SAS Institute.


質問 # 107
Which program generates the PROC MEANS report below?

  • A. proc means data=sashelp. class maxdec=0;
    var Age;
    run;
  • B. proc means data=sashelp. class;
    group Age;
    run;
  • C. proc means data=sashelp.class nodec;
    class Age; run;
  • D. proc means data=sashelp. class;
    by Age;
    run;

正解:B


質問 # 108
Given the PATIENT and VISIT data sets and the DATA step shown below:
PATIENT

VISIT


How many observations are created in the ALLVISITS data set?

  • A. 0
  • B. 1
  • C. 2
  • D. 3

正解:A


質問 # 109
You have a dataset 'sales_data' with variables 'Region', 'Product', and 'Sales'. You want to create a report that shows the average sales for each region and product, with the 'Region' values displayed using a custom format 'region_fmt' and the 'Product' values displayed using the built-in format '$10.'. Which code snippet correctly uses FORMAT statements to achieve this?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:A、B、E

解説:
The correct answers are A, B, and D. These options correctly define the custom format and use it in the 'proc print' statement along with the built-in format '$10.' for the 'Product' variable. Option C incorrectly applies the formats within the 'proc means' statement, which is not the correct location for applying formats. Option E only formats the 'Region' variable but not the 'Product' variable.


質問 # 110
Given the report shown below:

Which PROC PREQ step creates the frequency report?

  • A. proc freq data= cars;
    tables make drivetrain;
    run;
  • B. proc freq data- cars;
    tables drivetrain make;
    run;
  • C. proc freq data- cars;
    tables drivetrain* make;
    run;
  • D. proc freq data= cars;
    tables make *drivetrain;
    run;

正解:D

解説:
The report shown in the image is a two-way frequency table generated by the PROC FREQ procedure which shows the frequency and percentage distribution of two categorical variables. The correct answer is option B:
* proc freq data=cars; tells SAS to use the PROC FREQ procedure on the dataset cars.
* tables make*drivetrain; requests the frequency table for the cross of make and drivetrain. The asterisk (*) denotes a two-way table of the two categorical variables.
* run; indicates the end of the proc freq step.
The resulting table in the output has the statistics for Make broken down by Drivetrain category, which matches the structure seen in the provided image.
Options A, C, and D do not correctly request the two-way table of make by drivetrain. Specifically, C and D reverse the order, which would change the orientation of the table in the output, and A is missing the asterisk (*) which is needed for the cross-tabulation of the two variables.
References:
* SAS 9.4 documentation for the PROC FREQ statement: SAS Help Center: PROC FREQ


質問 # 111
You have a dataset named 'CUSTOMERS' with variables 'Customer_lD', 'Name', 'City', and 'State'. You need to generate a report that displays the first 10 observations of the dataset, along with a title 'Customer Information (Top 10)' and a footer that indicates the date the report was generated. Which PROC PRINT statement with LABEL and NOOBS options would achieve this?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:A、E

解説:
Both options A and B are correct. They achieve the desired output using different approaches: Option A: It uses the OUT: option to create a temporary dataset called 'TEMP' and then uses the OBS=IO option within a subsequent PROC PRINT statement to display the first 10 observations of 'TEMP. This allows for additional customization or processing of the data before displaying the final report. Option B: It directly limits the number of observations displayed using the OBS=IO option within the same PROC PRINT statement. This is a more concise approach if you only need to display the first 10 observations without further manipulation. Both options use the LABEL option to assign a title, NOOBS to suppress observation numbers, and the FOOTNOTE option to add the date to the report footer. Option C, D, and E are incorrect because they either miss the OBS=IO option for limiting observations or lack the correct FOOTNOTE statement to include the date.


質問 # 112
You are analyzing a dataset containing sales data for different regions. You need to create a new variable 'SalesCategory' that classifies sales into three categories: 'High' if sales are above $10,000, 'Medium' if sales are between $5,000 and $10,000, and 'Low' if sales are below $5,000. Which code snippet correctly implements this logic in the DATA step?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:C

解説:
Option D is correct because it accurately implements the logic using the IF-THEN-ELSE statements. It correctly classifies sales based on the provided thresholds. The order of the conditions is essential to ensure the right category assignment. Option A assigns 'LOW when sales are between 5000 and 10000, which is incorrect. Option B assigns 'Medium' when sales are less than 5000, which is incorrect. Option C assigns 'Low' when sales are less than 5000, which is incorrect. Option E assigns 'Medium' when sales are less than 50007 which is incorrect.


質問 # 113
You have two datasets, 'SALES' and 'INVENTORY', both containing a common variable 'PRODUCT ID'. You need to combine these datasets horizontally, keeping only the records where 'SALES.QUANTITY SOLD' is greater than 'INVENTORY.QUANTITY ON HAND'. Which MERGE statement correctly achieves this?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:C

解説:
Option C is the correct answer. It uses the 'IN=S dataset option to create indicator variables CSALE and ' INV) to track which datasets contributed a record. The statement then ensures that only records from both datasets are included, and that 'SALESQJANTITY SOLD exceeds 'INVENTORYQUANTITY ON HAND'


質問 # 114
You have a dataset 'EMPLOYEES' with variables 'EMPLOYEE ID', 'NAME', 'DEPARTMENT', 'SALARY', and 'JOIN DATE'. You need to sort the data by 'DEPARTMENT' in ascending order, then by 'SALARY' in descending order, and finally by 'JOIN DATE' in ascending order. Which PROC SORT statement will achieve this sorting?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:A

解説:
The correct answer is C. The BY statement with 'DEPARTMENT, 'DESCENDING SALARY, and 'ASCENDING JOIN_DATE' will sort the data in ascending order of 'DEPARTMENT, then by 'SALARY' in descending order within each 'DEPARTMENT', and finally by 'JOIN_DATE' in ascending order within each 'DEPARTMENT and 'SALARY group. Option A sorts 'JOIN_DATE' in descending order. Option B sorts 'JOIN_DATE' in descending order. Option D sorts 'SALARY in ascending order. Option E sorts by 'DEPARTMENT in descending order. Only option C achieves the desired sorting.


質問 # 115
Which program assigns the library reference exlib to the CLASS. XLSX workbook and displays the CLASS_TEST worksheet?

  • A. libname xlsx exlib "c:\class.xlsx";
    proc print data=xlsx.class_test;
    run;
  • B. libname exlib xlsx "c:\class.xlsx";
    proc print data=class_test.xlsx;
    run;
  • C. libname exlib xlsx "c:\class";
    proc print data=exlib.class_test.xlsx;
    run;
  • D. libname exlib xlsx "c: \class.xlsx";
    proc print data=exlib.class_test;
    run;

正解:D

解説:
The correct answer is option D, which uses the LIBNAME statement correctly to assign a library reference to an Excel workbook and specifies the correct syntax for accessing a worksheet within that workbook. The syntax for this option is:
libname exlib xlsx "c:\class.xlsx";
proc print data=exlib.class_test;
run;
This code snippet assigns the library reference exlib to the Excel workbook located at c:\class.xlsx using the XLSX engine. The PROC PRINT step is then used to display the contents of the worksheet named CLASS_TEST within that workbook. The library reference exlib combined with the dataset name class_test (following the .) correctly specifies the worksheet to be printed. The other options (A, B, C) are incorrect due to various reasons: incorrect syntax for the LIBNAME statement, incorrect specification of the dataset to be printed, and incorrect path specifications.References: SAS 9.4 Guide to Software Updates.


質問 # 116
You are working with a SAS dataset named 'SALES containing information about sales transactions. The dataset has a variable 'PRODUCT ID' and 'QUANTITY SOLD'. You want to create a new dataset 'SALES SUMMARY' that summarizes the total quantity sold for each product. Which code snippet would you use to achieve this?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:E

解説:
It uses the 'by' statement to group observations by 'PRODUCT_ID', initializes 'sum_quantity' to 0 for the first observation of each product, and accumulates the total quantity sold using 'sum_quantity + QUANTITY SOLD. The 'output' statement writes the summarized data to the new dataset 'SALES_SUMMARY. Option B incorrectly uses for the summation. Options C and E use , which calculates the sum for the entire dataset instead of grouping by product. Option D omits initialization of 'sum_quantity' and uses 'sum_quantity + QUANTITY_SOLD incorrectly without a clear accumulation logic.


質問 # 117
You have a dataset with patient data, including age and blood pressure. You need to create a new variable 'RiskLevel' that assigns a 'High' risk if the patient is above 60 years old and has a systolic blood pressure greater than 140. If the patient is above 60 years old but has a systolic blood pressure below 140, the risk level should be 'Moderate'. Otherwise, the risk level should be 'Low'. Which code snippet correctly implements this logic using the IF-THEN-ELSE statements?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:B

解説:
Option D correctly implements the logic using nested IF-THEN-ELSE statements. It correctly classifies risk based on age and systolic blood pressure. The order of the conditions is crucial, ensuring that the risk level is assigned accurately Option A does not consider the systolic blood pressure when assigning 'Moderate' risk. Options B, C, and E have incorrect conditions, leading to wrong risk level assignments.


質問 # 118
You have a dataset with customer orders, and you need to analyze the order frequency of each customer. You decide to use PROC SORT to group orders by customer ID and then count the number of orders per customer. What additional step is required to make it easier to count the number of orders per customer after sorting?

  • A. Use a DATA step after PROC SORT to create a new variable that counts the number of orders per customer.
  • B. Use the BY statement in PROC SORT with the DESCENDING option
  • C. Use the NODUPKEY option in PROC SORT
  • D. Use the OUT= option in PROC SORT to create a new dataset
  • E. Use the FIRSTOBS= option in PROC SORT to start counting from the first order.

正解:C

解説:
The correct answer is option A: Use the NODUPKEY option in PROC SORT. This option removes duplicate observations, which in this case would remove duplicate orders for the same customer, making it much easier to count the number of orders per customer in a subsequent step. Option B is incorrect because it simply creates a new dataset but doesn't address the duplicate order issue. Option C is incorrect because it sorts the data but doesn't remove duplicates. Option D is correct in principle but is less efficient than using NODUPKEY in PROC SORT Option E is incorrect because it only affects the starting point of the counting and doesn't address the duplicate order issue.


質問 # 119
You want to read a SAS data set named 'CUSTOMERS' and update a variable 'Age' based on the following logic: If the 'Age' is missing, set it to the average age of all customers. Otherwise, leave the 'Age' unchanged. Which SAS code snippet correctly implements this logic?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:A

解説:
The correct answer is E. This code snippet uses the IF statement and the MISSING function to correctly check if the Age variable is missing. If it is, the code sets Age to the average Age using the MEAN function. The output statement is crucial for ensuring that the updated data is written to the output dataset. Option A is incorrect because it uses the sum function which is not relevant for calculating the average. Option B is incorrect because it uses the = operator with a period for checking missing values, which is not the recommended approach. Option C uses the AVG function instead of the MEAN function, which is not the correct function for calculating the average. Option D is incorrect because it uses the = operator with a period for checking missing values, which is not the recommended approach, and it also lacks the output statement.


質問 # 120
You have a dataset with customer information, including their purchase history. You need to identify the top 10 customers with the highest total purchase amount and display their information in descending order of their total purchase amount. Which code snippet correctly uses PROC SORT to achieve this? (Assume you have a variable named 'TotalPurchaseAmount' in our dataset)

  • A.
  • B.
  • C.
  • D.
  • E.

正解:D

解説:
Option E is the correct code snippet. It first sorts the data in ascending order of TotalPurchaseAmount using PROC SORT. Then, it uses a DATA step to create a new dataset called Top10Customers, selecting only the first 10 observations from the sorted dataset. This effectively retrieves the top 10 customers with the highest total purchase amount. Option A sorts in ascending order, not descending. Option B uses the wrong syntax for descending order (BY DESCENDING Option C is incorrect because NODIJPKEY removes duplicate observations, which may not be what is intended in this scenario. Option D uses the wrong syntax for descending order (BY - . DESCENDING).


質問 # 121
You have a SAS dataset named 'customer info' that contains detailed customer information. You need to export this data to an Excel file with specific formatting, including column widths, data types, and header labels. Which of the following code snippets correctly utilizes the LIBNAME statement and XLSX engine to achieve this objective?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:A、B、C、D、E

解説:
All of the options are valid and achieve different aspects of formatting during the export process- Option A creates the basic export, exporting to a spreadsheet named 'Sheetl' Option B adds the 'COLUMNWlDTff option to specify the desired column widths for the exported data- Option C adds the 'HEADERLABELS' option to provide custom header labels for the exported columns. Option D adds the 'DATATYPE option to define the data types for the exported columns. Option E combines all the previous options to achieve a comprehensive formatting scheme for the exported Excel file. While all options are correct, the most complete and effective solution for formatting is ''Option E' '.


質問 # 122
You are analyzing a SAS dataset with a variable 'CITY' of type character. You want to replace all missing values in 'CITY' with the value 'UNKNOWN' using a data step. Which code snippet correctly achieves this?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:E

解説:
The correct answer is E. SAS uses a blank string (") to represent missing values for character variables. The code snippet checks for missing values by first trimming the string using 'trim()' function and then comparing the length of the trimmed string with 0. If the length is 0, it indicates a missing value, which is then replaced with 'UNKNOWN' Option A is incorrect because it compares the character variable 'CITY with a single period C. which is used for numeric missing values. Option B is incorrect because 'missing()' function only checks for numeric missing values. Option C is incorrect because it compares the 'CITY' with an empty string which is not always true for missing character values. Option D is incorrect because 'missing(city)' function only checks for numeric missing values and doesn't consider missing character values. This scenario demonstrates the importance of understanding how SAS handles missing values for character variables and how to properly identify and replace them.


質問 # 123
You have two SAS datasets, 'EMPLOYEES' and 'SALARY HISTORY', with common key variables 'EMPLOYEE ID' and 'DATE'. You want to merge these datasets, but only include records from 'SALARY HISTORY' that have a corresponding match in 'EMPLOYEES' for the same 'EMPLOYEE ID' and 'DATE'. You also want to ensure that if a 'SALARY HISTORY' record has no matching 'EMPLOYEE ID' in 'EMPLOYEES' for the same 'DATE', the record is excluded from the final dataset. Which of the following code snippets correctly implements this logic?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:E

解説:
The correct answer is option A- The condition 'if emp_in and sal_in' ensures that only records where both 'EMPLOYEE_ID' and 'DATE match in both datasets are included in the final dataset. This fulfills both requirements: 1) only include records from 'SALARY_HISTORY that have a corresponding match in 'EMPLOYEES' for the same 'EMPLOYEE_ID' and 'DATE', and 2) exclude records from 'SALARY_HISTORY' if no matching 'EMPLOYEE_ID' is found in 'EMPLOYEES' for the same 'DATE'.


質問 # 124
You are analyzing customer data with a variable 'CustomerlD' (numeric) and 'OrderDate' (date). You need to create a new variable called 'CustomerAge' that represents the customer's age in years based on the order date. The variable 'Birthdate' is not available. Which code snippet correctly uses a FORMAT statement and a macro to achieve this, assuming the 'OrderDate' represents the most recent order?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:C

解説:
This code creates a macro 'age_calc' that calculates the age based on the difference between today's date and the order date- It correctly formats the 'customerage' variable using the 'year4.' format to represent the age in years. Options A, B, and C have incorrect format statements or formatting issues_ Option E uses both date formats, which is unnecessary and can lead to confusion.


質問 # 125
You are analyzing a dataset containing customer transactions with a 'Transaction_Date' variable in the format 'YYMMDDI You need to create a new variable called 'Days_Since Last_Transaction' that calculates the number of days between each transaction for each customer, sorted by 'CustomerlD' and 'Transaction_Date'. Which code snippet correctly performs this calculation?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:E

解説:
The correct answer is "A". The 'intck' function is used to calculate the number of intervals between two dates. In this case, we are using the ''days" interval to calculate the number of days between the current transaction date and the previous transaction date for each customer. The 'lag' function is used to access the value of the previous observation for the same variable. Option B is incorrect because it calculates the difference in days between the current transaction date and the previous transaction date, which is the opposite of what we want to achieve. Option C is incorrect because it uses the ''day" interval instead of the ''days" interval. Option D is incorrect because it uses the 'intnx' function, which is used to add or subtract a specified number of intervals from a date. Option E is incorrect because it simply subtracts the previous transaction date from the current transaction date, which does not accurately calculate the number of days between them.


質問 # 126
Which statement is true when creating two SAS data sets with a DATA step?

  • A. Use a PUT statement to output the observations to the appropriate data sets.
  • B. Name both data sets in the DATA statement
  • C. Use a separate SET statement for each data set.
  • D. Use an OUT= option in the WHERE statement to output the observations to the appropriate data sets.

正解:C


質問 # 127
You have two datasets, 'ORDERS' and 'PRODUCTS', both containing a variable 'PRODUCT ID'. You need to create a dataset 'ORDER SUMMARY that shows the total quantity ordered for each product, using the MERGE statement. Which of the following options correctly performs this task?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:B

解説:
The correct answer is D. This option uses a conditional statement to ensure that the summation of the quantity is only performed when the current observation belongs to the 'ORDERS' dataset The "IN_ORDERS variable automatically created by the MERGE statement indicates whether the observation is from the 'ORDERS' dataset Option A would incorrectly add the quantity for all matching observations. Option B uses the IN variable but doesn't correctly aggregate the quantity. Option C incorrectly uses the 'SUM' function, which would only consider the current observation's quantity Option E is similar to A, performing the summation across all matching observations. Only option D accurately sums the quantities for each unique product ID within the 'ORDERS' dataset The '+' operator is crucial in accumulating the sum across multiple observations.


質問 # 128
Consider a dataset 'Sales' with variables 'Region', 'Product', and 'Sales_Amount'. You need to create a new dataset 'Summary' that reports the total sales for each region and product combination, but only for regions where the total sales exceed $10,000. Which SAS code would you use to achieve this?

  • A.
  • B.
  • C.
  • D.
  • E.

正解:C

解説:
The correct answer is E. The code uses the BY statement to group the sales data by Region and Product. The function calculates the total sales for each group. The OUTPUT statement is then executed only if the sum is greater than 10,000, effectively filtering out regions with total sales below this threshold. Options A and B are incorrect because they do not use the correct function to calculate the total sales for each region-product combination. Option C is incorrect because it only checks for the last record in each region. Option D is incorrect because it only checks for the first record in each region. This scenario demonstrates how to use the OUTPUT statement in conjunction with BY group processing and aggregate functions to create a summary dataset based on specific conditions. It requires understanding the correct function and the use of group processing for data aggregation.


質問 # 129
......

A00-215試験練習テスト問題:https://jp.fast2test.com/A00-215-premium-file.html


弊社を連絡する

我々は12時間以内ですべてのお問い合わせを答えます。

我々の働いている時間: ( GMT 0:00-15:00 )
月曜日から土曜日まで

サポート: 現在連絡 

English Deutsch 繁体中文 한국어