<?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: Problem with var name turn to &amp;quot;_&amp;quot; when import in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/545409#M150875</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The problem is that each time of import, the number of column changes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will check my data again.&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;</description>
    <pubDate>Sat, 23 Mar 2019 02:14:49 GMT</pubDate>
    <dc:creator>hhchenfx</dc:creator>
    <dc:date>2019-03-23T02:14:49Z</dc:date>
    <item>
      <title>Problem with var name turn to "_" when import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/544436#M150563</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;I import a csv file with the following first row:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Project_name,Labor Category,Location,Project Type,Pay Code,,,,,,,,,,,,,,,,Totals&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS takes all column name up to Pay Code correct. Then column name turn to&lt;STRONG&gt; "&lt;FONT color="#FF0000"&gt;_&lt;/FONT&gt;"&lt;/STRONG&gt;, then correctly assign VAR7, VAR8... VAR20, Totals&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why my VAR6 turn to "_" ? Please help me to fix.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
	proc import datafile="C:\\_temp\15days.csv"
	out=Utime dbms=csv replace; getnames=yes;run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Mar 2019 03:54:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/544436#M150563</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2019-03-20T03:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with var name turn to "_" when import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/544437#M150564</link>
      <description>&lt;P&gt;Please check if there's an embedded blank or some kind in the variable name &lt;STRONG&gt;where proc import pads with _&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 04:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/544437#M150564</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-20T04:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with var name turn to "_" when import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/544438#M150565</link>
      <description>&lt;P&gt;I see 20 commas in that line. So it looks like you have 21 columns.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What names do you WANT SAS to use for the columns that don't have headers?&lt;/P&gt;
&lt;PRE&gt;Project_name,Labor Category,Location,Project Type,Pay Code,,,,,,,,,,,,,,,,Totals&lt;/PRE&gt;
&lt;P&gt;If you have a simple text file then just write your own data step to read it. No need to use PROC IMPORT and force SAS to guess what is in the file.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 04:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/544438#M150565</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-20T04:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with var name turn to "_" when import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/544453#M150572</link>
      <description>&lt;P&gt;Write your own data step and avoid the guessing of proc import.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 07:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/544453#M150572</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-03-20T07:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with var name turn to "_" when import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/545409#M150875</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The problem is that each time of import, the number of column changes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will check my data again.&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2019 02:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/545409#M150875</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2019-03-23T02:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with var name turn to "_" when import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/545420#M150880</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/49486"&gt;@hhchenfx&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The problem is that each time of import, the number of column changes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will check my data again.&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;P&gt;HHCFX&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How are you going to handle this variation? Not sure if PROC IMPORT helps that much, the resulting datasets are still going be different if the input files are different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a pattern to the variation?&amp;nbsp; For example perhaps the number of columns represents the number of samples taken or the number of days or months of measurement.&amp;nbsp; If there is a pattern then you can write a SAS program to handle the files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Share examples of the text files, just enough lines (and columns) to show the pattern.&amp;nbsp; &lt;STRONG&gt;Paste the lines of the file into the editor using the pop-up window you get when you click on the {i} (insert code) button on the editor menu bar.&lt;/STRONG&gt; That will prevent the forum editor from treating the data as words and sentences and messing up the formatting.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2019 03:33:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/545420#M150880</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-03-23T03:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with var name turn to "_" when import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/545421#M150881</link>
      <description>&lt;P&gt;Thanks, Tom.&lt;/P&gt;
&lt;P&gt;I will do it.&lt;/P&gt;
&lt;P&gt;HHC&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2019 03:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-with-var-name-turn-to-quot-quot-when-import/m-p/545421#M150881</guid>
      <dc:creator>hhchenfx</dc:creator>
      <dc:date>2019-03-23T03:39:06Z</dc:date>
    </item>
  </channel>
</rss>

