Commonly Asked SAS Interview Questions with Answer : 61 - 65

Ques 61 : How could we create a SAS date value by using separate variables representing day, month and year of the date ?

Ans : We can use MDY function to create a SAS date value by using separate variables like day, month and year.





Ques 62 : What are the ways to view cube data when cube has been created by SAS OLAP CUBE Studio ?

Ans : We can view the cube data (cube - created by SAS OLAP CUBE STUDIO ) by following ways :

1.  SAS Enterprise Guide
2.  SAS Web OLAP viewer for java
3.  MS- Excel Pivot tables
4.  SAS Information Delivery Portal's visual data explorer portlet



Ques 63 : What are the load styles or ways to load the data to DW or permanent table by using TABLE LOADER transformation in SAS DI Studio ?

Ans : There are THREE ways to load the data to permanent table by using Table Loader Transformation in SAS DI Studio as given below :

1. Append to Existing
2. Replace
3. Update / Insert



Ques 64 : Can we create an Index on a View ?

Ans : No, We can not create an Index on View.



Ques 65 : Why we do Indexing (in simple word) and how many types of Indexes we can create in SAS ?

Ans : Indexing : To extract a small subset of observations from a large data set.

We can create two types of Indexes in SAS :

1. Simple Index
2. Composite Index

Commonly Asked SAS Interview Questions with Answer : 56 - 60

Ques 56 : What is the use of MEANS Procedure in SAS and what are the defaults statistics for it ?

Ans : The MEANS Procedure (PROC MEANS) is to get summarized data by computing descriptive statistics for numeric variables on across all observations.

PROC MEANS produced five statistics by default which are given below :
1. N (Number of non-missing values)
2. MEAN
3. STD DEV (Standard Deviation)
4. MINIMUM
5. MAXIMUM



Ques 57 : What are the basic difference between PROC MEANS and PROC SUMMARY in SAS ?

Ans : PROC MEANS with NOPRINT option is just like as PROC SUMMARY.

The basic difference between both is : By default, PROC SUMMARY creates an output dataset while PROC MEANS produces a printed output.



Ques 58 : What are the NULL data sets and DEFAULT data sets in SAS ?

Ans : There are three types of special SAS Data Sets in SAS :
1. Null Data sets : _NULL_

2. Default Data sets : _LAST_

3. Automatic naming convention Data sets : DATAn

* for DATAn, Kindly referQuestion 17



Ques 59 : What is the use of PUT and INPUT function in SAS ?

Ans : PUT Function : It converts numeric values to character values and it requires FORMAT.

INPUT Function : It converts character values to numeric values and it requires INFORMAT.


Proc contents output of Data set R:



Ques 60 : How can we count the number of missing values of numeric variable in a SAS data set ?

Ans : To count the number of missing values for numeric variable, We could use MEANS Procedure with NMISS option.


PROC MEANS DATA=DSN NMISS;
VAR NUMV;
RUN;

Commonly Asked SAS Interview Questions with Answer : 51 - 55

Ques 51 : How could we create an empty table which should have all the attributes of an existing table ?

Ans : By using LIKE clause in PROC SQL, we can create an empty table which would have all the attributes of an existing table.

PROC SQL;
CREATE TABLE DSN1
LIKE DSN;
QUIT;

* DSN1 and DSN are tables



Ques 52 : While using SQL Procedure in SAS, What is the difference between 'SET' clause and 'VALUE' clause ?

Ans : For SQL Procedure in SAS, we use 'SET' clause and 'VALUE' Clause to insert the rows / value into the table.

By using SET clause we can assign values to column by name irrespective of column position while VALUE clause assigns values to column by column position.

* For SET clause, if we don't specify the data for a column then value of that column would be a missing value

* For VALUE clause, if we don't specify the data for a column then there would be an error : Row is not inserted



Ques 53 : What is 'TRANS_RC' and 'JOB_RC' in SAS DI Studio ?

Ans : TRANS_RC and JOB_RC are job's status handling macro variables. 
we can set &Trans_rc and &Job_rc macro variables with respect to the return code value of completed transformation and individual steps within a transformation respectively in SAS DI Studio.



Ques 54 : What is the difference between '%STR' and '%BQUOTE' SAS macro functions ?

Ans : %STR and %BQUOTE macro functions are for masking the special characters and Mnemonics. 

We can use %STR macro function is specifically for unmatched quotation marks and parentheses while we use %BQUOTE macro function for matched quotation marks and parentheses.

Macro function %STR is a compilation function while %BQUOTE is execution function.



Ques 55 :  What is the difference between '%EVAL' and '%SYSEVALF' SAS macro functions ?

Ans : SAS Macro functions %EVAL and %SYSEVALF are to evaluate the arithmetic expression.

%EVAL function supports only integer arithmetic expressions while %SYSEVALF function supports floating point values for arithmetic expressions.

Example:
%LET A=%EVAL(10+5);

%LET B=%SYSEVALF(10.5+ 5.5);

%Put The value of A is &A and the value of B is &B;