printing - how to print odd numbered observations from a dataset SAS -


i have simple question, unfortunately cannot seem solve myself. how print observations odd observation number data set?

one way might data step view. assuming have data set named "mysasdata", try this:

data my_view / view=my_view;    set mysasdata;    if mod(_n_,2) = 1; run; proc print data=my_view; run; 

if wanted "even" observations, use if mod(_n_,2) = 0;. however, note observation numbers displayed proc print relative view , not original data set.

data step views useful things this.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -