Question 51: You have written following program using By statement

 data courses2017_1;

 set courses;

 by course_name;

 if first.course_name then TOTALFEE=0;

 TOTALFEE+FEE;

 if last.course_name;

 run;

 Which of the following statements are correct?

  1. Dataset courses has to be sorted by course_name
  2. There two variables will be created FIRST and LAST for the course_name variable.
  3. FIRST and LAST are the two variables in each By group which represent first and last observation of that group.
  4. FIRST and LAST variable will be stored with the dataset courses2017_1.

 

  1. A,B,C
  2. Get all Questions and Answer from here
  3. You need to have paid subscription to access all questions
  4. Thanks for considering SAS Certification Material

 Correct Answer : 1 Exp : When you create a new dataset using By statement than original data set must be sorted by the columns which are used in the by

 statement.

You can access to full explanation to question and answer from this page.