SAS Base Certification – Question 1

Question 1: The following program is submitted.

1
2
3
4
5
6
data WORK.TEST;
input Name $ Age;
datalines;
John +35
;
run;

Which values are stored in the output data set?

Options:


A) Name Age
---------------------
   John 35

B) Name Age
---------------------
   John (missing value)

C) Name Age
---------------------
(missing value) (missing value)

D) The DATA step fails execution due to data errors.

*The SAS certification sample problem and answer are sourced from the official SAS sample questions page. All answer logs, data sets, output, and commentary are provided by this blog.

Correct Answer

Incorrect Answer

Click to see Answer Explanation below

thanks for your support

4 Comments

    mbvenkat Dec 31, 2015

    + and – signs will treat as Standard type of numeric data, and Hence no error.

    Reply
    mike Dec 07, 2016

    The answer showing here is wrong. You cannot have a semicolon within a ‘dataline’ line of code. It results in a syntax error.

    Reply
      GSmith Jul 29, 2018

      Results from SAS Studio:
      1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
      72
      73 data WORK.TEST;
      74 input Name $ Age;
      75 datalines;

      NOTE: The data set WORK.TEST has 1 observations and 2 variables.
      NOTE: DATA statement used (Total process time):
      real time 0.00 seconds
      cpu time 0.00 seconds

      77 ;
      78 run;
      79
      80
      81 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
      94
      semicolon on dataline is not throwing an error. Result is correct:
      John 35

      Reply
    Nandhini Jun 11, 2018

    It works only for single ‘+’. For multiple sign ‘++++’ only a period will be displayed (missing numeric value)

    Reply

Leave a Comment

Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or it will be deleted. Let us have a personal and meaningful conversation instead.