<?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 Import CSV with complex text variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-with-complex-text-variable/m-p/373612#M89390</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to import a CSV file which is pipe delimited.&lt;/P&gt;&lt;P&gt;I am having trouble when it comes to the text field, for some reason SAS appears to treat new lines as a new record.&lt;/P&gt;&lt;P&gt;I have tried multiple options on the infile statement but I'm having no luck.&lt;/P&gt;&lt;P&gt;The text data is from an email therefore there are multiple lines and can have multiple characters (thankfully no pipes).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I'm using is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mailmessage;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;infile&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;"\\filename.csv"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;dsd&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;dlm&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'|'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Encoding=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"utf-8"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;missover&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;firstobs&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;lrecl&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;32767&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;n&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;TERMSTR&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=CR recfrm=N;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgId :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$10.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;priority :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$3.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Status :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$3.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;IncidentID :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$10.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;CustEmailId :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$10.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;DateRecv :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$50.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;DateSent :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$50.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgFrom :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$50.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgTo :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$256.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgSubject :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$256.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgCategories :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$90.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgBody :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$Char10000.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;AgentID :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$5.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Msgtype :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$3.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;firstmsgdate :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$50.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Lastmsgdate :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$50.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Nummessages :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;4.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Numreplies :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;4.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;loginname :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$7.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;custaccount :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$20.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2017 11:57:23 GMT</pubDate>
    <dc:creator>Pukkapies</dc:creator>
    <dc:date>2017-07-06T11:57:23Z</dc:date>
    <item>
      <title>Import CSV with complex text variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-with-complex-text-variable/m-p/373612#M89390</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to import a CSV file which is pipe delimited.&lt;/P&gt;&lt;P&gt;I am having trouble when it comes to the text field, for some reason SAS appears to treat new lines as a new record.&lt;/P&gt;&lt;P&gt;I have tried multiple options on the infile statement but I'm having no luck.&lt;/P&gt;&lt;P&gt;The text data is from an email therefore there are multiple lines and can have multiple characters (thankfully no pipes).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I'm using is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mailmessage;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;infile&lt;/FONT&gt; &lt;FONT color="#800080" face="Courier New" size="2"&gt;"\\filename.csv"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;dsd&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;dlm&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'|'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Encoding=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"utf-8"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;missover&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;firstobs&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;lrecl&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;32767&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;n&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;TERMSTR&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=CR recfrm=N;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;input&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgId :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$10.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;priority :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$3.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Status :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$3.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;IncidentID :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$10.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;CustEmailId :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$10.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;DateRecv :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$50.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;DateSent :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$50.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgFrom :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$50.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgTo :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$256.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgSubject :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$256.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgCategories :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$90.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;MsgBody :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$Char10000.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;AgentID :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$5.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Msgtype :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$3.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;firstmsgdate :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$50.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Lastmsgdate :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$50.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Nummessages :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;4.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Numreplies :&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;4.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;loginname :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$7.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;custaccount :&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;$20.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 11:57:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-with-complex-text-variable/m-p/373612#M89390</guid>
      <dc:creator>Pukkapies</dc:creator>
      <dc:date>2017-07-06T11:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Import CSV with complex text variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-CSV-with-complex-text-variable/m-p/373615#M89391</link>
      <description>&lt;P&gt;This has come up a few times before, try this post for example:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Read-CSV-file-with-embedded-CRLF/td-p/183296" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Read-CSV-file-with-embedded-CRLF/td-p/183296&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Also, please dont refer to that as a Comma Separated Variable file as its not, its a delimited file.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 12:07:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-CSV-with-complex-text-variable/m-p/373615#M89391</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-06T12:07:04Z</dc:date>
    </item>
  </channel>
</rss>

