On Wed, 4 Jul 2007 23:11:03 -0700, D Neal <mathisfun@HOTMAIL.COM> wrote:
>I have an easy question. I've got a dataset that has patient id and a
visit
>date and I need to export it to a flat text file that lists the patient id
>and then each of the visit dates on a new row. I've done something very
>similar to this in the past but I can't find my code (or even come up with
>the right key words to search for it). Basically what I have is a dataset
>that looks like:
>ID DATE
>1 1/1/2007
>1 1/2/2007
>2 1/1/2007
>2 2/1/2007
>etc.....
>
>and it needs to be a flat text file reshaped to:
>
>1
>1/1/2007
>1/2/2007
>2
>1/1/2007
>2/1/2007
>etc....
>
>Any help/hints would be greatly appreciated.
>
>David Neal
>
Hi, guess you can't find it 'cause it's so small? :-)
Just sort by and set by id, something like
12 data _null_;
13 format date date9.;
14 set one;
15 by id;
16 if first.id then put id;
17 put date;
18 run;
1
01JAN2007
01FEB2007
2
01JAN2007
02JAN2007
Rgds, A
|
|
0
|
|
|
|
Reply
|
sko (123)
|
7/5/2007 6:29:05 AM |
|