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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to limit decimal places for the variable using proc means?

1002


how does sas handle missing values in assignment statements? : Sas programming

971


what is the function of catx syntax? : Sas-administrator

1047


If you use a symput in a data step, when and where can you use the macro variable? : sas-macro

1015


what are the scrubbing procedures in sas? : Sas programming

1228


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

987


What are symget and symput? : sas-macro

1245


I am preparing SAS Certified Advanced Programmer for SAS 9 in 2014. If anybody has the latest dumps for this exam, please mail me at dhiman.mukherjee@gmail.com

2656


I have a dataset concat having variable a b & c. How to rename a b to e & f?

964


Explain what Proc glm does?

1115


if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...

1349


What is the difference between match merge and one to one merge?

1155


What is the length assigned to the target variable by the scan function?

1098


how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?

2706


Can you execute a macro within a macro? Describe. : sas-macro

1070