/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
| Question | Answer |
|---|---|
| How do we specify the name of input dataset to be used by proc sort? | We need to specify the name of the input dataset using data= option on the proc sort statement |
| What happens if we do not provide data= option? | The last created dataset in the current SAS session is used as input for proc sort |
| How do we specify the name of the output dataset in which the sorted observations are to be stored? | We need to specify the name of the output dataset using out=option on the proc sort statement |
| What happens if we do not provide out= option? | Input dataset gets overwritten with the sorted dataset |
| How do we instruct SAS to sort the observations based on particular variables? | We need to specify the names of the sorting variables in the by statement |
| What happens if we do not provide by variables or a by statement? | Returns an Error as by statement is a mandatory statment in proc sort |
| What is the default sort order for a variable? | By default SAS sorts observations based on the ascending values of the variables listed |
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
| Question | Answer |
|---|---|
| Which observation appears first when there is more than one record with the same value in the specified by variable? | When there is more than one observation in the input dataset with the same value in the specified by variables, the observation which appears first in the input dataset with that value will appear first in the output dataset |
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
| Question | Answer |
|---|---|
| How do you instruct SAS to sort the observations based on the descending values of a variable? | We need to specify the keyword 'descending' before the name of the variable for which we want to sort based on descending values |
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/
/********************************************************************************
********************************************************************************/