Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Under what circumstances would you code a SELECT construct
instead of IF statements?

Answer Posted / rushi

When you have a long series of mutually exclusive conditions and the comparison is numeric, using a SELECT group is slightly more efficient than using IF-THEN or IF-THEN-ELSE statements because CPU time is reduced.

The syntax for SELECT WHEN is as follows :

SELECT (condition);
WHEN (1) x=x;
WHEN (2) x=x*2;
OTHERWISE x=x-1;
END;

Example :

SELECT (str);
WHEN ('Sun') wage=wage*1.5;
WHEN ('Sat') wage=wage*1.3;
OTHERWISE DO;
wage=wage+1;
bonus=0;
END;
END;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you add a number to a macro variable? : sas-macro

995


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

1235


What is run-group processing?

1147


Explain the purpose of substr functions in sas programming.

1050


why is sas considered self-documenting? : Sas programming

1133


What is the use of divide function?

1055


What is the use of function Proc summary?

1270


how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming

1021


Explain data_null_?

1041


What is the order of application for output data set options, input data set options and SAS statements?

1544


Do you know the features of sas?

1033


what is enterprise guide? What is the use of it? : Sas programming

1010


What versions of SAS have you used (on which platforms)?

1503


for report generation which one you used proc report or data_null_?

7766


Describe the function and utility of the most difficult SAS macro that you have written?

2546