<?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: IMPORT TXT FILE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-TXT-FILE/m-p/823587#M325201</link>
    <description>&lt;P&gt;Hey, man&lt;/P&gt;&lt;P&gt;I am having troubles with my dataset. I'm getting a invalid option name INPUT. Help would be appreciated...&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jul 2022 23:13:13 GMT</pubDate>
    <dc:creator>scottyniven</dc:creator>
    <dc:date>2022-07-15T23:13:13Z</dc:date>
    <item>
      <title>IMPORT TXT FILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-TXT-FILE/m-p/651033#M195275</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am doing export of SASHELP.CARS data set into txt file.&lt;/P&gt;
&lt;P&gt;Then I want to import it using infile statement and also I want to control the columns names .&lt;/P&gt;
&lt;P&gt;However, as you can see in the result of import there is a problem.&lt;/P&gt;
&lt;P&gt;The original columns names are in the data set ..&lt;/P&gt;
&lt;P&gt;what&amp;nbsp; is the way to solve it please?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/***export to txt file with column headers*/
proc export data=sashelp.cars
outfile="/path/cars.txt" 
dbms=tab
replace;
run;

/*Import*/
data cars; 
infile  "/path/cars.txt"  dlm='09'X dsd truncover;
input Carmake :$50.
      Carmodel  :$50.
	  Cartype :$50.
	  origin  :$50.
	  DriveTrain :$50.
	  MSRP 
	  InvoiceNumber 
	  EngineSize 
	  NumberCylinders
	  HP
	  MPG_In_City
	  MPG_In_Highway
	  CarWeight
	  Wheelbase	;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 May 2020 10:43:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-TXT-FILE/m-p/651033#M195275</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-05-27T10:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT TXT FILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-TXT-FILE/m-p/651037#M195276</link>
      <description>&lt;P&gt;Okay, I found the solution.&lt;/P&gt;
&lt;P&gt;Need to use firstobs=2&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars; 
infile "/path/carstbl1.txt" 
		 firstobs=2
        dlm='09'X dsd truncover;
input Carmake :$50.
      Carmodel  :$50.
	  Cartype :$50.
	  origin  :$50.
	  DriveTrain :$50.
	  MSRP : $8.
	  InvoiceNumber  : $8.
	  EngineSize 
	  NumberCylinders
	  HP
	  MPG_In_City
	  MPG_In_Highway
	  CarWeight
	  Wheelbase	;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 May 2020 11:00:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-TXT-FILE/m-p/651037#M195276</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-05-27T11:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT TXT FILE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-TXT-FILE/m-p/823587#M325201</link>
      <description>&lt;P&gt;Hey, man&lt;/P&gt;&lt;P&gt;I am having troubles with my dataset. I'm getting a invalid option name INPUT. Help would be appreciated...&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 23:13:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-TXT-FILE/m-p/823587#M325201</guid>
      <dc:creator>scottyniven</dc:creator>
      <dc:date>2022-07-15T23:13:13Z</dc:date>
    </item>
  </channel>
</rss>

