ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Data Warehouse >> SAS
 
 


 

 
 Teradata interview questions  Teradata Interview Questions (184)
 Business Objects interview questions  Business Objects Interview Questions (756)
 Cognos interview questions  Cognos Interview Questions (853)
 Informatica interview questions  Informatica Interview Questions (1626)
 Crystal Enterprise Suite interview questions  Crystal Enterprise Suite Interview Questions (29)
 Actuate interview questions  Actuate Interview Questions (35)
 Ab Initio interview questions  Ab Initio Interview Questions (172)
 Data Stage interview questions  Data Stage Interview Questions (565)
 SAS interview questions  SAS Interview Questions (561)
 Micro Strategy interview questions  Micro Strategy Interview Questions (37)
 ETL interview questions  ETL Interview Questions (196)
 Data Warehouse General interview questions  Data Warehouse General Interview Questions (216)
Question
What is _n_?
 Question Submitted By :: SAS
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
it gives the Number of iterations. 
Is This Answer Correct ?    79 Yes 15 No
Suresh
 
Answer
# 2
_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 ?    53 Yes 1 No
Chandra Sekar
 
 
 
Answer
# 3
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 ?    31 Yes 10 No
Vijay
 
Answer
# 4
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 ?    4 Yes 1 No
Mallikarjuna Raju
 
Answer
# 5
_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 ?    2 Yes 0 No
Yadi Acho
 
Answer
# 6
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 ?    2 Yes 1 No
Amaran
 
Answer
# 7
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
Ragivenk189
 
Answer
# 8
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
Rajesh
 
Answer
# 9
Can i used _n_ in proc sql; Or its only for Datasteo 
Is This Answer Correct ?    0 Yes 1 No
Guest
 
Answer
# 10
It is an automaic variable created during datastep
processing. And it show how many no of time it has iterated
datastep.
 
Is This Answer Correct ?    1 Yes 3 No
Vemula
 

 
 
 
Other SAS Interview Questions
 
  Question Asked @ Answers
 
There is a field containing a date. It needs to be displayed in the format "ddmonyy" if it's before 1975, "dd mon ccyy" if it's after 1985, and as 'Disco Years' if it's between 1975 and 1985. How would you accomplish this in data step code? Using only PROC FORMAT D&B 8
sas implimented companies in hyderabad CTS 11
for report generation which one you used proc report or data_null_? Accenture 3
what is Difference between PROC SQL JOINS and MERGE? Accenture 3
how do u test a pros sql(works or not) without executing it? HSBC 1
What procedure you used to calculate p-value? Accenture 2
Hi, I have one dataset, could you please ans for this. id amount paid_amount 1 700 400 2 900 250 3 300 300 a 400 250 b 500 320 c 800 650 x 200 190 y 900 250 z 300 180 i want create new dataset having id and paid_amount who are paid high amount comparing amount. ex: 1d paid_amount 3 300 c 650 x 190   2
firstobs and obs are working only option wise,but we are using infile statement with firstobs and obs in a statement wise? so firstobs,obs working at options and statemnts or not?   1
Can you excute a macro within a macro? Describe.   3
How would you code the criteria to restrict the output to be produced? Accenture 6
what other SAS features do you use for error trapping and data validation?   3
how to rearrange the data as our wish by using dataset block? Cognizent 4
 
For more SAS Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com