<?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: Importing Text File in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Importing-Text-File/m-p/184499#M46923</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can &lt;STRONG&gt;proc import&lt;/STRONG&gt; on a very easy way.&lt;/P&gt;&lt;P&gt;I suggest you this publication: simple, and clear:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.ats.ucla.edu/stat/sas/faq/read_delim.htm" style="font-size: 10pt; line-height: 1.5em;" title="http://www.ats.ucla.edu/stat/sas/faq/read_delim.htm"&gt;SAS FAQ: How do I read in a file that uses commas, tabs or spaces as delimiters to separate variables in SAS?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you can also refer to the complete and official documentation:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/techsup/technote/ts673.pdf" title="http://support.sas.com/techsup/technote/ts673.pdf"&gt;http://support.sas.com/techsup/technote/ts673.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Nov 2014 20:13:34 GMT</pubDate>
    <dc:creator>JuanS_OCS</dc:creator>
    <dc:date>2014-11-24T20:13:34Z</dc:date>
    <item>
      <title>Importing Text File</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-Text-File/m-p/184498#M46922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a .txt file that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Advanced Breast Center|Carr.&amp;nbsp;&amp;nbsp; 14 KM 72.2|Plaza Milliangie||Cayey|PR|00736|787738-8077|787735-0718&lt;/P&gt;&lt;P&gt;Advanced Diagnostic Imaging Center, LLC|1728 Village Park Dr.|||Orangeburg|SC|29118|803536-1106|803535-6033&lt;/P&gt;&lt;P&gt;Advanced Diagnostic Radiology, LLC|952 Seton Dr.|||Cumberland|MD|21502|301777-3522|301777-1902&lt;/P&gt;&lt;P&gt;Advanced Imaging|35 Batavia City Centre Main St|||Batavia|NY|14020|585345-9729|585345-9823&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it looks like it is "|" delimited, and I also have this information- Fields Name and Field Length:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="table table-bordered table-condensed align-top table-elastic" style="margin: 1.1875em 0; border: 1px solid #dddddd; font-size: 0.875em; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background-color: #ffffff;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;Facility Name&lt;/TD&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;75&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;Address 1&lt;/TD&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;Address 2&lt;/TD&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;Address 3&lt;/TD&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;City&lt;/TD&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;State&lt;/TD&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;Zip Code&lt;/TD&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;Phone&lt;/TD&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;Fax&lt;/TD&gt;&lt;TD style="padding: 5px; border: 1px solid #dddddd;"&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I import this into SAS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 19:30:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-Text-File/m-p/184498#M46922</guid>
      <dc:creator>acros</dc:creator>
      <dc:date>2014-11-24T19:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Text File</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-Text-File/m-p/184499#M46923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can &lt;STRONG&gt;proc import&lt;/STRONG&gt; on a very easy way.&lt;/P&gt;&lt;P&gt;I suggest you this publication: simple, and clear:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.ats.ucla.edu/stat/sas/faq/read_delim.htm" style="font-size: 10pt; line-height: 1.5em;" title="http://www.ats.ucla.edu/stat/sas/faq/read_delim.htm"&gt;SAS FAQ: How do I read in a file that uses commas, tabs or spaces as delimiters to separate variables in SAS?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But you can also refer to the complete and official documentation:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/techsup/technote/ts673.pdf" title="http://support.sas.com/techsup/technote/ts673.pdf"&gt;http://support.sas.com/techsup/technote/ts673.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 20:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-Text-File/m-p/184499#M46923</guid>
      <dc:creator>JuanS_OCS</dc:creator>
      <dc:date>2014-11-24T20:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Text File</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-Text-File/m-p/184500#M46924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Copy your simple variable definitions and paste them into your program editor and turn them into a LENGTH statement.&amp;nbsp; The basically will involve adding the keyword LENGTH before, editing the names to be valid SAS variable names (getting rid of the embedded spaces), add a $ before the length for character strings (for numeric variables don't add the $ but do convert the "length" to 8 since SAS stores all numbers as 8 byte floating point numbers) and add a semicolon on the end.&amp;nbsp; Then just use it in a simple DATA step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; want ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;FacilityName $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;75&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Address1 $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;50&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Address2 $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;50&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Address3 $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;50&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;City $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;50&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;State $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;2&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;ZipCode $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;15&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Phone $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;50&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;Fax $&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;50&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'myfile.txt'&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;dsd&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple; background: white;"&gt;'|'&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;lrecl&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;400&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; FacilityName -- Fax ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 20:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-Text-File/m-p/184500#M46924</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-11-24T20:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Text File</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-Text-File/m-p/184501#M46925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amazing! So simple. Thanks, Tom!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 21:58:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-Text-File/m-p/184501#M46925</guid>
      <dc:creator>acros</dc:creator>
      <dc:date>2014-11-24T21:58:22Z</dc:date>
    </item>
  </channel>
</rss>

