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

it gives the Number of iterations.

Is This Answer Correct ?    91 Yes 15 No

What is _n_?..

Answer / chandra sekar

_N_ gives the record number. You can access any record in
the dataset using _N_ if you know the record number. It is
set as 1 for the first record and incremented for every
subsequent record. It is an automatic variable and is not
visible when you open a dataset. This can also be used to
subset a data. For ex, if you want to access the first 100
records then you can say "if _N_ <= 100".

Is This Answer Correct ?    63 Yes 2 No

What is _n_?..

Answer / vijay

suresh is write.
_n_ : gives the number of times SAS system looped through a
data step

Sudheer's answer is for _error_ :
_error_ : gives value of 0 or 1 depending on it is error or
not..if it is an error _error_ value will be 1 else 0

Is This Answer Correct ?    35 Yes 10 No

What is _n_?..

Answer / yadi acho

_n_ is auto number drive in SAS...

if use fro data step look like this

data test1;
set test;
test_field=_n_;
run;

diferent if auto number for SQL procedure u can use this

proc sql;
create table test1 as
select *,monotonic() as test_field
from test;
quit;

cheers!!

Is This Answer Correct ?    4 Yes 0 No

What is _n_?..

Answer / mallikarjuna raju

This is an automatic variable of PDV that returns the no of
observations that it has iterated.There are such variables
like _Error_,end=,in=,first.by-variable,last.by-variable,..etc
All these variables will not be displayed in the target output.
Ex:
Data new;
set <existed>;
if _n_>=2 and <=6 then output;

Is This Answer Correct ?    5 Yes 2 No

What is _n_?..

Answer / amaran

Can i used _n_ in proc sql; Or its only for Datasteo

_n_ is a Autometic variable created in a datastep. It is a
part of PDV. It is used to store the iteration count of the
Input statement.

Proc SQL doesnot create a PDV. so _n_ variable cannot be
used there.

Is This Answer Correct ?    3 Yes 1 No

What is _n_?..

Answer / manjula

It returns number of observation to iterations

Is This Answer Correct ?    1 Yes 0 No

What is _n_?..

Answer / ragivenk189

It acts like a pointer and can be used to subset your data
set _n_=10 in data step will force SAS to process the data
until first 10 observations

Is This Answer Correct ?    0 Yes 0 No

What is _n_?..

Answer / rajesh

Compiling time of the program in PDV automatically some
variables will generate, like _N_ and _Error_, _numeric_
_N_ will give the observation in the program. by default
_N_ value is 0, after compiling it will chage according to
the observations in the program.

Is This Answer Correct ?    2 Yes 3 No

What is _n_?..

Answer / guest

Can i used _n_ in proc sql; Or its only for Datasteo

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SAS Interview Questions

what are the best practices to process the large data sets in sas programming? : Sas-administrator

0 Answers  


What is the difference between Regression and Logistic Regression? Can u explain the Assumptions/Conditions?

3 Answers  


Have you used macros? For what purpose you have used? : sas-macro

0 Answers  


Name and describe few sas character functions that are used for data cleaning in brief.

0 Answers  


Dear all, proc means data=dsn noprint completetypes; class trtmntgroup /preloadfmt; output out=tot n=n; format trtmntgroup trtf. ; by vstgrp descending severity; run; This is the code I used for AE table. I got the values without giving the variable ‘trtmntgroup(numeric)’ in var statement. And if I give the var statement for that variable i’m getting the same values.How is that possible? What is the difference between class and var statement? Could any one explain me how does proc means work at the back end. And what is the difference between _freq_ value and N value in proc means. Thanks and regards, Rajesh.

1 Answers  


How we can call macros with in data step? : sas-macro

0 Answers  


How would you invoke a macro? : sas-macro

0 Answers  


what is the use of catalog?

1 Answers   Cognizant,


What is the maximum length of the macro variable? : sas-macro

0 Answers  


WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?

0 Answers   Satyam,


Mention what is SAS data set?

0 Answers  


Which function is used to count the number of intervals between two sas dates?

0 Answers  


Categories