<?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 Re: Keeping a range of column names in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Keeping-a-range-of-column-names/m-p/435157#M108061</link>
    <description>Hi Astounding,&lt;BR /&gt;&lt;BR /&gt;Thanks alot. The '--' code was what I was looking for.</description>
    <pubDate>Thu, 08 Feb 2018 03:29:47 GMT</pubDate>
    <dc:creator>njwmeme</dc:creator>
    <dc:date>2018-02-08T03:29:47Z</dc:date>
    <item>
      <title>Keeping a range of column names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-a-range-of-column-names/m-p/434038#M107687</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am reading my data source from Excel. It has columns from 1 to 28, 29, 30, 31 and MTD(Month to date). Excel files will have different columns depending on the current month's days.&lt;/P&gt;&lt;P&gt;Will need help on the (keep=) function. Is there any code I can use to keep a range of columns like from 1 to MTD? So it will take whichever columns in between. Columns are numeric and characters&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 03:23:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-a-range-of-column-names/m-p/434038#M107687</guid>
      <dc:creator>njwmeme</dc:creator>
      <dc:date>2018-02-05T03:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping a range of column names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-a-range-of-column-names/m-p/434040#M107689</link>
      <description>&lt;P&gt;First, you need to import the data into a SAS data set.&amp;nbsp; Afterwards, you can consider how to subset the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The easiest way would be if you know the variable name assigned to the first column.&amp;nbsp; Then you could code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have (keep=firstcol--MTD);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, you would have to substitute the actual name of the first column for "firstcol".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't know the name of the first column, there are ways to get macro language to do this.&amp;nbsp; But that solution would be far beyond your current knowledge of SAS.&amp;nbsp; I could program it (not that lengthy), but you would have to take it on faith that it would give the correct answer repeatedly ... so only to be used if necessary.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 03:30:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-a-range-of-column-names/m-p/434040#M107689</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-05T03:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping a range of column names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-a-range-of-column-names/m-p/434219#M107738</link>
      <description>&lt;P&gt;1. Read in your data&lt;/P&gt;
&lt;P&gt;2. Transpose it to a long format&lt;/P&gt;
&lt;P&gt;3. Implement the filter required which is much easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/79161"&gt;@njwmeme&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am reading my data source from Excel. It has columns from 1 to 28, 29, 30, 31 and MTD(Month to date). Excel files will have different columns depending on the current month's days.&lt;/P&gt;
&lt;P&gt;Will need help on the (keep=) function. Is there any code I can use to keep a range of columns like from 1 to MTD? So it will take whichever columns in between. Columns are numeric and characters&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank You.&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 15:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-a-range-of-column-names/m-p/434219#M107738</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-05T15:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping a range of column names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-a-range-of-column-names/m-p/435157#M108061</link>
      <description>Hi Astounding,&lt;BR /&gt;&lt;BR /&gt;Thanks alot. The '--' code was what I was looking for.</description>
      <pubDate>Thu, 08 Feb 2018 03:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-a-range-of-column-names/m-p/435157#M108061</guid>
      <dc:creator>njwmeme</dc:creator>
      <dc:date>2018-02-08T03:29:47Z</dc:date>
    </item>
  </channel>
</rss>

