|
Additional: to dress out the missings, add:
option missing=' ';
Mark
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Terjeson, Mark
Sent: Tuesday, June 17, 2008 9:12 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Any idea on how to insert blank lines after each id?
Hi Judy,
Here is one crude approach:
data sample;
input id A $ B $;
cards;
1 a1 b1
1 a2 b2
2 a1 b1
2 a3 b3
10 a9 b3
10 a9 b2
;
run;
data result(drop=i);
set sample;
by id;
output;
if last.id then
do;
id=.; A=''; B='';
do i = 1 to 5;
output;
end;
end;
run;
Hope this is helpful.
Mark Terjeson
Senior Programmer Analyst
Investment Management & Research
Russell Investments
Russell Investments
Global Leaders in Multi-Manager Investing
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Judy
Sent: Tuesday, June 17, 2008 8:46 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Any idea on how to insert blank lines after each id?
The original dataset
id A B
1 a1 b1
1 a2 b2
2 a1 b1
2 a3 b3
......
10 a9 b3
10 a9 b2
I would like to insert 5 blank lines after each different ID to make
it look like this:
id A B
1 a1 b1
1 a2 b2
2 a1 b1
2 a3 b3
......
10 a9 b3
10 a9 b2
Thanks a lot,
Judy
|