SAS Base Certification – Question 5

Question 5: The following SAS program is submitted:

1
2
3
4
5
6
data WORK.LOOP;
  X = 0;
  do Index = 1 to 5  by  2;
    X = Index;
  end;
run;

Upon completion of execution, what are the values of the variables X and Index in the SAS data set named WORK.LOOP?

Options:

A.	X = 3, Index = 5 
B.	X = 5, Index = 5 
C.	X = 5, Index = 6 
D.	X = 5, Index = 7 

*The SAS certification sample problem and answer above 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

2 Comments

    ANIRUDH Nov 15, 2015

    I DONT HAVE WORDS TO DESCRIBE.
    I AM SO THANKFUL TO YOU FOR CREATING SUCH AN AMAZING COLLECTION OF QUESTIONS.
    THANK YOU AGAIN. REALLY HELPING ME GAINING MY CONFIDENCE

    Reply
    Toan Oct 05, 2016

    This one was surprisingly tricky to me because X=Index was after the DO statement.

    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.