Date: Wed, 9 Jul 2008 22:29:09 -0700
Reply-To: Patrick <patrick.matter@GMX.CH>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Patrick <patrick.matter@GMX.CH>
Organization: http://groups.google.com
Subject: Re: covvert cell content into rows and columns
Content-Type: text/plain; charset=ISO-8859-1
May be something like that?
data example;
array cols {3} $20 col1-col3;
var="Less than a year,1.25 day per month of service,;1-2,15 days,;
3-12,20 days,3;13-21,25 days,6;22-27,30 days,2;28+,35 days,";
RowNum=1;
RowString=scan(var,RowNum,';');
do while(RowString ne '');
do ColNum=1 to dim(cols);
cols{ColNum}=scan(RowString,ColNum,',');
end;
output;
RowNum+1;
RowString=scan(var,RowNum,';');
end;
run;
proc print;
run;
|