what are system option ? give few examples ?
what are dataset options and dataset statements ?
if there is a keep option and keep statement ? which one is
executed first ?
Difference between a WHERE statement and IF statement ?
what is the advantage of using WHERE statement option on
the dataset ?



what are system option ? give few examples ? what are dataset options and dataset statements ? if ..

Answer / sushil nayak

1) System options are global instructions that affect the entire SAS session and control the way SAS performs operations. Once you invoke a system option, it remains in effect for all subsequent data and proc steps in a SAS job, unless you specify them. For example .. OPTIONS NODATE PAGESIZE=MAX LINSIZE=MAX NOCENTER; ..search SAS online doc to knw more options.

2)Dataset options are options that you code after dataset name,for example KEEP= DROP= WHERE= FIRSTOBS= OBS=..etc dataset statement are coded anywhere within the data and run statements..for example KEEP DROP WHERE RETAIN ..etc

3)If KEEP= and KEEP statement is coded then KEEP option gets executed 1st and then the statement.

4) The following are some of the differences between the IF and WHERE statement ::
a)IF works on newly created variable within the same DATASTEP(for example, variable created by reading a raw file), but WHERE would not work for newly created variable.

b) IF works on Automatic variable (_n_,first. , last.), but WHERE would not work for the same.

c)WHERE can be applied in PROC and DATASTEPS, but IF can be applied to DATASTEPS only.

d) IF does a char to num conversion or visa-versa while checking a condition (IF NEEDED), but WHERE would no cause ERROR, stating that variable being checked is incompatible variable.

There are other differences, would recommend searching sas online or sas sugi papers to knw more.

5) If a WHERE and IF can be applied with a datastep then WHERE should be choosen, reason being, the WHERE statement is more efficient than IF statement.

Is This Answer Correct ?    9 Yes 1 No

Post New Answer

More SAS Interview Questions

What do you code to create a macro? : sas-macro

0 Answers  


What are the features of base sas system?

0 Answers  


data voter; input Age Party : $1. (Ques1-Ques4)($1. + 1); datalines; 23 D 1 1 2 2 45 R 5 5 4 1 67 D 2 4 3 3 39 R 4 4 4 4 19 D 2 1 2 1 75 D 3 3 2 3 57 R 4 3 4 4 ; Idont understand what the (Ques1-Ques4)($1. + 1) means. I have seen (Ques1-Ques4)(4*$1.), but what is (Ques1-Ques4)($1. + 1)? Appreciate all help Thanks

3 Answers  


is it possible to generate sas datasets using proc print ???

1 Answers   GSK GlaxoSmithKline,


Mention how to limit decimal places for the variable using proc means?

0 Answers  






i have a macro variable var1,var2. i want titles for the each macro variable separately? how it is possible?

1 Answers   L&T,


Hello, I have PROC SQLs results group by 3 fields and I use SUM and COUNT functions in SQL. The problem is when I try to display my result with PROC TABULATE. I am getting very big numbers. I believe I make a mistake some where in Tabulate. Here is my Proc Tabulate. PROC TABULATE DATA=OUT04_05 FORMAT=12.; CLASS YR CENTRE VISA / PRELOADFMT EXCLUSIVE; VAR NEWUSER FRAUD TRANSFER AUTUSER REISSUE; TABLE CENTRE ALL, (YR ALL)*VISA, (NEWUSER*F=COMMA12. AUTUSER*F=COMMA12. FRAUD*F=COMMA12. TRANSFER*F=COMMA12. REISSUE*F=COMMA12.) / MISSTEXT={LABEL='0'} PRINTMISS RTS=20; FORMAT VISA VISAFMT.; KEYLABEL SUM = ' ' ALL = 'TOTAL'; LABEL YR = 'DATE YEAR' NEWUSER = 'TOTAL NEW ACCT' TRANSFER = 'TOTAL TRANSFER' FRAUD = 'TOTAL FRAUD TRANSFER' AUTUSER = 'TOTAL AUTH USERS' REISSUE = 'TOTAL REISSUE'; When I code it like : NEWUSER*N*F=COMMA12. AUTUSER*N*F=COMMA12. I get same amount numbers but to find a NEWUSER I use COUNT(*) and to find AUTUSER I use SUM(xxxx) function so both result shouldn’t be the same my problem is in this point. Could you tell me where the problem in code is. How can I display my result? TX.

0 Answers  


What’s the difference between var b1 – b3 and var b1 — b3?

0 Answers  


WHAT DOES A SAS SPECIFICATION DOCUMENT SDS CONTAIN ?

1 Answers  


Do you need to know if there are any missing values?

0 Answers  


how can you put a "trace" in your program? : Sas programming

0 Answers  


What do you feel about hardcoding?

4 Answers   Oracle,


Categories