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 is sas and what are the functions? : Sas-administrator
What is the difference between proportion and average?
How could i automate the code in the scenario:Every month one new data set will be created for that perticular month transaction list.Now i would like to update the data in the source table by appending every month data automatically. jan---set jan; feb---set jan feb; mar---set jan mar;
How did you use the round function?give an example(don't say it will round to the nearest intger) eg1:round(84.55,.1) =84.6 eg2:round(92.64,.1)=92.6,How it is happening like this tell me the logic,that is how the round function works when we have deimal values?
How to Rename Library?
How many missing values are available? When might you use them?
what is the difference between floor and ceil functions in sas? : Sas-administrator
describe about joins? briefly?
Is it possible to do sorting tranformation in charecter variable??if can tell me one eg..
I have a dataset with variables empid and doj how to calculate retirement age?
How do you add a number to a macro variable?
How to create an external dataset with sas code?