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

For what purpose would you use the RETAIN statement?

1577


Do we follow ADAM in analysis dataset development?How? Usually which version? Why is it necessary?

2448


which date function advances a date, time or datetime value by a given interval? : Sas programming

1092


Explain the difference between nodup and nodupkey options?

1081


name the scheduler for scheduling job and explain the scheduler? : Sas-di

1091


What are the uses of sas?

1351


How does proc sql work?

1143


What would you change about your job?

2434


Differentiate between proc means and proc summary.

1098


explain the key concept of sas? : Sas-administrator

1045


what is sas olap server? : Sas-di

1293


What is the purpose of _character_ and _numeric_?

1103


Mention what is SAS data set?

1173


for what purpose would you use the retain statement? : Sas programming

1143


How substr function works in sas?

1266