<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Expanding data in SAS in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Expanding-data-in-SAS/m-p/837#M45</link>
    <description>Hello, I am pretty new to SAS and was wondering if someone&lt;BR /&gt;
could help me with the following:&lt;BR /&gt;
&lt;BR /&gt;
I have sample data set as follows:&lt;BR /&gt;
&lt;BR /&gt;
name  start_week end_week&lt;BR /&gt;
----- ---------- --------&lt;BR /&gt;
andy      3         8&lt;BR /&gt;
cindy     4         6&lt;BR /&gt;
jess      1         5&lt;BR /&gt;
&lt;BR /&gt;
and I want to create a data as follows from the above data set.&lt;BR /&gt;
&lt;BR /&gt;
name week&lt;BR /&gt;
---- ----&lt;BR /&gt;
andy 3&lt;BR /&gt;
andy 4&lt;BR /&gt;
andy 5&lt;BR /&gt;
andy 6&lt;BR /&gt;
andy 7&lt;BR /&gt;
andy 8&lt;BR /&gt;
cindy 4&lt;BR /&gt;
cindy 5&lt;BR /&gt;
cindy 6&lt;BR /&gt;
jess 1&lt;BR /&gt;
jess 2&lt;BR /&gt;
jess 3&lt;BR /&gt;
jess 4&lt;BR /&gt;
jess 5&lt;BR /&gt;
&lt;BR /&gt;
Any ideas are greatly appreciated!&lt;BR /&gt;
&lt;BR /&gt;
Thanks very much!&lt;BR /&gt;
Kushi_Wije</description>
    <pubDate>Wed, 14 Jun 2006 03:43:02 GMT</pubDate>
    <dc:creator>kushi_wije</dc:creator>
    <dc:date>2006-06-14T03:43:02Z</dc:date>
    <item>
      <title>Expanding data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Expanding-data-in-SAS/m-p/837#M45</link>
      <description>Hello, I am pretty new to SAS and was wondering if someone&lt;BR /&gt;
could help me with the following:&lt;BR /&gt;
&lt;BR /&gt;
I have sample data set as follows:&lt;BR /&gt;
&lt;BR /&gt;
name  start_week end_week&lt;BR /&gt;
----- ---------- --------&lt;BR /&gt;
andy      3         8&lt;BR /&gt;
cindy     4         6&lt;BR /&gt;
jess      1         5&lt;BR /&gt;
&lt;BR /&gt;
and I want to create a data as follows from the above data set.&lt;BR /&gt;
&lt;BR /&gt;
name week&lt;BR /&gt;
---- ----&lt;BR /&gt;
andy 3&lt;BR /&gt;
andy 4&lt;BR /&gt;
andy 5&lt;BR /&gt;
andy 6&lt;BR /&gt;
andy 7&lt;BR /&gt;
andy 8&lt;BR /&gt;
cindy 4&lt;BR /&gt;
cindy 5&lt;BR /&gt;
cindy 6&lt;BR /&gt;
jess 1&lt;BR /&gt;
jess 2&lt;BR /&gt;
jess 3&lt;BR /&gt;
jess 4&lt;BR /&gt;
jess 5&lt;BR /&gt;
&lt;BR /&gt;
Any ideas are greatly appreciated!&lt;BR /&gt;
&lt;BR /&gt;
Thanks very much!&lt;BR /&gt;
Kushi_Wije</description>
      <pubDate>Wed, 14 Jun 2006 03:43:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Expanding-data-in-SAS/m-p/837#M45</guid>
      <dc:creator>kushi_wije</dc:creator>
      <dc:date>2006-06-14T03:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Expanding-data-in-SAS/m-p/838#M46</link>
      <description>data work.start;&lt;BR /&gt;
infile cards;&lt;BR /&gt;
input name $1-8 start_week end_week ;&lt;BR /&gt;
cards;&lt;BR /&gt;
andy    3 8&lt;BR /&gt;
cindy   4 6&lt;BR /&gt;
jess    1 5&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data work.finish(rename=(start_week=week));&lt;BR /&gt;
set work.start;&lt;BR /&gt;
do while(start_week&amp;lt;=end_week);&lt;BR /&gt;
output;&lt;BR /&gt;
start_week+1;&lt;BR /&gt;
end;&lt;BR /&gt;
drop end_week;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 14 Jun 2006 19:38:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Expanding-data-in-SAS/m-p/838#M46</guid>
      <dc:creator>kkid</dc:creator>
      <dc:date>2006-06-14T19:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Expanding-data-in-SAS/m-p/839#M47</link>
      <description>Or you could do this, which is easier to read (probably):&lt;BR /&gt;
&lt;BR /&gt;
data work.finish(drop=start_week end_week);&lt;BR /&gt;
  set work.start;&lt;BR /&gt;
&lt;BR /&gt;
  do week=start_week to end_week;&lt;BR /&gt;
    output;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 06 Jul 2006 08:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Expanding-data-in-SAS/m-p/839#M47</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-07-06T08:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Expanding data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Expanding-data-in-SAS/m-p/840#M48</link>
      <description>you essentially want to transpose your data from horizontal to vertical.  You can use Proc Transpose and ask it to transpose start &amp;amp; end week by name.</description>
      <pubDate>Thu, 26 Oct 2006 11:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Expanding-data-in-SAS/m-p/840#M48</guid>
      <dc:creator>JohnH</dc:creator>
      <dc:date>2006-10-26T11:02:59Z</dc:date>
    </item>
  </channel>
</rss>

