Cap2010,
When you say RowID what do you mean? Do you nean the row number? In other words what information are you looking for? If its the number of observations there are easier ways. You can use the Proc contents for that info or you could use the attrn function. This function needs to be used with the open/closed functions. Let me know.
Klaz
Cap2010,
You seem to like SQL. You can always use the datasep for this type of algorithm and there are many shortcuts that you may use. Since you want the SQL option why not use the following logic.
proc sql;
delete * from tt4 where mod(rowid,2) gt 0;
quit;
This will get you all the even rowid's (since you're deleting the odd rowid's).
Hope this helps you out.
Klaz
You can always use a function to determine if the row is odd or even, off the top of my head you want to look up the MOD function which returns the remainder from a division. If you mod your row number with 2 and there is a remainder of 1, then the number is odd, if the result is 0 then the number is even.
Would also recommend not deleting the records but sending them to a separate dataset so as to be able to report on/check the results.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.