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
If you use a symput in a data step, when and where can you use the macro variable? : sas-macro
How would you identify a macro variable?
Explain data step in SAS
How do you define proc in sas? : sas-grid-administration
What is proc sort?
what are the benefits of data integration? : Sas-di
What is auto call macro and how to create a auto call macro? What is the use of it? How to use it in sas with macros? : sas-macro
Explain what is SAS informats?
What is the use of PROC gplot?
what is function of retain statment
how would you determine the number of missing or nonmissing values in computations? : Sas programming
What is the role of unrestrictive users? : sas-grid-administration
What commands are used in the case of including or excluding any specific variables in the data set?
Differences between where and if statement?
Enlist the syntax rules followed in sas statements.