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 the difference between an informat and a format. Name three informats or formats.
describe about metadata object? : Sas-di
how many types prompting framework can be broken down to? : Sas-bi
how do i get last 10obs from a dataset when we don't know about the number of obsevations in that dataset?
What are the new features included in the new version of SAS Programming Language?
Compare sas with other data analytics tools.
in ods is there any lib's
What is the purpose of trailing @ and @@? How do you use them?
What is interleaving in SAS?
name the scheduler for scheduling job and explain the scheduler? : Sas-di
Name and describe three SAS functions that you have used, if any?
What function CATX syntax does?