LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (May 1999, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 3 May 1999 19:01:04 -0400
Reply-To:     Jeff Gropp <jgropp1@MSN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Jeff Gropp <jgropp1@MSN.COM>
Subject:      DO statement

Me again!! I have a question.... I only want every other (or ever third, or every fourth) observation in a data set. If the data set contains sasyears =, i.e., 1928,1929,...1997 etc..., is there someway to submit a "DO" statement that is of form:

DO sasyear = 1928 to 1997 by 2;.......end;

and get the same results? An example follows: I have a data set of the following form:

sasyear id x 1930 1 23 1931 1 67 1932 1 25 1933 1 33 1934 1 89 1935 1 98 1936 1 32 1937 1 36 1938 1 43 1939 1 64 ........ .... ...... ........ .... ...... ........ .... ...... 1930 2 56 1931 2 67 1932 2 87 1933 2 32 1934 2 98 1935 2 22 1936 2 31 1937 2 56 1938 2 88 1939 2 61 ........ .... ...... ........ .... ...... ........ .... ......

and what I want is:

sasyear id x 1930 1 23 1933 1 33 1936 1 32 1939 1 64 ........ .... ...... ........ .... ...... ........ .... ...... 1930 2 56 1933 2 32 1936 2 31 1939 2 61 ........ .... ...... ........ .... ...... ........ .... ......

Jeff


Back to: Top of message | Previous page | Main SAS-L page