Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

If you were told to create many records from one record, show how you would do this using array and with proc transpose?

1538


What are the parameters of scan function?

1214


How would you invoke a macro? : sas-macro

1181


What do the mod and int function do? : Sas programming

1292


What does proc print, and proc contents are used for?

1214


how to generate the test data in sas without input data? : Sas-administrator

1172


Explain proc univariate?

1101


Can you explain the process of calendar?

1154


Do you need to compute new variables? If so,should you do this before you execute the report-writing procedure?

1956


Of all your work, where have you been the most successful?

4712


What are the features of base sas system?

1109


How will you use the WHO Drug Dictionary for Reporting Clinical Trials?

2394


Explain the main difference between the sas procedures and functions? : Sas-administrator

1110


How do you use the do loop if you don’t know how many times you should execute the do loop?

1295


Explain how you can debug and test your SAS program?

1048