SAS Base Certification Practice – Question 2

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

--------10-------20-------30
$1,234

The following SAS program is submitted:

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

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

Options:

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

3 Comments

    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?

    Reply
      Yaseen Nov 02, 2016

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

      Reply
    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?

    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.