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_?

Answers were Sorted based on User's Feedback



What is _n_?..

Answer / sru

The value of _N_ represents the number of times the DATA
step has iterated

Is This Answer Correct ?    23 Yes 2 No

What is _n_?..

Answer / raghu

This is a data counter variable used in SAS.

..Raghu

Is This Answer Correct ?    14 Yes 3 No

What is _n_?..

Answer / 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

What is _n_?..

Answer / cutepa1

Almost all the above answers are right, except one or few.
Here I provide a clear insight into _n_ variable. This is an
automatic variable of PDV(Program Data Vector) that returns
the no. of observations that it has iterated. There are
such variables like _error_, end=, in=, first.by-variabke,
last.by-variable,etc.. All these variables will not be
displayed in the target output.
Ex:
data new;
set ora.emp;
if _n_ >= 2 and _n_ <= 6 then output;
run;
/* as _n_ returns 'n'th observation our statement is to save
those obs when _n_ returns the value between 2 and 6. Hence
the 5 obs of the specified dataset between second and six
are saved into 'new'.

Is This Answer Correct ?    7 Yes 0 No

What is _n_?..

Answer / hymad

this option is used to pick up n number of observation from
particular dataset

Is This Answer Correct ?    7 Yes 3 No

What is _n_?..

Answer / vijaibhaskar

_ n_ give no.of times data step is itereated .it gives
correct observations nos only if IF SUBSET IS NOT USED in
the datastep

Is This Answer Correct ?    4 Yes 0 No

What is _n_?..

Answer / madhavi

_n_ is a automatic variable created by SAS.we can use this
like we use any variable that we created ourselfs and it
indicates the number of times SAS has looped through the
data step.

Is This Answer Correct ?    4 Yes 0 No

What is _n_?..

Answer / arun

IT IS AUTOMATIC VARIABLE SHOWS NUMBER OF ITERATIONS.

Is This Answer Correct ?    4 Yes 1 No

What is _n_?..

Answer / suresh b anisetty

_n_ is a automatic variable the function of _n_ is how many
times the data step begins to execute.

Is This Answer Correct ?    3 Yes 1 No

What is _n_?..

Answer / yuva

its an automatic variable.it shows no. of iterations gone
through in datastep

Is This Answer Correct ?    3 Yes 2 No

Post New Answer

More SAS Interview Questions

what is null hypothesis? why do you consider that?

0 Answers   Accenture, Quintiles,


What is the command used to find missing values?

0 Answers  


what is the difference between proc means and proc summary?

2 Answers   Accenture,


data abc; input x y ; cards; 1 2 5 6 7 8 7 8 1 7 5 7 ; run; Proc Freq data=abc; tables x*y / chisq nopercent nocol norow PLCORR; RUN; If we run the code, we have Polychoric Correlation = 0.9054 in the last table. I want to extract this particular entry with the value. Means I will create one dataset in which this value will be stored/extracted. I need your help in coding this. Please help me out.

2 Answers  


how will you location sas platform applications available from web browser? : Sas-bi

0 Answers  


i have one dataset data l; input name: $ 25; cards; manoj is a good boy to krishna krishna is a god boy to malli malli is good boy to ramana ques: here i want "manoj" observations nubers

3 Answers   SAS,


i have a dataset with 100000 records. i want 100 records from that dataset and create a dataset.we need to pick the observations random order like 100obs,500obs,1020obs,1890obs,2565obs like that i need 100 obs in random order? how can we create this one?

5 Answers   L&T,


name several ways to achieve efficiency in your program? : Sas programming

0 Answers  


how to write code for left outer join in SAs using datastep?

8 Answers   CitiGroup,


If you have a data set that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variable?

16 Answers  


Explain proc univariate?

0 Answers  


Which are the statements whose placement in the data step is critical?

0 Answers  


Categories