I am new to SAS I have SAS data like (It does not contain Obs column)
Obs ID Name Score1 Score2 Score3
1 101 90 95 98
2 203 78 77 75
3 223 88 67 75
4 280 68 87 75
.
.
.
.
100 468 78 77 75
I want data having row number 2 6 8 10 34. Output should look like
Obs ID Name Score1 Score2 Score3
1 203 78 77 75
2 227 88 67 75
3 280 68 87 75
.
.
.
Thanks in advance.
The other answer is ok for small tables, but if you are working with a very large table it's inefficient as it reads every row in the table to see whether it has the right row number. Here's a more direct approach:
data example;
do i = 2, 6, 8, 10;
set sashelp.class point = i;
output;
end;
stop;
run;
This picks out just the rows you actually want and doesn't read all the others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With