Sunday, July 12, 2009

How to determine 'even' and 'odd' observations in a dataset

Well ,lets create a ds ‘two’ having only even numbered obs from ds ‘one’ .

/* create sample data set */
data one;
do i=1 to 10;
output;
end;
run;


data two;
set one;
if mod(i,2)=0 then output;/*outputs only even obs*/
run;

proc print;
run;

/* RESULTS */
Obs i
1 2
2 4
3 6
4 8
5 10

Send link to --

TopBlogDir.blogspot.com button Education Blog Directory Academic,  Learning & Educational Blogs - Blog Catalog Blog Directory SEO Court Directory myblog Visit blogadda.com to discover Indian blogs Add to Technorati Favorites Subscribe with Bloglines DigNow.net

Join My Community at MyBloglog!

Free Web Directory - Add Your Link
The Little Web Directory
Monster Directory A List Sites