<?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 read txt file with appropriate format to variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/read-txt-file-with-appropriate-format-to-variables/m-p/693411#M211437</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Attached is the "president.txt" file.&lt;/P&gt;&lt;P&gt;I need to assign appropriate format to DOB (5th column), votes (7th column), and PercVote (8th column).&lt;/P&gt;&lt;P&gt;Here is my code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me to correct the code? Thanks a lot.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename TXTfile '/folders/myfolders/Assignment 2/President.txt';

data President;
     infile TXTfile missover;
     input FullName &amp;amp; $22.
     
     
           City $19.
           State $20. 
           ASP 2.
           DOB mmddyy10.
           Term 4.
           Votes comma10. 
           PercVote percent10.;
     format DOB mmddyy10. Votes comma10. PercVote percent10.;
run;

proc print data = President;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 22 Oct 2020 07:24:49 GMT</pubDate>
    <dc:creator>KyuL</dc:creator>
    <dc:date>2020-10-22T07:24:49Z</dc:date>
    <item>
      <title>read txt file with appropriate format to variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-txt-file-with-appropriate-format-to-variables/m-p/693411#M211437</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Attached is the "president.txt" file.&lt;/P&gt;&lt;P&gt;I need to assign appropriate format to DOB (5th column), votes (7th column), and PercVote (8th column).&lt;/P&gt;&lt;P&gt;Here is my code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone help me to correct the code? Thanks a lot.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename TXTfile '/folders/myfolders/Assignment 2/President.txt';

data President;
     infile TXTfile missover;
     input FullName &amp;amp; $22.
     
     
           City $19.
           State $20. 
           ASP 2.
           DOB mmddyy10.
           Term 4.
           Votes comma10. 
           PercVote percent10.;
     format DOB mmddyy10. Votes comma10. PercVote percent10.;
run;

proc print data = President;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2020 07:24:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-txt-file-with-appropriate-format-to-variables/m-p/693411#M211437</guid>
      <dc:creator>KyuL</dc:creator>
      <dc:date>2020-10-22T07:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: read txt file with appropriate format to variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-txt-file-with-appropriate-format-to-variables/m-p/693441#M211438</link>
      <description>&lt;P&gt;I copied your file to my UE, and ran this code with success:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
infile '/folders/myfolders/President.txt' expandtabs lrecl=300 truncover;
input
  @1 FullName $22.    
  @25 City $19.
  @49 State &amp;amp; $20. 
  ASP :2.
  DOB :mmddyy10.
  Term :4.
  Votes :comma10. 
  PercVote :percent10.
;
format DOB mmddyy10. Votes comma10. PercVote percent10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Oct 2020 09:20:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-txt-file-with-appropriate-format-to-variables/m-p/693441#M211438</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-22T09:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: read txt file with appropriate format to variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-txt-file-with-appropriate-format-to-variables/m-p/693444#M211440</link>
      <description>&lt;P&gt;I ran successfully too. Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 09:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-txt-file-with-appropriate-format-to-variables/m-p/693444#M211440</guid>
      <dc:creator>KyuL</dc:creator>
      <dc:date>2020-10-22T09:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: read txt file with appropriate format to variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-txt-file-with-appropriate-format-to-variables/m-p/693448#M211442</link>
      <description>&lt;P&gt;Please feel free to ask about details if something is unclear.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 09:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-txt-file-with-appropriate-format-to-variables/m-p/693448#M211442</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-22T09:47:58Z</dc:date>
    </item>
  </channel>
</rss>

