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 the work of tranwrd function?

672


Do you know the features of sas?

598


Give some examples where proc report’s defaults are different than proc print’s defaults?

603


what are several options for creating reports in web report studio? : Sas-bi

634


How long can a macro variable be? A token? : sas-macro

721






What are the statements that are executed only?

676


What are the different servers in sas? : sas-grid-administration

605


How do you specify the number of iterations and specific condition within a single do loop?

628


how are numeric and character missing values represented internally? : Sas programming

622


What can be the size of largest dataset in SAS?

721


hi here is a problem can anybody solve this? i want to report the data through third party file. by using data _null_ or proc report or macro automation process. but i want to insert the 'titles and footnotes' in between the data and also starting of 2nd and ending of 2nd and starting of 3rd and ending of the 3rd page. tell me how and write the code?

1690


what is the Population you used in your project, is it ITT or PP?

2185


If a variable contains only numbers, can it be a character data type?

616


Explain input and put function?

648


explain the difference between alternate key, business key, foreign key, generated key, primary key, retained key and surrogate key ? : Sas-di

550