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?

Answers were Sorted based on User's Feedback



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

Answer / juan

SELECT statement can do logical test. A SELECT statement
provides an alternative to a series of IF and ELSE IF
statements. It is usually more efficient than IF-THEN/ELSE,
especially if you are recoding a variable into a large
number of categories.

Is This Answer Correct ?    7 Yes 0 No

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

Answer / venkatesh.layam

when ever we wre do the task on puarticular variable select
works efficiently than if then else
And it will check immideatly and occupies less space.
it will give good shape out for data.

Is This Answer Correct ?    6 Yes 0 No

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

Answer / gangadhar

IF STATEMENT IS MAINLY USED FOR SUBSETTING OF DATA.IN THE
SAME WAY SUBSETTING IN SQL SELECT STATEMENT IS USED.

Is This Answer Correct ?    2 Yes 2 No

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

Answer / prakask

i think select statements are used when we are using 1
condition to compare with several conditions

Is This Answer Correct ?    2 Yes 2 No

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

Answer / 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

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

Answer / 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

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

Answer / kumarrd

when ever we want check with more than condition we may use
if condition rather than select one

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More SAS Interview Questions

what is metadata? : Sas-bi

0 Answers  


Dear all, proc means data=dsn noprint completetypes; class trtmntgroup /preloadfmt; output out=tot n=n; format trtmntgroup trtf. ; by vstgrp descending severity; run; This is the code I used for AE table. I got the values without giving the variable ‘trtmntgroup(numeric)’ in var statement. And if I give the var statement for that variable i’m getting the same values.How is that possible? What is the difference between class and var statement? Could any one explain me how does proc means work at the back end. And what is the difference between _freq_ value and N value in proc means. Thanks and regards, Rajesh.

1 Answers  


What is the difference between Proc tabulate and Proc print

4 Answers   CitiGroup,


Explain what is the use of proc gplot?

0 Answers  


How will you use the WHO Drug Dictionary for Reporting Clinical Trials?

0 Answers  


Which are SAS Windows Clients & SAS Java Clients

3 Answers   TCS,


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

0 Answers  


how to remove the duplicates by proc sql?

2 Answers   Genpact,


What statement do you code to tell SAS that it is to write to an external file?

5 Answers  


how many display types available in sas bi dashboard? : Sas-bi

0 Answers  


Hi All.I am looking for Good Institute who could Provide the online SAS BI+DI Training along with software.Primarily in Delhi/NCR or in Hyderabad Please help with name and contact number of concerned person!! Thanks in Advance! :)

1 Answers  


What are the 3 components in sas programming?

0 Answers  


Categories