Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free SAS 9.4 Base Programming - Performance-Based Exam A00-231 Exam Questions

Last updated: · 13 practice questions with answers and explanations

Page: 1 / 6 Total 36 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Access and Create Data Structures

Skill tested: Select PROC IMPORT options and row-scanning behavior for delimited files.

A reporting team receives a comma-delimited file whose character columns contain occasional values longer than the first few records suggest. The file has a header row, and an identifier contains leading zeros that must remain part of the imported value. The team uses SAS 9.4 and needs the file imported into a permanent library. Which approach best addresses the row-scanning and output requirements while avoiding an incorrect assumption that PROC IMPORT will infer the identifier as character?

Correct Answer: B. Use PROC IMPORT with OUT= pointing to the permanent data set, DBMS=CSV, REPLACE, and GUESSINGROWS=MAX; then verify the identifier type and use an explicit import definition if leading zeros must be preserved.
Explanation:

For a delimited source, DBMS=CSV and OUT= identify the import format and destination, while REPLACE permits an existing output data set to be overwritten. GUESSINGROWS=MAX makes PROC IMPORT examine all available rows when inferring attributes, reducing the risk that early short values determine an inadequate length. Type inference is not a guarantee that a digit-only identifier will retain leading zeros; verify the resulting type and use an explicit, controlled import method when that representation is essential. GUESSINGROWS=1 does the opposite, and DBMS=XLSX is for Excel workbooks.

Question 2

New Single answer

Topic: Access and Create Data Structures

Skill tested: Read an Excel worksheet through the SAS/ACCESS XLSX engine and select its member.

A finance analyst must read a worksheet from an .xlsx workbook directly, without converting it to a delimited file. The workbook contains sheets named Transactions and Reference, and only Transactions is needed. The analyst wants SAS to treat the workbook as a library and then create a SAS data set in WORK. Which implementation is appropriate?

Correct Answer: C. Assign a XLSX engine libref to the workbook, then use a DATA step with SET naming the Transactions member.
Explanation:

The SAS/ACCESS XLSX engine allows an Excel workbook to be referenced as a library. After assigning a libref to the workbook, worksheet members can be referenced as data sets, so a DATA step using SET can copy the Transactions member into WORK. A BASE engine expects a SAS library, not an Excel workbook. A workbook pathname is not itself a SAS data set name, and PROC IMPORT does not use DBMS=BASE to select a worksheet.

Question 3

New Multiple answers

Topic: Access and Create Data Structures

Skill tested: Combine sorted SAS data sets using one-to-many BY-group matching.

A claims system provides one observation per policy in POLICY and multiple observations per policy in CLAIM. Both data sets are sorted by POLICY_ID. An analyst needs one output observation for each claim, carrying the matching policy attributes onto every claim. Policy IDs are unique in POLICY, while CLAIM may contain several observations with the same ID. Select the two statements that correctly implement this one-to-many match-merge and preserve all claim rows that have a matching policy.

Correct Answer: B. Use MERGE POLICY CLAIM in a DATA step with a BY POLICY_ID statement.; E. Sort both input data sets by POLICY_ID before the match-merge.
Explanation:

A match-merge uses MERGE with a BY statement, and the inputs must be ordered by the BY variable (or otherwise satisfy SAS BY-group processing requirements). With one unique policy row and multiple claim rows per ID, SAS retains the policy values within the BY group and combines them with the claim observations, producing one row per claim. SET concatenates observations rather than matching them. PROC APPEND also adds rows, and MERGE without BY performs a positional match rather than a key-based match.

Question 4

New Single answer

Topic: Access and Create Data Structures

Skill tested: Investigate library members and attributes with PROC CONTENTS.

A data stewardship analyst receives a SAS library reference from another team and must determine which data sets it contains, along with variable names, types, lengths, and formats. The analyst must inspect the library programmatically and produce a report data set for later review; no observations from the source tables should be modified. Which approach is most appropriate?

Correct Answer: B. Run PROC CONTENTS with DATA= set to the library reference and OUT= naming a report data set.
Explanation:

PROC CONTENTS is the Base SAS utility procedure designed to report data set and variable attributes. Its DATA= option can identify a library, and OUT= can create a SAS data set containing metadata suitable for programmatic review. PROC PRINT lists observations, not library metadata, and its OUT= option does not create a metadata table. PROC SORT orders observations and does not inventory library members. SET requires a data set member rather than a bare library reference and reads observations rather than attributes.

Question 5

New Single answer

Topic: Access and Create Data Structures

Skill tested: Use SAS date constants and formats to create and display date values correctly.

