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
What is the differnce between SDTM 3.1.2 to 3.1.1 version
What are the different operating system platforms in which we can use sas? : sas-grid-administration
What are types of transport files?
Mention the category in which sas informats are placed?
What are the statements in proc sql?
What are pdv and it functions?
what is hash files in sas and why we are using this one in sas?
How many ways to overcome a missing values???
what is data access? : Sas-di
explain what is data set in sas? : Sas-administrator
Explain how you can debug and test your SAS program?
Name any two sas spawners? : sas-grid-administration
What can be the size of largest dataset in SAS?
Explain the difference between informat and format with an example.
name the scheduler for scheduling job and explain the scheduler? : Sas-di