What is _n_?
Answers were Sorted based on User's Feedback
Answer / d.vijaya bhaskar
SAS variable to count the no of obs read.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / natraj boga
An internal SAS counter in the data step which contains the
current iteration number of the data step.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / varun kumar
_n_ is a automatic variable that can be used for processing.
It counts the number of times the data set begin to execute.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ashok kore
This is an automatic variable. It is used to count the
number of obs in dataset.Its added one for every iteration
of datastep.
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / chiranjeevi
The _n_ is a automatic variable which displays the line number.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / venkatesh.layam
while execution process automatic variable _n_ will be
created.it tells how many times data step has been
executed .
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / pricil kurian
Hi ravi..ur answer is correct. ONE QUERY...for the below
example to get third record consecuitvely we need to
if mod(_n_,3)= 0 ; is in't?
Eg. If we want to find every third record in a Dataset then
we can use the _n_ as follows
Data new-sas-data-set;
Set old;
if mod(_n_,3)= 0 then;
run;
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / mani
The automatic
variable _n_ counts iterations of the DATA step.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / mahesh
Its an automatic variable.it shows no. of iterations gone
through in datastep.
Is This Answer Correct ? | 0 Yes | 0 No |
What does a PROC TRANSPOSE do?
Hot to suppress characters from a given string?
I have a SCD Type 2 Dimention for Location In which A Sales Office in Having two Surrogate Keys just because of the change in it's Sales Group. SKey SalesGroup Sales Office BeginDate EndDate 280 SG1 SO1 01APR2000 01APR2010 281 SG2 SO1 02APR2010 31MAR2999 Now while loading the Fact, the Lookup ir returning SKey 280 for records before and after 01APR2010. I am not able to give WHERE condition in the Lookup Properties (TranDate between BeginDate and EndDate). Please help.
What is criteria for adverse events and treatment-emergent adverse events?
i have a data set with 20 observations i want label from 8 to 15 observations ? how you create this one.
What is your favorite all time computer book? Why?
how to remove duplicates using proc sql?
Why do we use QUIT commmand for proc datasets and proc sql ???
how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming
How to test the debugging in sas?
what is enterprise guide? What is the use of it? : Sas programming
what the use of proc glm