<?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: How to get column names from an external excel file to an existing data set? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/251726#M47610</link>
    <description>Thanks alot for your suggestion. I just overlooked this fact of keeping a tab on variable length n all. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Tue, 23 Feb 2016 06:23:13 GMT</pubDate>
    <dc:creator>james_alive</dc:creator>
    <dc:date>2016-02-23T06:23:13Z</dc:date>
    <item>
      <title>How to get column names from an external excel file to an existing data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249581#M46972</link>
      <description>&lt;P&gt;I have an existing data set prepared from an external csv file(file1) (csv file has no headings), with column names as var1, var2, var3, so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the column names, I have a different excel file (file2), can anybody help me with how to get the column names from file2 into existing dataset (created from file1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS: New to SAS env. Any help will be highly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 03:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249581#M46972</guid>
      <dc:creator>james_alive</dc:creator>
      <dc:date>2016-02-12T03:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get column names from an external excel file to an existing data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249597#M46975</link>
      <description>The easiest is usually to get the names during import, from the header of the file. Perhaps if you could save your Excel as csv, and then import them in one go.&lt;BR /&gt;Similar option is to import the Excel file, and the use SQL INSERT INTO (just be 100% sure of the variable order).&lt;BR /&gt;Otherwise, you may need to build some kind of macro logic.</description>
      <pubDate>Fri, 12 Feb 2016 06:28:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249597#M46975</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-12T06:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get column names from an external excel file to an existing data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249599#M46976</link>
      <description>&lt;P&gt;Thanks for the prompt response but however I have 29 data files that are not having header.&lt;/P&gt;&lt;P&gt;the 30th file is having headers for all the above 29 data files and header details are listed in the below format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FileName - Table1&lt;/P&gt;&lt;P&gt;Field11 &amp;nbsp;Description11&lt;/P&gt;&lt;P&gt;Field12 &amp;nbsp;Description12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FileName - Table2&lt;/P&gt;&lt;P&gt;Field21 &amp;nbsp;Description21&lt;/P&gt;&lt;P&gt;Field22 &amp;nbsp;Description22&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you understand this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only solution that I can think of is renaming the variables while preparing the dataset. Otherthan this I have no other clue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see if any sample macro you can provide which caters this scenario.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 06:35:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249599#M46976</guid>
      <dc:creator>james_alive</dc:creator>
      <dc:date>2016-02-12T06:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get column names from an external excel file to an existing data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249605#M46979</link>
      <description>What I see is a data step that reads your variable name data set. Based on the values in that, use call execute to either directly issue proc datasets code,  or call a macro with parameters.  And then the macro have the proc datasets logic. These methods are equal, but calling a macro is imo more readible.</description>
      <pubDate>Fri, 12 Feb 2016 07:15:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249605#M46979</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-12T07:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get column names from an external excel file to an existing data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249614#M46982</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/72937"&gt;@james_alive&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for the prompt response but however I have 29 data files that are not having header.&lt;/P&gt;
&lt;P&gt;the 30th file is having headers for all the above 29 data files and header details are listed in the below format:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FileName - Table1&lt;/P&gt;
&lt;P&gt;Field11 &amp;nbsp;Description11&lt;/P&gt;
&lt;P&gt;Field12 &amp;nbsp;Description12&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FileName - Table2&lt;/P&gt;
&lt;P&gt;Field21 &amp;nbsp;Description21&lt;/P&gt;
&lt;P&gt;Field22 &amp;nbsp;Description22&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope you understand this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only solution that I can think of is renaming the variables while preparing the dataset. Otherthan this I have no other clue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see if any sample macro you can provide which caters this scenario.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does Description include useful information like data type and informat?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 09:08:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249614#M46982</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-02-12T09:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get column names from an external excel file to an existing data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249738#M47001</link>
      <description>&lt;P&gt;A &lt;STRONG&gt;very&lt;/STRONG&gt; similar topic is in this thread&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Provided-Headers-vs-Provided-Dataset-without-Headers/m-p/249533" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Provided-Headers-vs-Provided-Dataset-without-Headers/m-p/249533&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it may contain some helpful hints.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if you separately proc&amp;nbsp;import 30 datasets that should be the same you face a very real possibility of having some variables as characte in some sets and numeric in others, or the lengths of character variables being incompatible. So you may have more work ahead than just renaming columns, especially if your next step involved combining any of these sets.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 16:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/249738#M47001</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-02-12T16:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get column names from an external excel file to an existing data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/251390#M47493</link>
      <description>&lt;P&gt;Description here means, the descriptive text for file. for eg,&lt;/P&gt;&lt;P&gt;filename1 - File is used to calculate the annual premium&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2016 08:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/251390#M47493</guid>
      <dc:creator>james_alive</dc:creator>
      <dc:date>2016-02-21T08:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get column names from an external excel file to an existing data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/251439#M47505</link>
      <description>You could write the required code to read all the data files, in a data step that reads the column names file.&lt;BR /&gt;Unless that colunn names file provides column data types ( like date format/ string length/ or numeric) your generated code would need to read all as strings.&lt;BR /&gt;It should be possible</description>
      <pubDate>Sun, 21 Feb 2016 22:32:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/251439#M47505</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2016-02-21T22:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get column names from an external excel file to an existing data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/251726#M47610</link>
      <description>Thanks alot for your suggestion. I just overlooked this fact of keeping a tab on variable length n all. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 23 Feb 2016 06:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-column-names-from-an-external-excel-file-to-an/m-p/251726#M47610</guid>
      <dc:creator>james_alive</dc:creator>
      <dc:date>2016-02-23T06:23:13Z</dc:date>
    </item>
  </channel>
</rss>

