OpenExamsFREE PRACTICE — ANY EXAM

Free SAS 9.4 Programming Fundamentals Exam Practice Questions

100 free questions · Answer explanations · No signup required

View examination details, outline and sources

Loading selected examination banks…

Sample Practice Questions

Try these 10 sample questions from the SAS 9.4 Programming Fundamentals Exam practice bank. Each includes the answer and explanation. Continue with the interactive practice above to review the full question set.

  1. 1Which description correctly distinguishes the usual roles of DATA steps and PROC steps in Base SAS?

    1. A. DATA steps format reports; PROC steps supply raw input records.
    2. B. DATA steps manipulate data; PROC steps analyze data and produce results.
    3. C. DATA steps define system options; PROC steps define variable values.
    4. D. DATA steps display statistics; PROC steps perform row-by-row assignments.

    Answer: B

    Explanation: The concepts manual states, "Generally, the DATA step manipulates data, and the PROC step analyzes data, produces output, or manages SAS files." This identifies their usual roles; it does not imply that every kind of output is exclusive to PROC steps.

    Reference: SAS 9.4 Language Reference: Concepts, Sixth Edition — Chapter 2, Definition of SAS Processing, p. 15

  2. 2With VALIDVARNAME=V7, which name is valid for a SAS variable?

    1. A. 2ndScore
    2. B. Total-Cost
    3. C. Net Cost
    4. D. _NetCost2

    Answer: D

    Explanation: The V7 rules say, "The name must begin with a letter of the Latin alphabet (A–Z, a–z) or the underscore." They allow letters, numerals, and underscores, but no embedded blanks or hyphens. _NetCost2 meets those requirements.

    Reference: SAS 9.4 Language Reference: Concepts, Sixth Edition — Chapter 3, Rules for SAS Variable Names — V7, p. 31

  3. 3An ordinary DATA step begins with DATA; and supplies no output data set name. How does SAS name the resulting data set?

    1. A. It reuses the input data set's name automatically.
    2. B. It names the output _NULL_.
    3. C. It assigns a name using the DATAn convention.
    4. D. It rejects the step because an output name is required.

    Answer: C

    Explanation: The DATA statement reference says that SAS "automatically assigns the names DATA1, DATA2, and so on, to each successive data set that you create." Omitting an output name therefore invokes the DATAn convention; it does not suppress data set creation.

    Reference: SAS 9.4 DATA Step Statements: Reference — DATA Statement — Without Arguments, p. 50

  4. 4What value does Total=10+2**3; assign in a SAS DATA step?

    1. A. 16
    2. B. 1728
    3. C. 26
    4. D. 18

    Answer: D

    Explanation: The precedence rules state, "In compound expressions, SAS evaluates the part of the expression containing operators in Group I first, then each group in order." Exponentiation ** belongs to Group I, ahead of addition, so 2**3=8 and Total=18. Treating ** as multiplication gives 16. Adding 10+2 before cubing gives 1728. Starting at 2 and multiplying by 2 three more times incorrectly computes the fourth power, giving 26 after adding 10.

    Reference: SAS 9.4 Language Reference: Concepts, Sixth Edition — Chapter 6, Arithmetic Operators, pp. 125–126; Order of Evaluation in Compound Expressions, Table 6.6, pp. 135–136

  5. 5Variable labels already exist, and the LABEL system option is in effect. Which PROC PRINT option requests those labels as column headings?

    1. A. HEADING=HORIZONTAL
    2. B. LABEL
    3. C. N
    4. D. DOUBLE

    Answer: B

    Explanation: The PROC PRINT guide states that LABEL "specifies to use the variables' labels as column headings." It must be requested for this purpose; defining labels alone does not make PROC PRINT display them under the stated defaults.

    Reference: Base SAS 9.4 Procedures Guide, Seventh Edition — Chapter 48, PROC PRINT Statement — LABEL, p. 1769

  6. 6Work.Source must remain in its original order while a new Work.ByID data set is sorted by ID. Which PROC SORT statement supports that requirement?

    1. A. proc sort data=work.source;
    2. B. proc sort data=work.byid out=work.source;
    3. C. proc sort data=work.source out=work.source;
    4. D. proc sort data=work.source out=work.byid;

    Answer: D

    Explanation: The guide states, "When you specify the OUT= option using a new data set name, PROC SORT creates a new data set that contains the sorted observations." Work.ByID is the new output member. Omitting OUT= or setting it to Work.Source would replace the original member.

    Reference: Base SAS 9.4 Procedures Guide, Seventh Edition — Chapter 65, Results: SORT Procedure — Output Data Set, p. 2435

  7. 7Which DBMS= identifier tells PROC IMPORT to use the comma-separated-values file type without a separate DELIMITER statement?

    1. A. TAB
    2. B. CSV
    3. C. JMP
    4. D. DLM

    Answer: B

    Explanation: The guide explains that "The IMPORT procedure recognizes .CSV as an extension for a comma-separated file." CSV is the corresponding comma-separated identifier. TAB is tab-delimited, DLM has a blank default delimiter, and JMP identifies a different file format.

    Reference: Base SAS 9.4 Procedures Guide, Seventh Edition — Chapter 36, PROC IMPORT Statement — DBMS= and Table 36.1, p. 1333

  8. 8Consider this submitted code: data work.copy; set sashelp.class; proc print data=work.copy; run; What causes the DATA step to execute before PROC PRINT begins?

    1. A. The indentation of the SET statement establishes a step boundary.
    2. B. The semicolon after SET automatically closes the entire DATA step.
    3. C. The PRINT procedure executes the SET statement as part of its own step.
    4. D. The PROC statement establishes the boundary of the preceding DATA step.

    Answer: D

    Explanation: SAS Studio explains, "Generally, a step ends with a RUN statement or when a new DATA or PROC step begins." Here the PROC statement supplies the DATA step boundary even though no RUN statement appears between the steps.

    Reference: How do I write a SAS program? — How do I write a SAS program? — paragraph on DATA and PROC steps

  9. 9Under VALIDVARNAME=V7, what is the maximum length of a SAS variable name consisting entirely of ASCII letters?

    1. A. 8 characters
    2. B. 32 characters
    3. C. 64 characters
    4. D. 256 characters

    Answer: B

    Explanation: The V7 naming rules state, "The name can be up to 32 bytes in length." The manual explains that Latin letters use one byte each in SAS encodings, so a name made entirely of ASCII letters can contain at most 32 characters.

    Reference: SAS 9.4 Language Reference: Concepts, Sixth Edition — Chapter 3, Rules for SAS Variable Names — V7, p. 31; How Many Characters Can I Use?, pp. 35–36

  10. 10A single DATA step must create Work.AllRows and Work.Backup. How should their names be specified in the DATA declaration?

    1. A. List both output names separated by spaces in one DATA statement.
    2. B. List both output names separated by a comma in one DATA statement.
    3. C. Join the two output names with an equals sign in one DATA statement.
    4. D. Put each output name in its own successive DATA statement.

    Answer: A

    Explanation: The reference states, "You can specify more than one output in a DATA statement." Its output-data-set syntax lists the names separated by spaces in one statement. A second DATA statement would begin a different step rather than name a second output of the same step.

    Reference: SAS 9.4 DATA Step Statements: Reference — DATA Statement — Form 1 and Using the DATA Statement, pp. 50, 56

