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


Please Help Members By Posting Answers For Below Questions

what is data integration? : Sas-di

610


How to sort in descending order?

786


how does sas handle missing values in functions? : Sas programming

597


How can you limit the variables written to output dataset in data step?

745


What is the role of administrative users? : sas-grid-administration

657






What is by-group processing?

574


Mention sas system options to debug sas macros.

659


if you were told to create many records from one record, show how you would do this using array and with proc transpose? : Sas programming

538


What do the put and input function do?

583


What is the use of %include statement?

617


explain the proc in sas? : Sas-administrator

618


What is run-group processing?

622


Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.

1460


Mention common programming errors committed in sas ?

645


What is the difference between match merge and one to one merge?

688