<?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: Missing variable name after .dat import in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Missing-variable-name-after-dat-import/m-p/811511#M320097</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/236266"&gt;@ChuksManuel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi programmers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I imported a .dat file in SAS and the variable name (column name) is missing and replaced by VAR1, VAR2, VAR3 etc. Is there any reason for this?&lt;/P&gt;
&lt;P&gt;I have attached my import code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;PROC IMPORT DATAFILE = "C:/Users/data_NEW.dat"
OUT = form_Q3
DBMS = DLM REPLACE;
DELIMITER="|";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChuksManuel_0-1651682422857.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71142iB87F95ADEA70EDE8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChuksManuel_0-1651682422857.png" alt="ChuksManuel_0-1651682422857.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes. PROC IMPORT is too stupid to read header lines that are longer than 32K bytes.&lt;/P&gt;
&lt;P&gt;You could try:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Add the names back yourself by reading the first row as data and using it to generate a RENAME statement.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Write your own data step to read that delimited text file.&amp;nbsp; Then you have complete control over the names and the types and whether any formats or labels need to be attached to the variables.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Use a tool to guess how to read the file that can read the whole header line.&amp;nbsp; Like :&amp;nbsp;&lt;A href="https://github.com/sasutils/macros/blob/master/csv2ds.sas" target="_blank"&gt;https://github.com/sasutils/macros/blob/master/csv2ds.sas&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Wed, 04 May 2022 16:52:23 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-05-04T16:52:23Z</dc:date>
    <item>
      <title>Missing variable name after .dat import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-variable-name-after-dat-import/m-p/811505#M320091</link>
      <description>&lt;P&gt;Hi programmers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I imported a .dat file in SAS and the variable name (column name) is missing and replaced by VAR1, VAR2, VAR3 etc. Is there any reason for this?&lt;/P&gt;&lt;P&gt;I have attached my import code&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;PROC IMPORT DATAFILE = "C:/Users/data_NEW.dat"
OUT = form_Q3
DBMS = DLM REPLACE;
DELIMITER="|";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChuksManuel_0-1651682422857.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71142iB87F95ADEA70EDE8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChuksManuel_0-1651682422857.png" alt="ChuksManuel_0-1651682422857.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 16:43:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-variable-name-after-dat-import/m-p/811505#M320091</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2022-05-04T16:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Missing variable name after .dat import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-variable-name-after-dat-import/m-p/811510#M320096</link>
      <description>&lt;P&gt;Show us a portion of the input data file.&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 16:49:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-variable-name-after-dat-import/m-p/811510#M320096</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-04T16:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: Missing variable name after .dat import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-variable-name-after-dat-import/m-p/811511#M320097</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/236266"&gt;@ChuksManuel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi programmers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I imported a .dat file in SAS and the variable name (column name) is missing and replaced by VAR1, VAR2, VAR3 etc. Is there any reason for this?&lt;/P&gt;
&lt;P&gt;I have attached my import code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;PROC IMPORT DATAFILE = "C:/Users/data_NEW.dat"
OUT = form_Q3
DBMS = DLM REPLACE;
DELIMITER="|";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChuksManuel_0-1651682422857.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71142iB87F95ADEA70EDE8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChuksManuel_0-1651682422857.png" alt="ChuksManuel_0-1651682422857.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes. PROC IMPORT is too stupid to read header lines that are longer than 32K bytes.&lt;/P&gt;
&lt;P&gt;You could try:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Add the names back yourself by reading the first row as data and using it to generate a RENAME statement.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Write your own data step to read that delimited text file.&amp;nbsp; Then you have complete control over the names and the types and whether any formats or labels need to be attached to the variables.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Use a tool to guess how to read the file that can read the whole header line.&amp;nbsp; Like :&amp;nbsp;&lt;A href="https://github.com/sasutils/macros/blob/master/csv2ds.sas" target="_blank"&gt;https://github.com/sasutils/macros/blob/master/csv2ds.sas&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 04 May 2022 16:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-variable-name-after-dat-import/m-p/811511#M320097</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-05-04T16:52:23Z</dc:date>
    </item>
  </channel>
</rss>

