109.SAS INTERVIEW QUESTIONS - 2

                     SAS INTERVIEW QUESTIONS - 2


6. Describe different ways to combine datasets in sas (e.g., merge, set, append). When would you use each?

 Already we know that different ways to combine datasets are 

 Merge : they combine datasets in horizontally using by statement. 

 Set: the dataset concatenates the other dataset in horizontally. 

 Append: the second dataset observations added to original dataset.

When you want to add observations from one dataset to other dataset then use append statement. 

 When you want to combine datasets without matching conditions then use set statement. 

 When you want to combine datasets with matching conditions then use merge statement.


7. How do you handle missing values in sas? Discuss different missing value representations and functions like nmiss, cmiss, and missing. 

 Nmiss: returns the number of missing values in numeric variables. 

 Cmiss: returns the character of missing values in character variables. 

 Missing: returns 1 if the (both numeric and character) values are missing and otherwise 0. 


8. How do you create new variables in sas? Explain the difference between assignment statements and the retain statement.

 By using assignment statement, conditional statement, sum statement we can create new variables.

 In conditional statements we use : if then, if then else, if then else if, if then do, if then delete, if then output. 

 Assignment statement:used to assign values to variables within the datastep.values are typically assigned based on calculations,comparisions or input from the data. 

 Retain statement:used to retain the value of variable from one iteration of the datastep to the next.allows you to carry information across observations within a dataset. 


9. Explain the difference between where clause and subseting if statement in sas?

 Where statement: it is used to subset the observations. it cannot create any new variables. it is processed before the data is read into the pdv then sas filters data based on where condition only reads selected observations into memory. 

 If statement: it is used to subset the observation conditionally. It can also create new variables accordingly. if statement processed after an observation read into the pdv.sas reads all observations into memory and discards those that do not meet the condition.  


10.How would you transpose a dataset in SAS? 

 By using the Proc Transpose statement we can transpose the dataset. 


COMMENT YOUR EXPERIENCED INTERVIEW QUESTIONS...

-->PLEASE READ AND COMMENT THE BLOG...

--PLEASE FOLLOW THE BLOG FOR MORE UPDATES...

--FOLLOW US IN FACEBOOK SASALL4YOU AND JOIN ...

--JOIN US IN FACEBOOK AND TELEGRAM  CHANNEL FOR MORE UPDATES

   CLICK HERE : https://t.me/SasAll4You

Comments