<?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 proc import a text file containing just one line in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-proc-import-a-text-file-containing-just-one-line/m-p/966034#M45932</link>
    <description>&lt;P&gt;You rarely need (or want) to use PROC IMPORT to read a delimited text file.&amp;nbsp; And for a file like that it goes triple.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just READ the file.&lt;/P&gt;
&lt;P&gt;You could read it into multiple observations if you are not sure how many values are on the line.&lt;/P&gt;
&lt;P&gt;First lets convert your example into a FILE so we have something to program against.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename have temp;
options parmcards=have;
parmcards;
PB.PXDWXBX.SEDWVPAB.MP0|2918951|255186908|
;;;;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now just run a normal SAS data step to read in the file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile have dsd dlm='|';
  var+1;
  input value :$20. @@;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results&lt;/P&gt;
&lt;PRE&gt;Obs    var    value

 1      1     PB.PXDWXBX.SEDWVPAB.
 2      2     2918951
 3      3     255186908
 4      4

&lt;/PRE&gt;</description>
    <pubDate>Thu, 08 May 2025 01:41:12 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-05-08T01:41:12Z</dc:date>
    <item>
      <title>How to proc import a text file containing just one line</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-proc-import-a-text-file-containing-just-one-line/m-p/966021#M45929</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a text file like that:&amp;nbsp;&amp;nbsp;PB.PXDWXBX.SEDWVPAB.MP0|2918951|255186908|&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let path1=/****/control/  ;

proc import datafile = "&amp;amp;path1./control/be_MAR2025_premcntrlfile.txt'
 out = classic_control_file
 dbms = dlm
 replace
 ;
 delimiter = '|';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have tried the above sas code and I am getting the error:&amp;nbsp;Unable to sample external file, no data in first 5 records.&amp;nbsp;ERROR: Import unsuccessful. See SAS Log for details&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to solve that issue&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 20:46:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-proc-import-a-text-file-containing-just-one-line/m-p/966021#M45929</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2025-05-07T20:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to proc import a text file containing just one line</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-proc-import-a-text-file-containing-just-one-line/m-p/966025#M45930</link>
      <description>&lt;P&gt;You probably just need GETNAMES=NO;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename FT15F001 temp;
parmcards;
PB.PXDWXBX.SEDWVPAB.MP0|2918951|255186908|
;;;;

proc import datafile=Ft15F001 out=test dbms=csv;
   getnames=no;
   delimiter='|';
   run;

proc print;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 373px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106797iB14B68414BD85F07/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 21:28:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-proc-import-a-text-file-containing-just-one-line/m-p/966025#M45930</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2025-05-07T21:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to proc import a text file containing just one line</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-proc-import-a-text-file-containing-just-one-line/m-p/966032#M45931</link>
      <description>&lt;P&gt;Is this "one line" file supposed to have more than one observation?&lt;/P&gt;
&lt;P&gt;I ask because there are some files that do not use end of line or carriage controls as record delimiters and Proc Import is likely not to be the tool to read such.&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 01:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-proc-import-a-text-file-containing-just-one-line/m-p/966032#M45931</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-05-08T01:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to proc import a text file containing just one line</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-proc-import-a-text-file-containing-just-one-line/m-p/966034#M45932</link>
      <description>&lt;P&gt;You rarely need (or want) to use PROC IMPORT to read a delimited text file.&amp;nbsp; And for a file like that it goes triple.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just READ the file.&lt;/P&gt;
&lt;P&gt;You could read it into multiple observations if you are not sure how many values are on the line.&lt;/P&gt;
&lt;P&gt;First lets convert your example into a FILE so we have something to program against.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename have temp;
options parmcards=have;
parmcards;
PB.PXDWXBX.SEDWVPAB.MP0|2918951|255186908|
;;;;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now just run a normal SAS data step to read in the file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile have dsd dlm='|';
  var+1;
  input value :$20. @@;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results&lt;/P&gt;
&lt;PRE&gt;Obs    var    value

 1      1     PB.PXDWXBX.SEDWVPAB.
 2      2     2918951
 3      3     255186908
 4      4

&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 May 2025 01:41:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-proc-import-a-text-file-containing-just-one-line/m-p/966034#M45932</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-05-08T01:41:12Z</dc:date>
    </item>
  </channel>
</rss>

