Exam Information
Free practice questions with explanations
SAS A00-215 Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 16
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice Explore SAS Data Sets
A junior analyst receives a SAS data set named sales_2023 stored in the library RAWDATA. The analyst must confirm the number of observations, the variable order, and the variable attributes such as length and format, without reading any data rows. Which statement accomplishes this with the least output and no data processing?
A. PROC PRINT DATA=rawdata.sales_2023 (OBS=0);
B. PROC CONTENTS DATA=rawdata.sales_2023;
C. PROC MEANS DATA=rawdata.sales_2023 N;
D. PROC FREQ DATA=rawdata.sales_2023 NLEVELS;Correct Answer: AExplanationPROC CONTENTS reads only the descriptor portion of the data set, which holds the observation count, variable names, types, lengths, and formats, so it answers the analyst's question without touching the data values. PROC PRINT with OBS=0 prints only headers and no structural attributes, PROC MEANS requires reading values to compute statistics, and PROC FREQ with NLEVELS counts distinct values rather than reporting descriptor attributes.
-
2 Question 2 Single choice Explore SAS Data Sets
A team stores a SAS data set in a library called CLAIMS. A programmer runs a DATA step that creates a new data set from CLAIMS.POLICY, but the downstream process requires only the variables POLICY_ID and PREMIUM, and the policy identifier must be renamed to ID in the output while the source data set remains unchanged. Which data set option specification correctly meets all three requirements in the SET statement?
A. set claims.policy (keep=policy_id premium rename=(policy_id=id));
B. set claims.policy (rename=(policy_id=id) drop=policy_id premium);
C. set claims.policy (drop=policy_id premium rename=(policy_id=id));
D. set claims.policy (keep=premium rename=(id=policy_id));Correct Answer: BExplanationKEEP= limits the input to POLICY_ID and PREMIUM, and RENAME= applies to the input variable so that POLICY_ID becomes ID in the output, which is valid because the renamed variable is among those kept. Specifying DROP= for the same variable that RENAME= references on the same data set would remove POLICY_ID before the rename can take effect. The option that keeps only PREMIUM drops POLICY_ID entirely and then tries to rename a variable that no longer exists, and the rename written in reverse direction references the wrong name.
-
3 Question 3 Single choice Fundamental SAS Concepts
A programmer submits a program in batch mode and the SAS log reports the following message for a DATA step: 'ERROR: Expecting an arithmetic operator.' The program runs to completion with the message 'NOTE: The data set WORK.SUMMARY has 0 observations and 3 variables.' The programmer's business rule was that the output should contain all customer records. The expression in the step is totals = sales + tax total; where the programmer forgot an operator. Which description best characterizes the problem and the appropriate first corrective action?
A. A logic error caused by a wrong RETAIN statement; add a RETAIN statement for totals.
B. A syntax error caused by an invalid expression; correct the assignment statement so the operands are joined by a valid operator, then resubmit.
C. A logic error caused by a missing BY statement; add a BY statement to the DATA step.
D. A syntax error caused by an unclosed quotation; add a closing quote to the character constant.Correct Answer: AExplanationThe message 'Expecting an arithmetic operator' is a syntax error flagged at compile time, which is why the step produced zero observations rather than the intended records. Repairing the expression so that the operands are joined by a valid operator such as a plus sign and then resubmitting fixes the compilation failure. RETAIN and BY statements do not address a compile-time expression error, and an unclosed quotation would produce a different message about a missing quotation mark.
-
4 Question 4 Single choice Generate Reports Using PROC Steps
A regional manager needs a summary report of the mean and maximum order amounts grouped by sales region from a data set named WORK.ORDERS, where the region variable is character. The report must be sorted by region and must not include a row for each individual order. Which program meets these requirements with the fewest steps?
A. proc means data=work.orders mean max; var amount; class region; run;
B. proc print data=work.orders; var region amount; by region; run;
C. proc freq data=work.orders; tables region*amount; run;
D. proc means data=work.orders mean max noprint; var amount; output out=stats; run;Correct Answer: BExplanationPROC MEANS with a CLASS statement produces a summary row per region, computing the requested MEAN and MAX of the analysis variable without printing each order. Using the PROC PRINT approach with BY would list every detail row, which violates the summary requirement. PROC FREQ with a cross-tabulation of a continuous amount produces counts rather than means and maxima, and the NOPRINT option with an OUTPUT data set suppresses the very report the manager needs to see.
-
5 Question 5 Dropdown Generate Reports Using PROC Steps
A programmer must produce a one-way frequency report of the variable Department from WORK.STAFF that includes missing values as their own category and sorts the table by descending frequency count. The completed statements are written as follows: run; Which pair of values completes the program correctly? Choose the correct value for each blank.
Choose the correct value for each blank.
proc freq data=work.staff ;
tables department / ;
A. order=freq; missing
B. order=data; nocum
C. order=freq; missprint
D. nlevels; crosslistCorrect Answer:proc freq data=work.staff order=freq;
tables department / missing;
A. order=freq order=freq; missing missing
B. order=freq order=data; missing nocum
C. order=freq order=freq; missing missprint
D. order=freq nlevels; missing crosslistExplanationORDER=FREQ on the PROC FREQ statement sorts the one-way table by descending frequency, and the MISSING option on the TABLES statement treats missing values as a valid level. MISSPRINT is a real option, but it only suppresses or displays missing counts in the printed table without counting them as a category, which does not meet the stated treatment. ORDER=DATA keeps the original order rather than sorting by frequency, and NLEVELS is a PROC FREQ option that reports level counts rather than controlling sorting or missing values.
-
6 Question 6 Single choice Import and Export non-SAS files
A financial analytics team receives a daily comma-separated file named transactions.csv from a vendor. The file has a header row containing variable names with spaces, and the date column is formatted as yyyy-mm-dd text. The team wants a permanent SAS data set created in one step with the variable names unchanged in the header read, and the date column read as a character value to be converted later. Which PROC IMPORT specification meets these requirements?
A. proc import datafile='/data/transactions.csv' out=work.trans dbms=csv replace; getnames=yes; guessingrows=all; run;
B. proc import datafile='/data/transactions.csv' out=work.trans dbms=csv replace; getnames=yes; datarow=2; run;
C. proc import datafile='/data/transactions.csv' out=work.trans dbms=xlsx replace; getnames=yes; run;
D. proc import datafile='/data/transactions.csv' out=work.trans dbms=csv replace; getnames=no; run;Correct Answer: AExplanationUsing DBMS=CSV with GETNAMES=YES reads the header row as variable names, and DATAROW=2 starts data reading after that header so the first data record is not misinterpreted. The statement with GUESSINGROWS=ALL affects type detection rather than the header handling the team needs, and it does not specify the data start row. The XLSX DBMS value is wrong for a comma-separated text file, and GETNAMES=NO would discard the header and treat it as data.
-
7 Question 7 Multiple choice Import and Export non-SAS files
A pharmacy analyst must write the PROC FREQ and PROC MEANS output from an analysis program into a single Excel workbook named summary.xlsx, with each report on its own worksheet, using the XLSX engine through a LIBNAME statement. Which TWO actions together meet these requirements? (Choose two.)
A. Assign a library with LIBNAME out XLSX '/reports/summary.xlsx'; and direct each report using ODS EXCEL with SHEET_INTERVAL set to a value that creates a new sheet per procedure.
B. Assign a library with LIBNAME out XLSX '/reports/summary.xlsx'; and write each report with PROC EXPORT to the same member name in that library.
C. Use ODS HTML with FILE='/reports/summary.html' and rename the resulting file to summary.xlsx after the run.
D. Use ODS EXCEL FILE='/reports/summary.xlsx' with OPTIONS (SHEET_NAME='freq') before PROC FREQ, and SHEET_NAME='means' before PROC MEANS, closing the destination after the final procedure.
E. Use PROC PRINTTO with a log file set to '/reports/summary.xlsx' to capture both reports in one workbook.Correct Answer: B, EExplanationODS EXCEL can place each procedure's output on its own worksheet, either through SHEET_INTERVAL set to PROC so that a new sheet is started for each procedure, or through explicit sheet naming, and both choices correctly send all output to one workbook file. Writing the same member name with PROC EXPORT would overwrite rather than add sheets, renaming an HTML file does not produce a valid workbook, and PROC PRINTTO directs the log or listing output and cannot generate worksheets.
-
8 Question 8 Order list Import and Export non-SAS files
A data steward must deliver a monthly claims extract to an external partner as an Excel workbook with the summary table on a separate sheet from the detail listing. The steps below are required, but they are listed out of order. A. 2, 1, 4, 3 B. 1, 2, 4, 3 C. 2, 4, 1, 3 D. 4, 2, 1, 3 Drag the steps into the correct order.
Drag the steps into the correct order, or use the arrows.
- Close the ODS EXCEL destination so the workbook is written.
- Submit PROC MEANS for the summary table directed to the open destination.
- Open the ODS EXCEL destination with the target workbook file name.
- Submit PROC PRINT for the detail listing directed to the open destination.
Correct Answer:- Open the ODS EXCEL destination with the target workbook file name.
- Submit PROC PRINT for the detail listing directed to the open destination.
- Submit PROC MEANS for the summary table directed to the open destination.
- Close the ODS EXCEL destination so the workbook is written.
ExplanationThe ODS EXCEL destination must be opened first so that subsequent procedures have a destination to write to, which is why step 2 leads. The detail listing is produced before the summary table in this delivery plan, so PROC PRINT precedes PROC MEANS, and the destination is closed last to finalise the workbook. Running PROC MEANS before the destination is opened, or closing the destination before any output is produced, leaves nothing written to the file.
-
9 Question 9 Single choice Use Utility Procedures
A data curator is preparing a permanent data set and a reporting step. Match each requirement to the utility procedure that fulfils it.
1. Arrange the observations so that all rows for each customer ID are adjacent before a BY-group analysis
2. Create a user-defined mapping so that the code 1 displays as Active and the code 0 displays as Inactive in reports
3. Remove duplicate observations that share the same account number, keeping the first occurrence
Which mapping is correct?
A. 1 - PROC SORT; 2 - PROC FORMAT; 3 - PROC SORT with NODUPKEY
B. 1 - PROC FORMAT; 2 - PROC SORT; 3 - PROC SORT with NODUPKEY
C. 1 - PROC SORT; 2 - PROC FORMAT; 3 - PROC FORMAT
D. 1 - PROC SORT with NODUPKEY; 2 - PROC FORMAT; 3 - PROC SORTCorrect Answer: BExplanationPROC SORT arranges observations by the BY variables so that BY-group processing sees contiguous groups, and adding NODUPKEY removes duplicates on the key while keeping the first occurrence in the sorted order. PROC FORMAT is the procedure that defines custom value labels such as Active and Inactive. Assigning the sort to PROC FORMAT or the mapping to PROC SORT misapplies the procedures, and using NODUPKEY for the grouping requirement removes rows that the analysis needs to keep.
-
10 Question 10 Single choice Using the DATA Step to Access SAS Data Sets
A programmer writes a DATA step that reads two SAS data sets, WORK.ADMISSIONS and WORK.DISCHARGES, each sorted by PATIENT_ID, and must produce a single output data set containing only patients present in both sets, with variables from both. Which MERGE statement and subsetting logic meet this requirement?
A. merge admissions(in=a) discharges(in=b); by patient_id; if a and b;
B. merge admissions discharges; by patient_id; if first.patient_id;
C. set admissions discharges; by patient_id; if a;
D. merge admissions discharges; if a or b;Correct Answer: DExplanationA MERGE with BY on PATIENT_ID combined with IN= flags for each input and a subsetting IF requiring both flags performs an inner match, returning only patients present in both sets. Using FIRST. on the key keeps only one row per patient rather than restricting to matches across both inputs. SET concatenates rows and does not match by key, and omitting the BY statement with a logical OR returns the union rather than the intersection.
-
11 Question 11 Dropdown Using the DATA Step to Access SAS Data Sets
A programmer writes the following DATA step, in which the input data set contains a variable named PREMIUM that is missing for some records: data work.checked; set work.policies; flag = 0; run; Which pair of values completes the step so that records with a missing PREMIUM are excluded from the flag equal to 1, and every other record receives flag 0 when the condition is not met? Choose the correct value for each blank.
Choose the correct value for each blank.
(premium > 0) then flag = 1;
A. if; else
B. when; otherwise
C. select; else
D. if; otherwiseCorrect Answer:if (premium > 0) then flag = 1;
else
A. if if; else else
B. if when; else otherwise
C. if select; else else
D. if if; else otherwiseExplanationThe IF-THEN construction with ELSE is the valid conditional structure inside a DATA step, and the comparison premium > 0 evaluates to false for a missing value in SAS, so missing records fall through to the ELSE branch and receive flag 0. OTHERWISE belongs to SELECT groups, not to IF statements, so pairing IF with OTHERWISE is a syntax error. WHEN and SELECT are only valid inside a SELECT group and would not form a conditional on their own here.
-
12 Question 12 Single choice Using the DATA Step to Manipulate Data
A risk analyst computes a cumulative exposure total for each account in WORK.EXPOSURE, which is sorted by ACCOUNT and then by MONTH. The total must restart at zero for each new account and must be written into every observation. Which DATA step correctly creates the accumulating variable?
A. data work.cum; set work.exposure; by account; if first.account then total=0; total+amount; run;
B. data work.cum; set work.exposure; by account; total+amount; if last.account then total=0; run;
C. data work.cum; set work.exposure; by account; total=total+amount; run;
D. data work.cum; set work.exposure; by account; retain total; total=sum(total,amount); if first.account then total=0; run;Correct Answer: DExplanationThe sum statement total+amount accumulates automatically, retains its value across iterations, and ignores missing amounts, while the FIRST.ACCOUNT check resets it before the addition for each new account. Resetting on LAST.ACCOUNT clears the total only after the account's final row, which carries the wrong value into the next account's first row. The assignment total=total+amount without a reset does not restart per account, and resetting after summing in the last option discards the value for the first row of each group.
-
13 Question 13 Multiple choice Using the DATA Step to Manipulate Data
A health-services programmer must create a data set of weekly readings from WORK.READINGS, where each observation contains a patient identifier and a daily reading score in variables SCORE1 through SCORE7. The output must contain one observation per patient per day, with the day number in a variable named DAY and the score in a variable named SCORE. Which TWO approaches together achieve this with an iterative DO loop? (Choose two.)
A. Use an iterative DO loop from 1 to 7 that assigns SCORE from an array element indexed by the loop counter and writes the record with OUTPUT.
B. Use a DO WHILE loop that tests for the end of the data set and appends each record to a second data set.
C. Declare an array over SCORE1-SCORE7, loop with do day=1 to 7, assign score=scores(day), and call output inside the loop.
D. Create seven separate DATA steps, one per day, each with a fixed SCORE assignment and a SET of the original data.
E. Use a DO UNTIL loop that reads SCORE1 and writes one observation, then stops after the first patient.Correct Answer: A, DExplanationAn iterative DO loop from 1 to 7 indexes the score variables, and calling OUTPUT inside the loop writes one observation per day for every patient, producing the required long layout. Both A and C correctly use this idea, A through an array index and C with an explicit array declaration. A DO WHILE loop controlling the end of file does not generate the seven daily rows, separate DATA steps are a clumsy and unnecessary workaround, and a DO UNTIL that stops after the first patient discards the rest of the data.
-
14 Question 14 Single choice Explore SAS Data Sets
A data engineer must create a permanent SAS library in a shared folder so that the project team can read the data sets, and the library must be available to any new SAS session at startup without being reassigned. Which approach meets this requirement with the least administrative effort?
A. Add a LIBNAME statement to the autoexec file in the user's home directory and restart the session.
B. Add a LIBNAME statement to the program using a global assignment, and submit it at the top of every project program.
C. Assign the library with a TEMP option on the LIBNAME statement so that it is available to the entire session.
D. Assign the library in the WORK location, which is reset at the start of each session, and copy the data sets to it on demand.Correct Answer: DExplanationAn autoexec file executes its statements automatically when SAS starts, so a LIBNAME placed there makes the shared library available in every new session with no manual step. Submitting the assignment in each program adds repeated work and still requires the user to run it, while a TEMP option is not a real LIBNAME option and would not persist. The WORK library is deleted at the end of each session, so it cannot provide a shared permanent location.
-
15 Question 15 Order list Fundamental SAS Concepts
A junior programmer has a DATA step that fails and the log shows a syntax error on an unbalanced parenthesis, while the rest of the step is correct. The steps below describe how to diagnose and fix the problem in the correct sequence. A. 2, 4, 3, 1 B. 4, 2, 3, 1 C. 3, 2, 4, 1 D. 2, 3, 4, 1 Drag the steps into the correct order.
Drag the steps into the correct order, or use the arrows.
- Locate the statement that contains the flagged position and review its parentheses.
- Correct the parenthesis so that every opening parenthesis has a matching closing parenthesis.
- Resubmit the corrected program and confirm the log shows no errors or warnings.
- Read the error message and the line and column location reported in the SAS log.
Correct Answer:- Read the error message and the line and column location reported in the SAS log.
- Locate the statement that contains the flagged position and review its parentheses.
- Correct the parenthesis so that every opening parenthesis has a matching closing parenthesis.
- Resubmit the corrected program and confirm the log shows no errors or warnings.
ExplanationThe log's error message and flagged line and column are read first to locate the problem, then the statement containing that position is examined, the parenthesis is corrected, and the program is resubmitted to confirm the log is clean. Attempting a correction before locating the flagged statement risks editing the wrong part of the code, and a fix before reading the message has no basis. Confirming the result with a fresh submission comes last, so the log check cannot be skipped.
-
16 Question 16 Single choice Fundamental SAS Concepts
A programmer writes a program that runs without any error message, but the summary report it produces shows the average of ages as zero for every group, even though the input data contains valid positive ages. The DATA step assigns the mean with the expression avg_age = age / n_records, where n_records is never initialised and is therefore missing in the step. Which classification and corrective action best fits this situation?
A. A syntax error; correct the division operator to a valid arithmetic operator and resubmit.
B. A logic error; initialise and accumulate the record count before computing the average so the divisor is valid.
C. A syntax error; add a global OPTIONS statement to suppress the missing-value note.
D. A logic error; replace the DATA step with PROC SQL because DATA steps cannot compute averages.Correct Answer: CExplanationBecause the statement is valid code that runs without a compile error, the problem is a logic error rather than a syntax error, and the divisor being missing makes the result missing or incorrect in the output. Initialising and accumulating the record count, for example with a sum statement or a retained counter, gives the average a valid divisor. Suppressing notes hides evidence rather than fixing the computation, and DATA steps can calculate averages perfectly well.
These are 16 of the 78 questions in the full A00-215 pack.
Get All 78 QuestionsGet all 78 questions & answers
Full access options for SAS A00-215
Self-study
PDF Version
- 78 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
- 78 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
- 78 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-215 Exam (SAS 9.4 Programming Fundamentals 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.