A payroll extract includes an employee start date stored as a numeric SAS date value. The analyst must create a constant cutoff date representing January 1, 2025, and flag employees whose start date is on or after that date. The output should display the cutoff date in a readable date format while retaining correct date arithmetic. Which DATA step approach is correct?

Correct Answer: B. Assign cutoff='01JAN2025'd, apply a date format to cutoff, and compare start_date >= cutoff.
Explanation:

The SAS date literal '01JAN2025'd creates the numeric day count used for SAS date arithmetic. Applying a date format changes how that numeric value is displayed, not its underlying representation, so a numeric comparison with start_date is valid. A quoted string without the d suffix is character data, while 20250101 is merely a numeric value and not the SAS date count for that calendar day. Converting dates to formatted character strings is unnecessary and can lead to unreliable comparisons.

Question 6

New Single answer

Topic: Manage Data

Skill tested: Use PROC SORT OUT= and NODUPKEY to retain unique BY-key observations.

A customer master extract contains several rows for each CUSTOMER_ID because updates were appended during the day. The business rule is to retain one row per customer, using the row with the latest UPDATE_DATE. The source must remain unchanged because another process reads it concurrently. Which procedure approach best meets the requirement?

Correct Answer: D. Sort by CUSTOMER_ID UPDATE_DATE with OUT= a new data set and DESCENDING applied to UPDATE_DATE, using NODUPKEY.
Explanation:

Sorting by CUSTOMER_ID groups each customer's observations, and descending UPDATE_DATE places the latest row first within each group. NODUPKEY then keeps the first observation for each BY-key combination. OUT= directs the sorted, deduplicated result to a separate data set, preserving the source. Sorting by date first does not group duplicate customer IDs together. NODUPRECS removes identical adjacent observations rather than all observations sharing a key, and a sort without OUT= can replace the input data set.

Question 7

New Multiple answers

Topic: Manage Data

Skill tested: Apply conditional DATA step logic and DO groups to assign categorized values.

A service center assigns each case a priority from two numeric inputs: DAYS_OPEN and SEVERITY, where severity is 1, 2, or 3. Rules are evaluated in order: severity 3 is always urgent; otherwise a case open at least 10 days is urgent; all remaining cases are standard. For urgent cases, the output must also set ESCALATE='Y'; standard cases must have ESCALATE='N'. Select the two code patterns that implement these rules correctly for every input combination.

Correct Answer: B. IF SEVERITY=3 OR DAYS_OPEN>=10 THEN DO; PRIORITY='Urgent'; ESCALATE='Y'; END; ELSE DO; PRIORITY='Standard'; ESCALATE='N'; END;; E. IF SEVERITY=3 THEN DO; PRIORITY='Urgent'; ESCALATE='Y'; END; ELSE IF DAYS_OPEN>=10 THEN DO; PRIORITY='Urgent'; ESCALATE='Y'; END; ELSE DO; PRIORITY='Standard'; ESCALATE='N'; END;
Explanation:

Both A and C implement the logical condition that either severity 3 or at least 10 open days makes a case urgent, and each assigns both output variables in every branch. The DO/END groups ensure multiple statements belong to the intended conditional branches. B has an ELSE associated with the second IF, so a severity-3 case with fewer than 10 days can be overwritten as Standard. D leaves ESCALATE missing for urgent cases, while E incorrectly requires both conditions to be true.

Question 8

New Single answer

Topic: Manage Data

Skill tested: Use RENAME=, LENGTH, LABEL, and FORMAT to control DATA step attributes.

A monthly data set contains a numeric variable AMT in dollars. The analyst must create an output data set with the variable renamed REVENUE, a descriptive label, and a currency display with two decimal places. The analyst also creates a character variable STATUS that can contain up to 12 characters. Which approach correctly handles the variable attributes without changing the numeric value of the amount?

Correct Answer: A. Use the RENAME= data set option to rename AMT to REVENUE, define LENGTH STATUS $12 before assignment, and apply a LABEL and DOLLAR format to REVENUE.
Explanation:

RENAME= changes a variable's name without altering its stored value. LENGTH STATUS $12 declares a character variable capable of holding 12 characters and should precede assignments that might otherwise establish a shorter length. LABEL supplies descriptive metadata, while a DOLLAR format controls numeric display; neither changes the underlying numeric amount. FORMAT does not rename variables or define storage length, and converting AMT to character would undermine numeric calculations.

Question 9

New Single answer

Topic: Manage Data

Skill tested: Select and order observations with a PROC PRINT WHERE clause and VAR statement.

A compliance analyst needs a listing of transactions from the West region with amounts greater than 5,000. The report must show TRANSACTION_ID first, followed by CUSTOMER_ID and AMOUNT, and must omit the default observation number. The source data set must not be altered or filtered permanently. Which PROC PRINT design meets all requirements?

