DATA Step, Macro, Functions and more

DATA Step

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

DATA Step

[ Edited ]

hi all,

 

i have 10 observations in dataset A, now i want like 2,4,6,8 and 10th observations to be pushed to dataset B.

any help would be appreciated.


Accepted Solutions
Solution
‎08-25-2016 02:06 AM
Respected Advisor
Posts: 3,124

Re: DATA Step


All Replies
Solution
‎08-25-2016 02:06 AM
Respected Advisor
Posts: 3,124

Re: DATA Step

if mod(_n_,2)=0;

Super User
Super User
Posts: 7,413

Re: DATA Step

Why, what logical reason is there to take every other observation, I mean if new data comes in they might not be the same observations.  Work out a logical approach to idnetify consistently the data items you need, by using data identifiers, not some random position in a dataset.

Super User
Posts: 17,905

Re: DATA Step


RW9 wrote:

Why, what logical reason is there to take every other observation, I mean if new data comes in they might not be the same observations.  Work out a logical approach to idnetify consistently the data items you need, by using data identifiers, not some random position in a dataset.


It's a common intro interview question. 

New Contributor
Posts: 3

Re: DATA Step

i jus wanna try crazy stuffs in sas  and no such logics behind it.!!





☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 356 views
  • 5 likes
  • 4 in conversation