SAS Base Certification Practice – Question 2

Question 2: The contents of the raw data file AMOUNT are listed below:


The following SAS program is submitted:

data test;
infile 'amount';
input @1 salary 6.;
if _error_ then description = 'Problems';
else description = 'No Problems';

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


A. Problems
B. No Problems
C. ' ' (missing character 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


    Toan Oct 05, 2016

    Can we also use the informat comma6. to read the value? I heard it’s an Alias of each other so does that mean we can use either interchangeably?

      Yaseen Nov 02, 2016

      Yes u can use comma6. it removes comma and $ sign from numeric values

        kamkh Jan 17, 2017

        Thank you for your comment!

    Mike Jul 03, 2017

    How can SAS read in the data if the fileref is in quotation marks and provides no filepath? Doesn’t that cause an error?

    clarimusique Jan 27, 2018

    I tried fileref in quotation marks (in filename statement) it doesn’t work because ERROR: Invalid logical name.
    ERROR: Error in the FILENAME statement.
    I’m dissapointed to pay a training that contains errors like this.
    You should have verified the codes Under SAS.


Leave a Reply to Yaseen 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.