|
Hi Toby
I was able to use SQL to spread values across. Now, I have a slightly
different case.
data x;
input @1 pt 1. @ 3 bor 1. @5 cradt date7.;
cards;
1 . 01JAN04
1 1 01FEB04
1 2 15FEB04
1 1 01MAR04
2 1 01APR04
2 . 01MAY04
2 . 01JUN04
2 1 01JUL04
2 2 01AUG04
2 . 01SEP04
2 2 01OCT04
;
RUN;
say, I need to create two variables BORDT and BORDTC
where BORDT=CRADT for the first occurrence of BOR=2 and BORDTC=CRADT
for
the second occurrence of BOR=2 OR 1
so that my output would look like this
PT BOR CRADT BORDT BORDTC
1 . 01JAN04
1 1 01FEB04
1 2 15FEB04 15FEB04
1 1 01MAR04 01MAR04
2 1 01APR04
2 . 01MAY04
2 . 01JUN04
2 1 01JUL04
2 2 01AUG04 01AUG04
2 . 01SEP04
2 2 01OCT04 01OCT14
Thank you all for your help as always
MK
|