Topics in this practice bank

These topics describe the available practice for SAS 9.4 Programming Fundamentals Exam. Review the examination outline and its sources for scope and allocation details.

  • Fundamental SAS Concepts
    • Recall general rules of DATA and PROC steps.
    • Recognize general rules of SAS statements including global statements.
    • Interpret the SAS log.
    • Distinguish between syntax and logic errors.
  • Explore SAS Data Sets
    • Recall naming conventions used for SAS data sets and variables.
    • Recognize variable types (character and numeric).
    • Explain how to create and manipulate SAS date values.
    • Recognize how SAS stores missing data.
    • Use the LIBNAME statement to read SAS data sets.
    • Use PROC CONTENTS to view the descriptor portion of a data set.
    • Recall how to use Data Set options: DROP=, KEEP=, RENAME=, OBS=.
  • Using the DATA Step to Access SAS Data Sets
    • Use the DATA statement to create one or multiple data sets.
    • Use the SET statement to read a data set.
    • Explain how to combine data sets.
    • Explain the compilation and execution process of the DATA step.
    • Subset observations and variables.
  • Using the DATA Step to Manipulate Data
    • Create or update variables.
    • Recognize SAS Functions.
    • Perform conditional processing.
    • Control the output of observations.
    • Create an accumulating variable.
    • Explain the function of iterative DO loops.
    • Assign permanent attributes.
  • Generate Reports Using PROC Steps
    • Use PROC PRINT to generate a detail report.
    • Use PROC MEANS to generate a summary report.
    • Use PROC FREQ to generate a frequency report.
    • Identify methods to enhance reports.
  • Use Utility Procedures
    • Use PROC SORT to sort a report based on values of a variable.
    • Use PROC FORMAT to define custom formats.
  • Import and Export non-SAS files
    • Use a procedure to transfer a CSV file.
    • Use the LIBNAME statement to import/export an Excel file with XLSX engine.
    • Use ODS to direct reports to external files.

How to use these free practice questions

Choose an answer, check the explanation, and review your progress by chapter. Practice questions and explanations are free to access without signing up.

These are independent study questions, not actual examination items. For examination requirements and official information, view SAS 9.4 Programming Fundamentals Exam details.