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


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?

Answers were Sorted based on User's Feedback



There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,..

Answer / limnesh

Proc Sql;
Select *,monotonic ()as c from <datasetname>
group by a having c in (100,150,180,190);
quit;

Is This Answer Correct ?    20 Yes 5 No

There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,..

Answer / limnesh dominic

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 ?    15 Yes 0 No

There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,..

Answer / jim

* 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 ?    8 Yes 0 No

There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,..

Answer / pranoy tikadar

PROC SQL;
SELECT*,
MONOTONIC() AS COUNT
FROM TEST
HAVING COUNT IN(100,150,180,190);
QUIT;

Is This Answer Correct ?    11 Yes 3 No

There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,..

Answer / vipin choudhary

Proc Sql;
Select * from <dataset name>
where _n_ in (100,150,180,190);
quit;

Is This Answer Correct ?    12 Yes 29 No

Post New Answer

More SAS Interview Questions

what is option year cuttoff in sas

2 Answers   L&T,


Baseline definition in your study

3 Answers   Accenture, Quintiles,


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

0 Answers  


Can you continue to write code while the rest of the people on the floor where you work have a noisy party to which you were not invited?

2 Answers   Oracle,


What sas features do you use to check errors and data validation?

0 Answers  


what is data governance? : Sas-di

0 Answers  


i have a dataset with var1,var2,var3; i want to upload the titles for the variables . How can we?

1 Answers   GSK,


I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a different functionality. In my program I use bot these data sets. How do I specify which Age variable I want to use?

6 Answers  


what is Difference between PROC SQL JOINS and MERGE?

3 Answers   Accenture, Wipro,


How would you create multiple observations from a single observation?

1 Answers   Quintiles,


Explain translate function?

0 Answers  


how can u convert this 25-jul-2010 from numeric to charcter?

3 Answers  


Categories