Commonly Asked SAS Interview Questions with Answer : 81 - 85

Ques 81 : What is the way to insert a blank line after every n observation in SAS while listing a report ?

Ans : As we know that the default reports are difficult to read but it would be easier to read if a blank line would get inserted after every few observations.

We can insert a blank line by using BLANKLINE option in Proc Print statement.

Suppose we want to insert a blank line after every five observation then we can use following syntax :





Ques 82 : How could we filter the data based on multiple values for the same variable ?

Ans : We can filter the data on multiple values for the same variable by using OR or IN operator.

Syntax for OR operator : 




Syntax for IN operator :


  • We would get the same output by using OR Operator or IN Operator



Ques 83 : How could we filter the missing data even if we are not sure whether the variable is character or numeric ?

Ans :  If we are not aware about the data type of the variable and we need to filter it by missing observations, we can use IS MISSING with WHERE Statement in SAS.




Ques 84 : How to create a SAS dataset which consists all SAS system options which are currently in effect ?

Ans : We have two ways to get the list of all SAS System options which are currently in use.

1. By using SAS Procedure :


2. By dictionary tables : 





Quse 85 : How could we control the delimiter within the a Date ?

Ans : To control the delimiter within the Date, we have specific SAS Date Formats. We can use desired SAS Date format for required output. 

For Example, if we want to apply Colon (:) delimiter within SAS Date then we can use DDMMYYC10. Date format.



some more delimited SAS Date formats are :
  • For Slash (/) : MMDDYY10.
  • For Dash (-) : DDMMYYD10.
  • For Point (.) : DDMMYYP10.

Commonly Asked SAS Interview Questions with Answer : 76 - 80

Ques 76 : What is the difference between file extension .SAS and .LST in SAS ?

Ans : File extension is an identifier for type of file. There are several types of file extensions for SAS files. I am just specifying some of them.

  1. x.SAS                  :  SAS Program file
  2. x.CFG                 : SAS Configuration file
  3. x.LST                  : SAS Output file
  4. x.LOG                 : SAS Log file
  5. x.SAS7BPGM    : SAS Stored Program file
  6. x.SAS7BDAT     : SAS Data Set file
  7. x.SAS7BVEW    : SAS Data Set View file
  8. x.SAS7BCAT     : SAS Catalog file
  9. x.SAS7BUTL     : SAS Utility file
  10. x.SAS7BNDX    : SAS Data Set Index file
  • x is a name of file



Ques 77 : What is the default action of Frequency Procedure (Proc Freq) ?

Ans :  The default action of Frequency Procedure is to calculate frequencies on each variable irrespective of character or numeric of defined SAS data set.  

It means we can use PROC FREQ to compute frequencies for both character and numeric variables.

By default Proc Freq calculates four statistics on each variable which are Frequency, Percent, Cumulative Frequency and Cumulative Percent.
  • Proc Freq is not only a descriptive procedure as well as a statistical procedure which produces one way and n-way frequency tables


Ques 78 : How to get the output in List format rather than as a Cross Tabulation in Proc Freq ?

Ans : We can specify LIST option in Proc Freq to print the table in list format.



Ques 79 : How do we get to know that which SAS products are licensed and Installed at our machine ?

Ans : We can use Setinit Procedure (Proc Setinit) to get to know about licensed SAS products for our machine. 

Most of the time, we may have some SAS products licensed but not installed so to get to know only installed products we can use Product_Status Procedure (Proc Product_status).

Syntax : 

Ques 80 : How could we count the number of missing values of numeric variable in SAS ?

Ans : We can count the number of missing values for numeric variables by using NMISS option in PROC MEANS. 

Proc Means requires at least one numeric variable to calculate statistics.

Syntax : 

Commonly Asked SAS Interview Questions with Answer : 71 - 75

Ques 71 : What is the difference between OUTPUT and PUT statement in SAS ?

Ans : PUT Statement is to write the variable values or text strings to an external file or SAS log or SAS output window in SAS while OUTPUT Statement is to write observations to a SAS dataset.



Ques 72 : What are the table look-up techniques in SAS (any four) ?

Ans : There are four table look-up techniques in SAS :

  1. Match Merge of two sas data sets
  2. Format tables
  3. Arrays
  4. Direct Access by using Point option



Ques 73 : Can we use Global Statements anywhere in SAS ? How many Global Statements have you used ?

Ans : Yes, We can use Global Statements anywhere is SAS program. I have used several Global Statements and some names are as given below :

  1. FILENAME    : To access data file
  2. LIBNAME      : To access SAS data libraries
  3. FOOTNOTE  : To write 10 foot note lines
  4. TITLE            :  To write title lines
  5. COMMENT   : To specify the purpose of program
  6. %INCLUDE   : To include files of SAS statements
  7. %LIST           : To list lines from current session
  8. OPTIONS      : To specify the SAS system options
  9. RUN              : To execute the previously entered SAS statements
  10. SKIP              : To create a blank line in SAS log



