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
What is the use of the %include statement?
i have a dataset with 100 obs i want to generate title from 20th obs onwards with total observations. that should contain 100 obs.dont use firstobs and dnt split the data. use dataset block or proc report? how can we genarate;
What is Linear Regression?
what is slowly changing dimension? : Sas-di
name several ways to achieve efficiency in your program? : Sas programming
what is star schema? : Sas-di
What is the difference between %put and symbolgen? : sas-macro
What is the difference between input and infile statement?
Explain what is data step?
how does sas handle missing values in formats? : Sas programming
Differentiate between sas functions and sas procedures.
Hi, Does anybody has lastest SAS certification(base, adv., clinical)dumps,if anybody has please email me at mailtorajani76@gmail.com. Thanks
what is the primary data source for the wrs? : Sas-bi
what are all the reports you generated in your recent project?
If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable? : sas-macro