<?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 Using Loop to create data columns in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Using-Loop-to-create-data-columns/m-p/66821#M19084</link>
    <description>I need to create a data set from scratch.  &lt;BR /&gt;
&lt;BR /&gt;
I need to create some year columns that goes from 1999-2003 then skips a year till 2007.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
My data set should look like this&lt;BR /&gt;
y1999 y2000 y 2001 y2002 y2003 y2005 y2007&lt;BR /&gt;
&lt;BR /&gt;
Is this possible?&lt;BR /&gt;
&lt;BR /&gt;
I'm not sure if this is the correct path to take but I have a table that has a variable that has all the years for a product.  Some products have some of the years and some have all.  I'm trying to find the best way to display that data in a matrix.&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your help</description>
    <pubDate>Tue, 24 Aug 2010 14:59:13 GMT</pubDate>
    <dc:creator>jerry898969</dc:creator>
    <dc:date>2010-08-24T14:59:13Z</dc:date>
    <item>
      <title>Using Loop to create data columns</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-Loop-to-create-data-columns/m-p/66821#M19084</link>
      <description>I need to create a data set from scratch.  &lt;BR /&gt;
&lt;BR /&gt;
I need to create some year columns that goes from 1999-2003 then skips a year till 2007.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
My data set should look like this&lt;BR /&gt;
y1999 y2000 y 2001 y2002 y2003 y2005 y2007&lt;BR /&gt;
&lt;BR /&gt;
Is this possible?&lt;BR /&gt;
&lt;BR /&gt;
I'm not sure if this is the correct path to take but I have a table that has a variable that has all the years for a product.  Some products have some of the years and some have all.  I'm trying to find the best way to display that data in a matrix.&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your help</description>
      <pubDate>Tue, 24 Aug 2010 14:59:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-Loop-to-create-data-columns/m-p/66821#M19084</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2010-08-24T14:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Loop to create data columns</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-Loop-to-create-data-columns/m-p/66822#M19085</link>
      <description>Look at PROC TRANSPOSE to convert a "vertical" observation oriented SAS file to a "horizontal" column oriented SAS file.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
proc transpose site:sas.com</description>
      <pubDate>Tue, 24 Aug 2010 15:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-Loop-to-create-data-columns/m-p/66822#M19085</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-08-24T15:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using Loop to create data columns</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-Loop-to-create-data-columns/m-p/66823#M19086</link>
      <description>creating the columns needs no loop, just a simple statement like:[pre]   length y1999 -y2003 y2005 y2007 ;[/pre]defines the columns but does not dynamically construct or fill the columns based on the data. For that, use Scott's method - proc transpose&lt;BR /&gt;
 &lt;BR /&gt;
good luck&lt;BR /&gt;
peterC</description>
      <pubDate>Tue, 24 Aug 2010 15:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-Loop-to-create-data-columns/m-p/66823#M19086</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-08-24T15:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using Loop to create data columns</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-Loop-to-create-data-columns/m-p/66824#M19087</link>
      <description>Thank you both so much for all your help.&lt;BR /&gt;
&lt;BR /&gt;
The length statement did what I wanted.  Thanks&lt;BR /&gt;
&lt;BR /&gt;
The proc tranpose actually corrected a different issue I was having.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks again for the quick and awesome help.</description>
      <pubDate>Tue, 24 Aug 2010 15:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-Loop-to-create-data-columns/m-p/66824#M19087</guid>
      <dc:creator>jerry898969</dc:creator>
      <dc:date>2010-08-24T15:46:15Z</dc:date>
    </item>
  </channel>
</rss>

