Exam Information
Free practice questions with explanations
SAS A00-231 Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 11
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice Access and Create Data Structures
A data analyst receives a quarterly sales workbook named sales_q3.xlsx. The first worksheet, named Orders, has a header row in row 1 and data beginning in row 2. Several columns contain a mix of numeric codes and text values, and the first 20 rows of the Customer_ID column are all numeric while later rows contain alphanumeric IDs such as C10452X. The analyst runs PROC IMPORT with DBMS=XLSX and no other options, and the resulting character column truncates the IDs or converts them incorrectly to numeric. The company forbids editing the source file and requires that the import remain reproducible in a scheduled batch job. Which change to the PROC IMPORT step is the BEST way to correct the type detection?
Correct Answer: AExplanationThe GUESSINGROWS statement controls how many rows PROC IMPORT scans to determine variable types and lengths; setting it to MAX scans all rows, so mixed numeric and alphanumeric IDs are typed correctly as character, which is required for reproducible batch use without editing the source. Option B is wrong because GUESSINGROWS is not restricted to CSV and the statement is applied to the workbook import. Option C is wrong because DBMS=EXCEL with REPLACE only controls overwriting and does not change type detection rules. Option D is wrong because DELIMITER is meaningful for delimited text files, not for reading an xlsx workbook with its native structure.
-
2 Question 2 Single choice Access and Create Data Structures
A team stores monthly claims in a permanent library assigned with LIBNAME CLAIMS '/data/claims'. A DATA step builds a summary data set named CLAIMS.summary_q1 by reading CLAIMS.claims_jan through CLAIMS.claims_mar. A junior analyst later wants a quick inventory of every member of the library, including the number of observations and variables in each, without opening each data set manually. The inventory must be produced inside the same batch program so the output can be compared with last month's run. Which approach BEST meets the requirement?
Correct Answer: BExplanationPROC CONTENTS with DATA=libref._ALL_ inventories all members of a library, and the SHORT option produces a compact listing that includes the number of observations and variables per member, suitable for comparison across runs when captured to a data set. Option A is wrong because NODETAILS suppresses the variable-level detail but the statement as given does not provide a compact per-member count as cleanly as SHORT in this context and it is not the best answer. Option C is wrong because PROC DATASETS CONTENTS is not the programmatic way to capture the inventory into output for comparison and it reports only to the output window. Option D is wrong because SASHELP.VMEMBER is a view of metadata that is not filtered by library assignment in this way and the approach is indirect and error prone.
-
3 Question 3 Single choice Error Handling
A DATA step in a nightly program computes an adjusted premium for each policy. Some rows produce a premium of zero even though the source premium is positive. The developer adds a PUTLOG statement inside an IF condition to find the offending rows but the log is flooded with messages because the condition is true for most observations. The developer must find only the first few problem rows, see the policy number, the raw premium, and the factor value, and must not change the output data set. Which change BEST achieves this?
Correct Answer: AExplanationCombining the automatic counter N with a conditional test limits the PUTLOG output to the first few offending observations, and PUTLOG can write the values of the policy number, premium and factor, which preserves the output data set. Option B is wrong because ERROR is set by data errors and does not model a logic condition on zero premiums, so it would miss these rows. Option C is wrong because PUT to the log without conditional control still floods the log and PUTLOG is the intended debugging statement. Option D is wrong because DELETE alters the output data set, violating the requirement.
-
4 Question 4 Single choice Error Handling
A program fails at compile time in the SAS log with the message reporting a missing semicolon. The developer reviews the following fragment: a PROC MEANS step sets an option with the statement VAR income expense and then a separate CLASS region statement, but the log points to the line containing the OUTPUT statement and says a statement is not valid. The developer must diagnose the failing syntax using only the log, and the program must run in a scheduled environment where the code cannot be interactively edited before rerun. Which action is the MOST appropriate first step?
Correct Answer: AExplanationSAS parses statements until it encounters a boundary, so a missing semicolon is typically reported at the next statement, and the defect lies in the lines immediately before the flagged position; reading the log upward is the correct diagnostic practice. Option B is wrong because the flagged line is often not the defective line. Option C is wrong because OUTPUT is a valid PROC MEANS statement and removing it changes the results. Option D is wrong because NOSYNTAXCHECK is not a valid debugging approach for this scenario and would not diagnose the defect.
-
5 Question 5 Single choice Generate Reports and Output
A regional manager needs a printed list of active customer accounts from a data set named WORK.accounts. The list must show the account number as the row identifier, the customer name and balance only, a running total of balances at the bottom, and suppress the default observation numbers. Only accounts with status Active should appear, and the report is grouped by region with each region starting on a new page. The manager specifically asks that the report not include a column for region because the grouping header already shows it. Which PROC PRINT code meets all of these requirements?
Correct Answer: AExplanationThe WHERE statement filters to active accounts, NOOBS suppresses observation numbers, ID account identifies rows, VAR selects name and balance, BY region produces grouped headers, and SUM balance totals the column. Option B is wrong because VAR account would print the account as a column instead of an identifier and the list would not meet the ID requirement. Option C is wrong because BY must precede VAR-related processing in the correct order and it omits NOOBS, so the observation numbers still appear. Option D is wrong because NOTSORTED is inappropriate when the data are not guaranteed to be sorted by region and the requirement does not call for it, while BY without NOTSORTED requires sorted input.
-
6 Question 6 Single choice Generate Reports and Output
A quality analyst wants to check whether a data set named WORK.visits contains missing or unexpected values before running a summary. She runs PROC FREQ on the variables visit_type and clinic, but the output for clinic lists a large number of distinct levels and the table is truncated in the report. Her manager asks her to show how many distinct levels exist for clinic without printing the full table, and to list the levels with counts in order of descending frequency so that unexpected codes appear first. The output must go to a single table without changing the source data. Which set of options achieves this?
Correct Answer: AExplanationThe NLEVELS option on PROC FREQ reports the number of distinct levels, while ORDER=FREQ on the TABLES statement sorts levels by descending frequency, meeting both requirements without altering data. Option B is wrong because ORDER=FREQ alone does not report the count of levels. Option C is wrong because ORDER=DATA keeps the order of appearance and does not sort by frequency. Option D is wrong because PROC MEANS does not produce frequency tables of levels and cannot satisfy the requirement.
-
7 Question 7 Single choice Manage Data
A retail company stores transaction records in WORK.sales, which contains duplicate rows created by a faulty extract. The data set must be sorted by store_id and then by sale_date in ascending order, and only one observation should be kept for each combination of store_id, sale_date and receipt_no. The sorted result must be stored in a new permanent data set named CLEAN.sales_sorted, and the original WORK.sales must be left unchanged for audit. Which PROC SORT step meets all requirements?
Correct Answer: AExplanationNODUPKEY removes observations whose BY-variable values duplicate those of a previous observation, OUT= writes the result to a new data set leaving WORK.sales intact, and the BY list gives the required sort order and deduplication key. Option B is wrong because NODUP compares entire observations rather than the key variables, so it would not remove rows that match only on the keys. Option C is wrong because it sorts in place and overwrites WORK.sales, violating the audit requirement. Option D is wrong because DESCENDING applies to store_id, which reverses the required ascending order.
-
8 Question 8 Multiple choice Manage Data
A pharmacy analyst maintains a data set named WORK.doses with variables patient_id, dose_mg, and visit_date stored as a character value in the format 'dd-mmm-yyyy'. The DATA step must create a numeric SAS date variable named visit_dt, assign a constant cutoff date of 1 January 2024 to a variable named cutoff, flag patients with dose_mg greater than 100 as high using a conditional statement that also handles missing values safely, and rename dose_mg to dose_milligrams in the output while labelling it. Which TWO statements or code fragments are correct? (Choose two.)
Correct Answer: A, BExplanationThe date literal '01JAN2024'd assigns a constant SAS date to cutoff, and INPUT with the DATE9. informat converts the character visit_date into a numeric SAS date, both valid assignments. Option C is wrong because an ELSE cannot follow a semicolon after THEN, causing a syntax error. Option D is wrong because RENAME is not a statement in a DATA step with a label clause in this form and the label must be applied with a LABEL statement. Option E is wrong because FORMAT cannot be specified as a trailing modifier on an assignment statement.
-
9 Question 9 Multiple choice Access and Create Data Structures
A data analyst must create a one-to-many merged data set linking customers in WORK.customers, which holds one row per customer keyed by cust_id, with orders in WORK.orders, which holds multiple rows per customer keyed by cust_id. The output must keep every customer whether or not they have orders, and the merged result must be sorted by cust_id before the merge. The analyst's program must be reproducible without manual intervention. Which TWO steps are required to produce the correct merged output? (Choose two.)
Correct Answer: A, BExplanationA BY-group MERGE requires both inputs sorted by the BY variable, so sorting each input by cust_id is necessary, and a MERGE with BY cust_id produces the one-to-many join; keeping all customers is achieved by the default full merge with the IN= flags available for control. Option C is wrong because SET with BY concatenates the observations sequentially rather than merging them. Option D is wrong because NODUPKEY would discard the multiple orders needed for a one-to-many merge. Option E is wrong because a merge without BY combines by position, which is not a valid key-based merge.
-
10 Question 10 Single choice Manage Data
A utilities analyst processes meter readings in a DATA step with the following logic: readings above 500 kWh are labelled high, readings between 200 and 500 inclusive are labelled medium, and all other non-missing readings are labelled low, with missing readings labelled unknown. The analyst writes a sequence of IF statements with no ELSE clauses, and the results show that some readings above 500 are overwritten with medium. The data set must be reproducible in a nightly batch run and the logic should evaluate mutually exclusive categories with one assignment per observation. Which revision is the BEST correction?
Correct Answer: AExplanationIndependent IF statements without ELSE allow later true conditions to overwrite earlier assignments, while a chained IF-THEN/ELSE IF structure assigns exactly one category per observation; testing missing first and ordering the ranges correctly makes the categories mutually exclusive. Option B is wrong because reversing the order would still allow overwriting in the wrong direction and reduces correctness. Option C is wrong because PROC FORMAT defines display formats and does not assign values to observations in a DATA step. Option D is wrong because DO and END blocks do not prevent overwrites among independent IF statements.
-
11 Question 11 Single choice Error Handling
A DATA step reads a delimited text file and writes a summary data set. The step runs without an error message, but the output contains fewer observations than the input file. The developer adds PUTLOG statements to report the value of _ERROR_ and the observation count when each record is read, and inspects the log. The team must identify the first record that triggers a data error without stopping the job and without altering the output for successful records. Which temporary variable and statement combination provides the MOST direct evidence of the failing record?
Correct Answer: AExplanationThe automatic variable _ERROR_ is set to 1 when a data error occurs in the current iteration, so writing the observation counter and inputs conditionally on _ERROR_ = 1 identifies the failing record without halting the job. Option B is wrong because N is a counter and does not halt the step, and LENGTH does not produce that behaviour. Option C is wrong because the ERROR temporary variable is not used this way and PROC PRINT cannot list records after the fact in this manner. Option D is wrong because MSGLEVEL controls the amount of log messages but does not identify the specific failing record.
These are 11 of the 36 questions in the full A00-231 pack.
Get All 36 QuestionsGet all 36 questions & answers
Full access options for SAS A00-231
Self-study
PDF Version
- 36 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 36 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 36 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the A00-231 Exam (SAS 9.4 Base Programming - Performance-Based Exam) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.