Correct Answer: C. Use PROC PRINT with DATA=source NOOBS, a WHERE statement for REGION='West' and AMOUNT>5000, and a VAR statement listing TRANSACTION_ID CUSTOMER_ID AMOUNT.
Explanation:

PROC PRINT's WHERE statement selects observations for the report without changing the source data, and VAR selects and orders the displayed variables. NOOBS suppresses the default observation number. A BY statement groups or processes data by a variable; it does not filter to one value. A permanent filtered copy is unnecessary and risks creating an unwanted altered data set. PROC SORT is not required for a WHERE condition to select observations.

Question 10

New Single answer

Topic: Manage Data

Skill tested: Create multilevel summary statistics with PROC MEANS CLASS, WAYS, and OUTPUT.

A sales analyst needs mean SALES for each REGION and for each REGION-by-CHANNEL combination, but does not want an overall total or channel-only summaries. The output must be a SAS data set containing the summary rows and mean statistic for downstream processing. Which PROC MEANS design best satisfies these requirements?

Correct Answer: C. Use CLASS REGION CHANNEL, WAYS 1 2, VAR SALES, and OUTPUT OUT=summary MEAN=MeanSales.
Explanation:

With two CLASS variables, WAYS 1 requests the one-variable class summaries and WAYS 2 requests the two-variable combination. Together they produce REGION and REGION-by-CHANNEL summaries without the zero-way overall summary or channel-only group. OUTPUT OUT= writes the requested statistic to a SAS data set. WAYS 0 1 includes the overall summary but omits the two-way groups; WAYS 2 alone omits the region-only summary. BY processing requires appropriately sorted data and would produce different grouping behavior.

Question 11

New Single answer

Topic: Manage Data

Skill tested: Use PROC FREQ ordering and level counts to validate categorical data.

A data-quality analyst is reviewing a categorical variable STATUS. The validation report must show the number of distinct nonmissing status levels and frequency rows ordered by descending count, rather than by formatted value. The analyst also needs to identify missing values in the same review. Which PROC FREQ configuration is most appropriate?

Correct Answer: C. Use TABLES STATUS / MISSING; specify ORDER=FREQ on the PROC FREQ statement and request NLEVELS.
Explanation:

PROC FREQ's ORDER=FREQ option orders table levels by descending frequency, while NLEVELS requests a count of distinct levels. The MISSING table option includes missing values as a displayed level, which is necessary for the requested data-quality review. ORDER=DATA follows first-seen order, not frequency. NLEVELS is a PROC FREQ option, not a PROC PRINT option, and omitting MISSING excludes missing values from the frequency table.

Question 12

New Multiple answers

Topic: Error Handling

Skill tested: Diagnose DATA step logic with conditional PUTLOG output and automatic variables.

A DATA step is intended to retain records with AMOUNT greater than zero, but a test run produces too many output rows. The developer suspects that a condition is being evaluated differently than intended and needs diagnostic evidence without changing the business output. The step has an input data set and uses an OUTPUT statement. Select the two debugging actions that provide useful evidence while preserving the existing output decision logic.

Correct Answer: A. Use PUTLOG _ALL_ for selected records to display current DATA step variable values in the SAS log.; C. Add a conditional PUTLOG statement that writes the relevant input values and the condition result for records near the threshold.
Explanation:

A conditional PUTLOG can report the values involved in the suspected comparison only for relevant records, and PUTLOG _ALL_ can display the current values of DATA step variables for broader diagnosis. Both add log evidence without changing the filter's business logic. _ERROR_ indicates whether an error condition occurred during processing; setting it does not control output selection. _N_ is an automatic iteration counter and is not a mechanism for changing which input observations are read or output.

Question 13

New Single answer

Topic: Error Handling

Skill tested: Locate syntax errors in SAS logs, including missing statement terminators.

A program should create WORK.HIGHVALUE from WORK.SALES, keeping observations with AMOUNT above 1000. The log reports an error near the DATA statement and then shows later statements being interpreted unexpectedly. The submitted code is: DATA work.highvalue; SET work.sales IF amount > 1000; RUN; Which correction addresses the primary syntax defect while preserving the intended filtering behavior?

Correct Answer: C. Terminate the SET statement with a semicolon, then use a subsetting IF statement before RUN.
Explanation:

Each SAS statement must be terminated with a semicolon. The SET statement is missing its terminator, so SAS can parse the following IF as part of an invalid statement and generate cascading diagnostics. Writing SET work.sales; followed by IF amount > 1000; makes the IF a subsetting IF, so only qualifying observations continue through the DATA step. RUN correctly terminates the DATA step. QUIT is not required, and DATA step comparisons support greater-than operators.