10/326 questions · Unlock full access
Q1

A financial services company needs to generate a report of all customer transactions from the `work.transactions` dataset. For each transaction, the report must include the customer's current city from the `work.demographics` dataset. The final report must include all transactions, even if a customer's demographic record is missing. If a customer's city is missing, the report should display 'Unknown'. Which PROC SQL query correctly fulfills this requirement?

Q2

A developer is creating a data-driven macro to generate summary reports for a list of products. The product IDs are stored in a dataset `WORK.PRODUCT_LIST`. The macro needs to create a series of macro variables, one for each product ID, named `prod1`, `prod2`, `prod3`, etc. Which code snippet correctly populates these indexed macro variables?

Q3

A programmer needs to combine a very large transaction dataset (`WORK.TRANSACTIONS`, 50 million rows) with a small product lookup table (`WORK.PRODUCTS`, 2,000 rows) to add the `ProductName` to the transaction data. The `WORK.TRANSACTIONS` dataset is not sorted by `ProductID`. What is the most computationally efficient method to perform this lookup, minimizing both CPU time and I/O operations?

Q4

You are debugging a complex SAS macro that dynamically generates SQL code. You suspect that a macro variable is not resolving to the expected value, causing the SQL query to fail. You need to see the exact value of the macro variable as it is being resolved by the macro processor. Which system option is specifically designed for this purpose? ```mermaid flowchart TD Start[Macro Call] --> MacroProcessor{Macro Processor} MacroProcessor -->|Resolves &myvar| SymbolGenLog[SYMBOLGEN writes: &myvar resolves to 'Value'] MacroProcessor -->|Generates Code| MPrintLog[MPRINT writes: proc sql... where col = 'Value'] SymbolGenLog --> MPrintLog MPrintLog --> Execution ```

Q5

A marketing analyst needs to find all customer comments in the `SURVEY.RESPONSES` table that contain either the word 'service' or 'support', but not when these words are part of a larger word (e.g., 'serviced' should not match). The search must be case-insensitive. Which `WHERE` clause correctly implements this logic using PRX functions?

Q6Multiple answers

A data analyst is tasked with creating a summary report from a `SALES` table. The report needs to show the total revenue for each product category, but only for categories that have generated more than $1,000,000 in total revenue. Which two clauses must be used in the `PROC SQL` step to achieve this? (Select TWO).

Q7

A SAS programmer has written the following macro. The intent is to pass a numeric value and have the macro evaluate if it is greater than 100. %macro check_value(val); %let result = %eval(&val > 100); %put The result is &result; %mend; The programmer then calls the macro with a non-integer value: `%check_value(val=105.5)`. What is the outcome of this macro call?

Q8

To create a user-defined function that can be used in a DATA step or a WHERE clause, you must use PROC FCMP. True or False?

Q9

A research institute is analyzing longitudinal patient data stored in `WORK.VISITS`, sorted by `PatientID` and `VisitDate`. For each visit, the analyst needs to calculate the number of days since that patient's *previous* visit. If it is the patient's first visit, the result should be a missing value. Which code snippet correctly computes this difference?

Q10

A programmer needs to query the SAS `DICTIONARY.TABLES` view to get a list of all datasets in the `WORK` library. However, they want to limit the result to the first 5 tables found and prevent the results from printing to the output window. Which `PROC SQL` statement correctly achieves this?