Answer Posted / ravi
This is nothing but a implict variable created by SAS during
data processing. It gives the total number of records SAS
has iterated in a dataset. It is Available only for data
step and not for procs.
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)= 1 then;
run;
Note: If we use a where clause to subset the _n_ will not
yield the required result.
| Is This Answer Correct ? | 13 Yes | 3 No |
Post New Answer View All Answers
what is SAS OPTIMIZATION?
How would you include common or reuse to be processed along with your statements?
How to limit decimal places for the variable using proc means?
How do you use the do loop if you don’t know how many times you should execute the do loop?
How does the internal authentication work in sas? : sas-grid-administration
What are the ways in which macro variables can be created in sas programming?
What are the special input delimiters used in SAS?
What is the difference between INPUT and INFILE ?
Mention sas system options to debug sas macros.
If money were no object, what would you like to do?
what is sas application server, database server, sas olap server and sas metadata server? : Sas-di
Which command is used to save logs in the external file?
for what purpose would you use the retain statement? : Sas programming
What is SAS? What are the functions does it performs?
Explain substr function?