Solved
Contributor
Posts: 52

# Help with a data step -

I have two data sets.  One is automatically generated with a time stamp every second.  The other is field notes of the time where a load is observed to begin, thus establishing a control point.  I want to assign all points after that control point its load number until the next control point.

can anyone suggest a simple way to do this?

in essence I need the following

 seconds control point load number 12566 0 . 12567 0 . 12568 0 . 12569 1 1 12570 0 . 12571 0 . 12572 0 . 12573 0 . 12574 0 . 12575 0 . 12576 0 . 12577 0 . 12578 0 . 12579 0 . 12580 0 . 12581 0 . 12582 1 2 12583 0 . 12584 0 . 12585 0 . 12586 0 . 12587 0 . 12588 0 .

to become this

 seconds control point load number 12566 0 . 12567 0 . 12568 0 . 12569 1 1 12570 0 1 12571 0 1 12572 0 1 12573 0 1 12574 0 1 12575 0 1 12576 0 1 12577 0 1 12578 0 1 12579 0 1 12580 0 1 12581 0 1 12582 1 2 12583 0 2 12584 0 2 12585 0 2 12586 0 2 12587 0 2 12588 0 2

Accepted Solutions
Solution
‎05-01-2013 12:12 PM
Contributor
Posts: 52

## Re: Help with a data step -

Aha!

set a;

run;

maybe someone can explain what "(drop=loadx)" is doing

that is not my common usage of "retain" which I've always used to reorder columns.

All Replies
Super User
Posts: 23,700

## Re: Help with a data step -

retain control_point 0;

Contributor
Posts: 52

## Re: Help with a data step -

And thank you for that as well... I'll try it.

Solution
‎05-01-2013 12:12 PM
Contributor
Posts: 52

## Re: Help with a data step -

Aha!

set a;

run;

maybe someone can explain what "(drop=loadx)" is doing

that is not my common usage of "retain" which I've always used to reorder columns.

Super User
Posts: 23,700

## Re: Help with a data step -

drops it from the final data set.

🔒 This topic is solved and locked.