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
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 |
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 |
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 |
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 |
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 |
what is option year cuttoff in sas
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?
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?
What sas features do you use to check errors and data validation?
what is data governance? : Sas-di
i have a dataset with var1,var2,var3; i want to upload the titles for the variables . How can we?
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?
what is Difference between PROC SQL JOINS and MERGE?
How would you create multiple observations from a single observation?
Explain translate function?
how can u convert this 25-jul-2010 from numeric to charcter?