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.

1 comment:

  1. Hi Uma Shankasharr...request you to share some material on sql case statement.

    ReplyDelete