Under what circumstances would you code a SELECT construct
instead of IF statements?
Answer Posted / sonu
The SELECT statement begins a SELECT group. SELECT groups contain WHEN statements that identify SAS statements that are executed when a particular condition is true. Use at least one WHEN statement in a SELECT group. An optional OTHERWISE statement specifies a statement to be executed if no WHEN condition is met. An END statement ends a SELECT group.
Null statements that are used in WHEN statements cause SAS to recognize a condition as true without taking further action. Null statements that are used in OTHERWISE statements prevent SAS from issuing an error message when all WHEN conditions are false.
Using Select-When improves processing efficiency and understandability in programs that needed to check a series of conditions for the same variable.
Use IF-THEN/ELSE statements for programs with few statements.
Using a subsetting IF statement without a THEN clause could be dangerous because it would process only those records that meet the condition specified in the IF clause.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Describe the ways in which you can create macro variables? : sas-macro
What are the scrubbing procedures in sas?
what is proc Index? and what is proc document?
what is metadata? : Sas-bi
how can you create zero observation dataset? : Sas programming
What is the difference between SAS functions and procedures?
how do you test for missing values? : Sas programming
what is the difference between calculating the 'mean' using the mean function and proc means? : Sas programming
how could you generate test data with no input data? : Sas programming
What is the difference between INPUT and INFILE ?
What are the applications primarily used by business analyst? : Sas-bi
How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?
What is the use of stop statement?
What are the differences between proc means and proc summary?
what do the pad and dim functions do? : Sas programming