Answer Posted / cutepa1
Almost all the above answers are right, except one or few.
Here I provide a clear insight into _n_ variable. This is an
automatic variable of PDV(Program Data Vector) that returns
the no. of observations that it has iterated. There are
such variables like _error_, end=, in=, first.by-variabke,
last.by-variable,etc.. All these variables will not be
displayed in the target output.
Ex:
data new;
set ora.emp;
if _n_ >= 2 and _n_ <= 6 then output;
run;
/* as _n_ returns 'n'th observation our statement is to save
those obs when _n_ returns the value between 2 and 6. Hence
the 5 obs of the specified dataset between second and six
are saved into 'new'.
Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
Difference between nodup and nodupkey options?
what is broad cast agent? : Sas-bi
if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...
Describe a time when you were really stuck on a problem and how you solved it?
what are 5 ways to perform a table lookup in sas? : Sas-administrator
describe about physical data integration? : Sas-di
How we can call macros with in data step? : sas-macro
What is the basic structure of a sas program?
Explain how merging helps to combine data sets.
what is sas olap server? : Sas-di
What is by-group processing?
What are the advantages of using sas?
explain the key concept of sas? : Sas-administrator
How long can a macro variable be? A token? : sas-macro
Mention sas system options to debug sas macros.