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
How to limit decimal places for the variable using proc means?
how does sas handle missing values in assignment statements? : Sas programming
what is the function of catx syntax? : Sas-administrator
If you use a symput in a data step, when and where can you use the macro variable? : sas-macro
what are the scrubbing procedures in sas? : Sas programming
how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming
What are symget and symput? : sas-macro
I am preparing SAS Certified Advanced Programmer for SAS 9 in 2014. If anybody has the latest dumps for this exam, please mail me at dhiman.mukherjee@gmail.com
I have a dataset concat having variable a b & c. How to rename a b to e & f?
Explain what Proc glm does?
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 ...
What is the difference between match merge and one to one merge?
What is the length assigned to the target variable by the scan function?
how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?
Can you execute a macro within a macro? Describe. : sas-macro