SAS Base Certification Practice – Question 3

Question 3: The contents of the raw data file NAMENUM are listed below:

Joe xx

The following SAS program is submitted:

data test;
infile 'namenum';
input name $ number;

Which one of the following is the value of the NUMBER variable?


A. xx
B. Joe
C. . (missing numeric value)
D. The value cannot be determined as the program fails to execute due to errors.

*This blog is not affiliated with SAS or the SAS Institute. 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


    Kam Sep 19, 2015

    In the input statement there is no range specified (ex: input name $ 1-3) for variable ‘name’. How is SAS able to read it? I thought that specifying a range for the input variable is a must.

      Matthew Oct 13, 2015

      It’s list style input, so SAS reads each value until the first delimiter that it reaches, which in this case is the space between Joe and xx. Specifying the range is not necessary.

        Toan Oct 05, 2016

        Since a DLM=’,’ or DSD is not specified, it counts the blank as a delimiter, correct?


Leave a Reply to Kam Cancel reply

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.