ALLInterview.com :: Home Page KalAajKal.com
 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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Data Warehouse  >>  SAS
 
 


 

 
 Teradata interview questions  Teradata Interview Questions
 Business Objects interview questions  Business Objects Interview Questions
 Cognos interview questions  Cognos Interview Questions
 Informatica interview questions  Informatica Interview Questions
 Crystal Enterprise Suite interview questions  Crystal Enterprise Suite Interview Questions
 Actuate interview questions  Actuate Interview Questions
 Ab Initio interview questions  Ab Initio Interview Questions
 Data Stage interview questions  Data Stage Interview Questions
 SAS interview questions  SAS Interview Questions
 Micro Strategy interview questions  Micro Strategy Interview Questions
 ETL interview questions  ETL Interview Questions
 Data Warehouse General interview questions  Data Warehouse General Interview Questions
Question
There are 200 observations in a dataset, i want to pull out
the observation no's 100, 150,180,190 by using Proc SQL? How
you can get it?
 Question Submitted By :: Koti
I also faced this Question!!     Rank Answer Posted By  
 
  Re: There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,190 by using Proc SQL? How you can get it?
Answer
# 1
Proc Sql;
Select * from <dataset name>
where _n_ in (100,150,180,190);
quit;
 
Is This Answer Correct ?    6 Yes 14 No
Vipin Choudhary
 
  Re: There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,190 by using Proc SQL? How you can get it?
Answer
# 2
Proc Sql;
Select *,monotonic ()as c from <datasetname>
group by a having c in (100,150,180,190);
quit;
 
Is This Answer Correct ?    13 Yes 3 No
Limnesh
 
 
 
  Re: There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,190 by using Proc SQL? How you can get it?
Answer
# 3
Before saying answer is not correct, please try this
Data f;
 do i=1 to 200;
 output;
 end; 
run;

Proc Sql;
Select *,monotonic ()as c from f
group by i having c in (100,150,180,190);
quit;

Proc print;
run;
 
Is This Answer Correct ?    2 Yes 0 No
Limnesh Dominic
 
  Re: There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,190 by using Proc SQL? How you can get it?
Answer
# 4
* Setup test data;
data test;
do i=1 to 200;
j=ranuni(i);
output;
end;
run;

Proc Sql;
Select *,monotonic ()as c from test
having c in (100,150,180,190);
quit;
 
Is This Answer Correct ?    3 Yes 0 No
Jim
 
  Re: There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,190 by using Proc SQL? How you can get it?
Answer
# 5
PROC SQL;
SELECT*,
MONOTONIC() AS COUNT
FROM TEST
HAVING COUNT IN(100,150,180,190);
QUIT;
 
Is This Answer Correct ?    3 Yes 1 No
Pranoy Tikadar
 

 
 
 
Other SAS Interview Questions
 
  Question Asked @ Answers
 
what is pdv? how it is related to input buffer in sas? Satyam4
in which companies SAS openings are there? List of companies using SAS technology.  4
Do you think professionally? Oracle1
why is the use of Retrive statement and give me with example? ME1
What is difference between (a-z) and (a--z) Accenture5
IS SAS COMPILER OR INTERPRETER? EXPLAIN? HSBC2
How to select the observations randomly from a SAS dataset  5
Does SAS ‘Translate’ (compile) or does it ‘Interpret’? Explain. Accenture4
data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.  1
What do you feel about hardcoding? Pfizer3
is there any differnce between proc means and proc summary?  2
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 its between 1975 and 1985. How would you accomplish this in data step code? Using only PROC FORMAT. CTS3
how can you code the confidence intervals? Ranbaxy5
what is the difference between proc report and proc format? CTS5
data study; input Subj : $3. Group : $1. Dose : $4. Weight : $8. Subgroup; x= input(Weight,5.1); datalines; 001 A Low 220 2 002 A High 90 1 003 B Low 193.6 1 004 B High 165 2 005 A Low 123.4 1 ; Why does X get truncated? X shows up as 22 instead of 220,9 instead of 90 and 19.8 instead of 198? This problem doesnt happen with the values 193.6 and 123.4. This does not happen if x is read on the 5. informat instead of the 5.1 informat  2
When looking for data contained in a character string of 150 bytes, which function is the best to locate that data: scan, index, or indexc? Accenture2
What has been your most common programming mistake? Wipro4
How would you code the criteria to restrict the output to be produced? Accenture5
Identify statements whose placement in the DATA step is critical. Accenture5
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? Accenture9
 
For more SAS Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com