<?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: If Column names are same THEN ADD suffix instead of var1,var2 etc proc import in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-Column-names-are-same-THEN-ADD-suffix-instead-of-var1-var2/m-p/867165#M42658</link>
    <description>&lt;P&gt;If the source file was a text file of any sort, such as CSV or tab delimited then Proc Import wrote data step code in the log.&lt;/P&gt;
&lt;P&gt;Copy the code from the Log, clean up such as remove line numbers. Search an replace with the editor "var1" to what ever name you want. This is the best way if you are going to read multiple files with the same structure. Save the code and then when you have the next file change in the input file name and the output data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also write Proc Data sets code to rename the variables in place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Import has no options that will let you modify the names. Typically I see "Var1" when one of two things happens: 1) there is not column header to use for a variable name or 2) the header is longer than 32 characters long and matches another column heading for the first 32 characters.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 03:28:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2023-03-30T03:28:42Z</dc:date>
    <item>
      <title>If Column names are same THEN ADD suffix instead of var1,var2 etc proc import</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-Column-names-are-same-THEN-ADD-suffix-instead-of-var1-var2/m-p/867163#M42656</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello everyone&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;At the moment i used import data from file-&amp;gt; importdata to bring data into work lib&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I believe that is the reason why created suffix eg: goal,goal_0001,goal_0002 etc&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But when i use proc import it gives var1,var2 for duplicated columns can any one let me know how to stop this and give me suffix eg: goal_0001 instead of var1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 03:21:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-Column-names-are-same-THEN-ADD-suffix-instead-of-var1-var2/m-p/867163#M42656</guid>
      <dc:creator>sai_12</dc:creator>
      <dc:date>2023-03-30T03:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: If Column names are same THEN ADD suffix instead of var1,var2 etc proc import</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-Column-names-are-same-THEN-ADD-suffix-instead-of-var1-var2/m-p/867165#M42658</link>
      <description>&lt;P&gt;If the source file was a text file of any sort, such as CSV or tab delimited then Proc Import wrote data step code in the log.&lt;/P&gt;
&lt;P&gt;Copy the code from the Log, clean up such as remove line numbers. Search an replace with the editor "var1" to what ever name you want. This is the best way if you are going to read multiple files with the same structure. Save the code and then when you have the next file change in the input file name and the output data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also write Proc Data sets code to rename the variables in place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Import has no options that will let you modify the names. Typically I see "Var1" when one of two things happens: 1) there is not column header to use for a variable name or 2) the header is longer than 32 characters long and matches another column heading for the first 32 characters.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 03:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-Column-names-are-same-THEN-ADD-suffix-instead-of-var1-var2/m-p/867165#M42658</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-03-30T03:28:42Z</dc:date>
    </item>
  </channel>
</rss>

