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 |
How to merge the data using merge statement and proc format? Is the result is same ?
How would you code the criteria to restrict the output to be produced?
In which format does Date stores in sas..? What is the use of DATE in SAS.?
What is connection profile? : sas-grid-administration
Define run-group processing?
What are all the problems you faced while validating tables and reports?
0 Answers Accenture, Quintiles,
do you need to know if there are any missing values? : Sas programming
what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi
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
How to read multiple excel sheets from a single excel file at once????
7 Answers HCL, Verinon Technology Solutions,
Describe a time when you were really stuck on a problem and how you solved it?
what is the Population you used in your project, is it ITT or PP?
0 Answers Accenture, Quintiles,