Commonly Asked SAS Interview Questions with Answer : 31 -35

Quse 31 : By using PROC SQL, How could we get the correct count of data from that column which includes duplicates  ?

Ans : We can use DISTINCT keyword with an aggregate function in PROC SQL to get the count of non-duplicate data.

          PROC SQL;
          SELECT Count (DISTINCT Fname) as Count
          FROM Uma.DSN;
          QUIT;

Note : if some values are missing in Fname that would also not get counted here.



Ques 32 : What are the basic differences between HAVING and WHERE clause in PROC SQL ?

Ans : 1. Having clause works on Grouped data while Where clause affects individual rows.

2. Having Clause processes the data after the Group by clause and any aggregate functions process

3. Where clause process the data before Group by clause and any aggregate function process the data.



Ques 33 : What is the use of VALIDATE statement in PROC SQL;

Ans : In PROC SQL, VALIDATE statement is the statement which cross check the query's syntax that syntax is correct or not without submitting it.
In log, SAS displays about the syntax whether it is correct or not.

                  PROC SQL;
                  VALIDATE SELECT Name, EmpID
                  FROM Uma.DSN;
                  QUIT;



Ques 34 :  What do you understand by Join or Joining the tables in PROC SQL ?

Ans : Joining Tables gives us the facility to fetch the data from two or more tables. It does not alter the original tables.



Ques 35 : What are the effects of Null values in JOINS in PROC SQL ?

Ans : PROC SQL behaves with Null values like missing values and same in joins. 
It means if we specify any null value in PROC SQL join then it would be matched with other null value of the same type of it's own (Character or numeric ).

No comments:

Post a Comment