What is _n_?

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


Please Help Members By Posting Answers For Below Questions

Hi Jeevan/Akshara I have tried to contact SASI Vats for latest Advanced SAS Programming Certification Dumps (A00-212) but have not got any response. I would highly and gratefully appreciate your assistance in this regard. If you guys have access to this, would you be kind enough to forward it to me ? I would abide by all the terms you have for this. Please, note my email id: upretigopi@yahoo.com Preti Sharma

3052


Give some examples where proc report’s defaults are different than proc print’s defaults?

585


What do the PUT and INPUT functions do?

770


hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?

1656


Explain data step in SAS

623






explain the difference between proc means and proc summary?

663


How to include or exclude specific variables in a data set?

636


how to do user inputs and command line arguments in sas?

2422


List out some key concept of SAS

617


Are you involved in writing the inferential analysis plan? Tables specifications?

3474


What is the basic syntax of a sas program?

659


Mention sas system options to debug sas macros.

657


What are the new features included in the new version of SAS Programming Language?

731


How to convert a numeric variable to a character variable?

626


how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming

594