Ques 74 :  Can we use multiple SAS directories or libraries in a single Libname Statement ?

Ans : Yes, We can use multiple SAS directories or libraries in a single Libname Statement.

Kindly refer : Library Concatenation



Ques 75 : How could we read an external file which contains long lines ? or What is the use of LRECL in Infile / File SAS Statement ?

Ans : We can use LRECL (Logical Record Length) SAS system option to read or write the lines longer than 256 character.

As we know that logical record length for Windows and Unix systems is 256 bytes, to read or write the long data we can specify LRECL with Infile or File Statement in SAS.

  • Minimum and Maximum LRECL is 1 and 32767 bytes respectively

Commonly Asked SAS Interview Questions with Answer (ST) : 11 - 15

Ques (ST) 11 : What are the different types of SAS Application Server's required for SAS Enterprise Guide to run ?

Ans : SAS Enterprise Guide interacts with different types of SAS Application Server's to perform all activities which are mentioned below :

  1. SAS Metadata Server : To read and write metadata to SAS metadata repository
  2. SAS OLAP Server : To process queries for cubes
  3. SAS Stored Process Server : To execute store processes
  4. SAS Workspace Server : To execute SAS codes and to access data



Ques (ST) 12 : Can we create CUBES by using SAS Enterprise Guide now ?

Ans : No, Now we cannot create CUBES by using SAS Enterprise Guide.

We can only view cubes by using OLAP Analyzer in SAS Enterprise Guide.

  • We can build cubes by using SAS OLAP CUBE Studio or SAS DI Studio




Ques (ST) 13 : What are the different types of SAS Application Server's required for SAS Add-In Microsoft Office ?

Ans : SAS Add-In Microsoft office interacts with following SAS Application Server's :

  1. SAS Metadata Server
  2. SAS Stored Process Server
  3. SAS Workspace Server
  • SAS Add-In Microsoft office does not communicate with SAS OLAP Server but Microsoft Excel can access SAS OLAP cubes by using pivot table facility which is in-built in MS Excel



Ques (ST) 14 : What are the different types of SAS Application Server's required for SAS Information Map Studio ?

Ans : SAS Information Map Studio interacts with following SAS Application Server's :

  1. SAS Workspace Server
  2. SAS Metadata Server
  3. SAS OLAP Server




Ques (ST) 15 : What are SAS Information maps and who uses it ? What is the basic role of SAS Information Map Studio ?

Ans : SAS Information Maps includes metadata which explains data warehouse in business terminology. 
It displays the data in business term with labels in spite of tables and columns name as in data warehouse to business user.

SAS Information Maps consists physical tables, relations between tables and business rules.

Business users use Information Maps.

SAS Information Map Studio works like a bridge between data warehouse and business user who builds reports from data.

Commonly Asked SAS Interview Questions with Answer (ST) : 6 - 10

Ques (ST) 6 : What is SAS Stored Process and what are the uses of it ?

Ans : SAS Stored Process is a SAS code or program which is stored on a server and could be executed by many SAS applications. 

SAS Stored Process is described by metadata and gives effective method for change control management as program is saved on server. 

Stored Processes can be centrally managed and maintained which provides the facility to update the program and at the same time all SAS clients which invokes the program would get result from updated version of code.

We can use SAS Stored Process for the following :

  1. To build web applications
  2. Analytics
  3. Web reporting
  4. To deliver result package to clients or to Middle tier
  5. To publish results
  6. Centrally management of program
  7. To enhance the security of program and data




Ques (ST) 7 : What are the Inputs and Outputs for SAS Stored Process ?

Ans : SAS Stored Process could access any SAS data source or external file to create SAS dataset, files and all other data targets supported by SAS.

INPUTS to SAS Stored Process :

  1. SAS Data sources
  2. External files

OUTPUTS
from SAS Stored Process :

  1. External files
  2. SAS Datasets
  3. Catalogs
  4. E-mails
  5. Result packages
  6. ODS outputs


Ques (ST) 8 : What are the SAS Web Clients for SAS Stored Process ?

Ans : We can access or execute SAS Stored Process by following SAS Web Clients :
  1. SAS Web Report Studio
  2. SAS Information Delivery Portal
  3. Stored Process Web Application


Ques (ST) 9 : What are the servers on which SAS Stored Processes are hosted ?

Ans : SAS Stored Processes can be hosted by two types of servers :
  1. SAS Stored Process Server
  2. SAS Workspace Server


Ques (ST) 10 : What is your preferred method to work on (Create) SAS Stored Processes ?

Ans : For me, SAS Enterprise Guide is the preferred method to work on SAS Stored Processes because it gives the facility to create, register and test stored processes in one interface.

SAS Data Integration Studio also gives a point and click interface for creating and registering Stored Process.
  • SAS Stored Processes must be .sas file in SAS.