<?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: Read CSV file with embedded CRLF in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183302#M34810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data test2;
&amp;nbsp; infile "c:\temp\temp2.csv" dsd dlm="|^" recfm=n;
&amp;nbsp; input x : $40. @@;
&amp;nbsp; n=mod(_n_,7); 
&amp;nbsp; if n=1 then group+1;
run;
proc transpose data=test2 out=want2(drop=_:) prefix=var_;
by group;
id n;
var x;
run;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Nov 2014 12:28:25 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2014-11-24T12:28:25Z</dc:date>
    <item>
      <title>Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183296#M34804</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 Powershell script which dynamically queries an Excel file and spits it out as a CSV (or other delimited) file.&amp;nbsp; Think of it as dynamically saving the Excel file as a CSV file at runtime.&amp;nbsp; Note:&amp;nbsp; we do not have SAS/ACCESS to PC File formats licensed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Occasionally that Excel file will have an embedded CRLF (Alt-Enter within an Excel cell).&amp;nbsp; This causes the CSV record to have an unwanted CRLF "in the middle", which messes up the data import into SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any (easy) way I can read such a file correctly?&amp;nbsp; I can easily change my script to output an arbitrary end-of-record (EOR) marker, for example a caret (^) or tilde (~) - some agreed character that cannot be present in any of the data.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, for example, my CSV file might then look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;VAR1, VAR2, VAR3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;A,B,C^&amp;lt;CRLF&amp;gt;&lt;/P&gt;&lt;P&gt;D,E,F^&amp;lt;CRLF&amp;gt;&lt;/P&gt;&lt;P&gt;G,H&amp;lt;CRLF&amp;gt;&lt;/P&gt;&lt;P&gt;I&amp;lt;CRLF&amp;gt;&lt;/P&gt;&lt;P&gt;J,K^&amp;lt;CRLF&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example, I would want my EOR to be ^&amp;lt;CRLF&amp;gt;, and my SAS dataset to look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;VAR1 VAR2 VAR3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;D&amp;nbsp;&amp;nbsp;&amp;nbsp; E&amp;nbsp;&amp;nbsp;&amp;nbsp; F&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;G&amp;nbsp;&amp;nbsp;&amp;nbsp; H&amp;nbsp;&amp;nbsp;&amp;nbsp; K&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; J &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only ideas I can think of are:&amp;nbsp; 1) INFILE TERMSTR=..., but it doesn't look like I can specify an arbitrary EOR indicator (unlike say Perl), or 2) RECFM=N, but I think (???) I'd have to write my own parser, since the file is now treated as a byte stream.&amp;nbsp; This would be "messy".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any suggestions re: how to tackle this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 04:10:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183296#M34804</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2014-11-24T04:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183297#M34805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Scott,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without seeing the file one can't be sure, but Alt-Enters in Excel are typically represented by the hex character '0A'x;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you define your file with a filename statement, that includes a termstr=crlf, I think you can parse the field using '0A'x as the delimiter, and then input the separate entries like you would any comma delimited field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 04:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183297#M34805</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-11-24T04:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183298#M34806</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've got some working code, but welcome feedback whether it's the best approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I did:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat Sales Inventory Returns;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set sashelp.shoes;&lt;/P&gt;&lt;P&gt;&amp;nbsp; where subsidiary="Addis Ababa";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In DMS, RMB and view in Excel (or export to Excel some other way)&lt;/P&gt;&lt;P&gt;I deleted the first couple rows, saved as Excel xlsx, added Alt-Enter in some Products, saved that as Excel xlsx.&lt;/P&gt;&lt;P&gt;Ran my Powershell script to create two CSV files (see attached).&amp;nbsp; This output is slightly different than Excel's SaveAs CSV (wrt quoted fields)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAS doc needs to be improved with respect to the TERMSTR option.&amp;nbsp; It implies a limited set of values (CR, CRLF, etc).&amp;nbsp; I tried an explicit EOR character, which seemed to work.&amp;nbsp; BTW, I'm using SAS 9.3 on Windows 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my "working" code, further feedback welcome:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; test1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"c:\temp\temp1.csv"&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;dsd&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"|"&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;termstr&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"^"&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;truncover&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;firstobs&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; @@;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;putlog&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;putlog&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;hex128.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; /;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* note the leading CRLF "0D0A"x ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* option 1: remove all CRLF - this is the better option ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_=compress(_infile_,&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"0D0A"x&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;);&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* if you comment this out you'll get an error ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* option 2: remove only leading CRLF - this can cause problems with later where processing ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_=prxchange(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"s/^\x0D\x0A//"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;,-&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;,_infile_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;putlog&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;hex128.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; /;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* leading CRLF now removed ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Sales Inventory Returns Region ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Product ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Subsidiary ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Stores;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Sales -- Returns &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;dollar12.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; missing(Region) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;delete&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; test2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"c:\temp\temp2.csv"&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;dsd&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"|"&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;termstr&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"^"&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;truncover&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;firstobs&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; @@;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;putlog&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;putlog&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;hex128.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; /;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* note the leading CRLF "0D0A"x ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* option 1: remove all CRLF - this is the better option ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_=compress(_infile_,&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"0D0A"x&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;);&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* if you comment this out you'll get an error ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* option 2: remove only leading CRLF - this can cause problems with later where processing ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_=prxchange(&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"s/^\x0D\x0A//"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;,-&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;1&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;,_infile_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;putlog&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;hex128.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; /;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* leading CRLF now removed ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Sales Inventory Returns Region ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Product ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Subsidiary ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Stores;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Sales -- Returns &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;dollar12.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; missing(Region) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;delete&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 06:36:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183298#M34806</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2014-11-24T06:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183299#M34807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The real question is whether the way you are trying to solve the cr/lf issue with a double meaning / intrepretation is not causing more problems as it will solve.&lt;/P&gt;&lt;P&gt;As it is some form of input validations you could do that with excel before handing over to SAS.&amp;nbsp; &lt;A class="active_link" href="https://www.ablebits.com/office-addins-blog/2013/12/03/remove-carriage-returns-excel/" title="https://www.ablebits.com/office-addins-blog/2013/12/03/remove-carriage-returns-excel/"&gt;3 ways to remove carriage returns in Excel: formulas, VBA macro, find&amp;amp;replace dialog&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It is the question on how the disable hard enter in excel before going into how to process that in SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is the same story why using a comma is a bad approach in an I18N world (decimal points differ). The tab being used (binary limitatioen).&lt;BR /&gt;The choice of using special chars for some special meaning will always be have some confusing moments. (brackets in XML)&lt;/P&gt;&lt;P&gt;Using fixed lengt type records or having a field with the length of each the record do not have those side-effects. Just a pitty they are not common standardized formats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not that amazing googling (hard enter disable) this popped up (unknown quality) &lt;A href="http://www.extendoffice.com/documents/excel/902-excel-remove-line-breaks.html" title="http://www.extendoffice.com/documents/excel/902-excel-remove-line-breaks.html"&gt;How to quickly remove line breaks in Excel?&lt;/A&gt; It is a commercial offer addins for excel. There must be more.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 06:55:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183299#M34807</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-11-24T06:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183300#M34808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had the same issue and went through Tech Support for resolution: &lt;A _jive_internal="true" href="https://communities.sas.com/thread/60374"&gt;https://communities.sas.com/thread/60374&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 09:06:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183300#M34808</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-11-24T09:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183301#M34809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you make your VBA script command Excel to save the "character" cells with surrounding quotes? If yes, I have written a short C program that removes linefeeds when the number of quotes encountered is odd (indicating that there is an "open string")&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 10:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183301#M34809</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-11-24T10:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183302#M34810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data test2;
&amp;nbsp; infile "c:\temp\temp2.csv" dsd dlm="|^" recfm=n;
&amp;nbsp; input x : $40. @@;
&amp;nbsp; n=mod(_n_,7); 
&amp;nbsp; if n=1 then group+1;
run;
proc transpose data=test2 out=want2(drop=_:) prefix=var_;
by group;
id n;
var x;
run;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 12:28:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183302#M34810</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-11-24T12:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183303#M34811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First if you generate the CSV file with Excel then it should have the strings with embedded CRLF properly quoted and you can use the quote counting tricks from other threads on this topic to convert the CRLF to single CR or LF or some other special character and then treat the converted file as normal.&lt;/P&gt;&lt;P&gt;Second you should be able to use the ^ in your example as the TERMSTR value on the INPUT statement.&amp;nbsp; The problem you will have is that after the first line the CRLF pairs at the ends of your lines (after the '^' ) will appear at the beginning of every line after the first.&amp;nbsp; You could probably just read that into a dummy variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename x temp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file x ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put &lt;/P&gt;&lt;P&gt;'A,B,C^' '0D0A'x&lt;/P&gt;&lt;P&gt;'D,E,F^' '0D0A'x&lt;/P&gt;&lt;P&gt;'G,H' '0D0A'x&lt;/P&gt;&lt;P&gt;'I' '0D0A'x&lt;/P&gt;&lt;P&gt;'J,K^'&amp;nbsp; @;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; infile x termstr='^' dsd truncover ;&lt;/P&gt;&lt;P&gt; length x1-x4 $10 ;&lt;/P&gt;&lt;P&gt; input x1-x4 ;&lt;/P&gt;&lt;P&gt; list ;&lt;/P&gt;&lt;P&gt; put (x1-x4) (= $hex20.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 15:23:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183303#M34811</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-11-24T15:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183304#M34812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alt-Enter in EXCEL inserts LF '0A'x not CRLF.&amp;nbsp; If you your records are DOS CRLF delimited then specifying INFILE option TERMSTR=CRLF should allow you to read the file without further problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise you don't have what you think you have, etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 15:39:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183304#M34812</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2014-11-24T15:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183305#M34813</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 has success with the IGNOREDOSEOF option when reading the data.&amp;nbsp; Just a thought.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Nov 2014 15:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183305#M34813</guid>
      <dc:creator>OS2Rules</dc:creator>
      <dc:date>2014-11-24T15:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183306#M34814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all the replies.&amp;nbsp; Here is further detail; apologies if it's cryptic...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;My Powershell script to query Excel is here:&amp;nbsp; &lt;A class="active_link" href="https://github.com/scottbass/Powershell/blob/master/Scripts/Query-Excel.ps1" title="https://github.com/scottbass/Powershell/blob/master/Scripts/Query-Excel.ps1"&gt;Powershell/Query-Excel.ps1 at master · scottbass/Powershell · GitHub&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Example invocations are:&lt;UL&gt;&lt;LI&gt;.\Query-Excel.ps1 C:\Temp\Temp1.xlsx "select * from [Sheet1$]" -csv -dlm "|"&lt;/LI&gt;&lt;LI&gt;.\Query-Excel.ps1 C:\Temp\Temp1.xlsx "select * from [Sheet1$]" -csv -dlm "|" | % {"$_^"}&amp;nbsp; # to append an EOR marker to each record&lt;/LI&gt;&lt;LI&gt;.\Query-Excel.ps1 C:\Temp\Temp1.xlsx "select * from [Sheet1$]" -csv -dlm "|" | % {"$_^"} | Out-File C:\Temp\Temp1.csv -Encoding Ascii&amp;nbsp; # to create an output CSV file (could also use redirection &amp;gt; )&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Example SAS invocation:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;%let&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; powershell = C:\Windows\syswow64\WindowsPowerShell\v1.0\powershell.exe;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;%let&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; psoptions&amp;nbsp; = -noprofile -executionpolicy unrestricted -command;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;%let&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; script&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = E:\Powershell\Scripts\Query-Excel.ps1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;%let&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; delimiter&amp;nbsp; = |;&amp;nbsp; %&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* do not use dlm as a macro variable name! ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;%let&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; outoptions = -encoding ASCII;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;%let&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; worksheet&amp;nbsp; = Sheet1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;%let&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; select&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = select * from [&amp;amp;worksheet$];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;options&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;noquotelenmax&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;infile&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"&amp;amp;powershell &amp;amp;psoptions ""&amp;amp;script -path '&amp;amp;excel_file' -query '&amp;amp;select' -delimiter '&amp;amp;delimiter' |&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;Out-File '&amp;amp;outfile' &amp;amp;outoptions&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"" 2&amp;gt;&amp;amp;1"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pipe &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;lrecl&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;1000&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;putlog&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"WAR"&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"NING: "&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_; %&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: teal; background: white;"&gt;* should never occur unless script has an error ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;options&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;quotelenmax&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Obviously you can also invoke this from the Powershell console window to test/debug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Save the output as a "normal" CSV&lt;/LI&gt;&lt;LI&gt;Use PROC IMPORT to generate a data step to import the CSV&lt;/LI&gt;&lt;LI&gt;Modify to suit - this is now your data import step&lt;/LI&gt;&lt;LI&gt;Run the SAS code above to dynamically convert the Excel file to CSV (I write the CSV file as a temp file in the work directory.&amp;nbsp; I could also read the pipe directly, but using a physical file is easier to debug.)&lt;/LI&gt;&lt;LI&gt;Run the PROC IMPORT code to import as a SAS dataset&lt;/LI&gt;&lt;LI&gt;Add embedded Alt-Enter into your Excel file, rinse and repeat.&lt;/LI&gt;&lt;LI&gt;The embedded Alt-Enter will mess up the import of the Excel --&amp;gt; CSV data&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I'll need to modify my PROC IMPORT generated data step code to cater for the embedded Alt-Enter (0Ax) characters.&amp;nbsp; My 2nd post is my first attempt at this code. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMO, a giant step in the right direction is a user-configuration EOR character.&amp;nbsp; Here is an except from the SAS documentation:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;A name="n132p5kqqo8wo7n13xsmfq9a6t70"&gt;&lt;/A&gt;&lt;/P&gt;&lt;DL class="argDescriptionPair"&gt;&lt;DT class="argument"&gt;TERMSTR=&lt;/DT&gt;&lt;DD class="argumentDescription"&gt;&lt;P class="paraSimpleFirst"&gt;specifies the end-of-line character for the file. Use this option to share files between the UNIX and Windows operating environments. If termstr is not specified, a single LF or a CRLF function as the end of line character. If termstr=CRLF, then CRLF functions as the EOL character. The following are under Windows:&lt;/P&gt;&lt;A name="p1inem6iks1qtdn15564y5zgog9x"&gt;&lt;/A&gt;&lt;DL class="argDescriptionPair"&gt;&lt;DT class="argument"&gt;CRLF&lt;/DT&gt;&lt;DD class="argumentDescription"&gt;&lt;P class="paraSimpleFirst"&gt;Carriage return line feed. Use TERMSTR=CRLF to read Windows or DOS formatted files. CRLF is the default.&lt;/P&gt;&lt;/DD&gt;&lt;/DL&gt;&lt;A name="n1na45u7qhu29xn13rzsrirrhc06"&gt;&lt;/A&gt;&lt;DL class="argDescriptionPair"&gt;&lt;DT class="argument"&gt;LF&lt;/DT&gt;&lt;DD class="argumentDescription"&gt;&lt;P class="paraSimpleFirst"&gt;Line feed. Use TERMSTR=LF to read UNIX formatted files. If a file contains CRLF characters, the CR functions as part of the data and not an end of line character.&lt;/P&gt;&lt;/DD&gt;&lt;/DL&gt;&lt;A name="n0yfmh151o7lpln16ute5xgj41dw"&gt;&lt;/A&gt;&lt;DL class="argDescriptionPair"&gt;&lt;DT class="argument"&gt;CR&lt;/DT&gt;&lt;DD class="argumentDescription"&gt;&lt;P class="paraSimpleFirst"&gt;Carriage Return. Use TERMSTR=CR if the end of line character is a CR.&lt;/P&gt;&lt;/DD&gt;&lt;/DL&gt;&lt;/DD&gt;&lt;/DL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The implication is that these are the only settings available.&amp;nbsp; However, TERMSTR="^" worked for me without causing an error.&amp;nbsp; IMO the SAS documentation should be expanded and clarified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not going to use VBA or C approaches, although I appreciate the suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IGNOREDOSEOF also looks promising.&amp;nbsp; However, here is the SAS 9.3.doc:&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A name="p0n7o7xlezaurcn1welk43i4fmaf"&gt;&lt;/A&gt;&lt;/P&gt;&lt;DL class="argDescriptionPair"&gt;&lt;DT class="argument"&gt;IGNOREDOSEOF&lt;/DT&gt;&lt;DD class="argumentDescription"&gt;&lt;P class="paraSimpleFirst"&gt;is used in the context of I/O operations on variable record format files. When this option is specified, any occurrence of ^Z is interpreted as character data and not as an end-of-file marker.&lt;/P&gt;&lt;/DD&gt;&lt;/DL&gt;&lt;P&gt;And here is a Google hit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/45/522.html" title="http://support.sas.com/kb/45/522.html"&gt;45522 - IGNOREDOSEOF option not honored when specified on the FILENAME statement&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is ^Z the same as 0Ax?&amp;nbsp; From the SAS doc, I wouldn't have thought to use IGNOREDOSEOF for this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;IGNOREDOSEOF did not fix the issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;827&amp;nbsp; data foo;&lt;/P&gt;&lt;P&gt;828&amp;nbsp;&amp;nbsp;&amp;nbsp; infile "c:\temp\temp2.csv" dsd dlm="|" truncover firstobs=2 ignoredoseof;&lt;/P&gt;&lt;P&gt;829&amp;nbsp;&amp;nbsp;&amp;nbsp; input Sales Inventory Returns Region ~ $10. Product ~ $20. Subsidiary ~ $20. Stores;&lt;/P&gt;&lt;P&gt;830&amp;nbsp;&amp;nbsp;&amp;nbsp; format Sales -- Returns dollar12.;&lt;/P&gt;&lt;P&gt;831&amp;nbsp;&amp;nbsp;&amp;nbsp; if missing(Region) then delete;&lt;/P&gt;&lt;P&gt;832&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: The infile "c:\temp\temp2.csv" is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Filename=c:\temp\temp2.csv,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RECFM=V,LRECL=256,File Size (bytes)=465,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Last Modified=25 November 2014 11:50:47,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create Time=24 November 2014 15:38:51&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for Sales in line 4 1-6.&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for Inventory in line 4 8-18.&lt;/P&gt;&lt;P&gt;RULE:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+---&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Casual|Addis Ababa|4 20&lt;/P&gt;&lt;P&gt;Sales=. Inventory=. Returns=$4 Region=&amp;nbsp; Product=&amp;nbsp; Subsidiary=&amp;nbsp; Stores=. _ERROR_=1 _N_=3&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for Sales in line 6 1-5.&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for Inventory in line 6 7-17.&lt;/P&gt;&lt;P&gt;6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dress|Addis Ababa|7 19&lt;/P&gt;&lt;P&gt;Sales=. Inventory=. Returns=$7 Region=&amp;nbsp; Product=&amp;nbsp; Subsidiary=&amp;nbsp; Stores=. _ERROR_=1 _N_=5&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for Sales in line 11 1-6.&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for Inventory in line 11 8-18.&lt;/P&gt;&lt;P&gt;11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Casual|Addis Ababa|2 20&lt;/P&gt;&lt;P&gt;Sales=. Inventory=. Returns=$2 Region=&amp;nbsp; Product=&amp;nbsp; Subsidiary=&amp;nbsp; Stores=. _ERROR_=1 _N_=10&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for Sales in line 13 1-5.&lt;/P&gt;&lt;P&gt;NOTE: Invalid data for Inventory in line 13 7-17.&lt;/P&gt;&lt;P&gt;13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dress|Addis Ababa|12 20&lt;/P&gt;&lt;P&gt;Sales=. Inventory=. Returns=$12 Region=&amp;nbsp; Product=&amp;nbsp; Subsidiary=&amp;nbsp; Stores=. _ERROR_=1 _N_=12&lt;/P&gt;&lt;P&gt;NOTE: 12 records were read from the infile "c:\temp\temp2.csv".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The minimum record length was 19.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum record length was 47.&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.FOO has 8 observations and 7 variables.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.03 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below code is still my best approach so far, although it admittedly has the overhead of appending the EOR indicator to the CSV file, which might not work in other scenarios.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; foo;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;infile&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"c:\temp\temp2.csv"&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;dsd&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"|"&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;termstr&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"^"&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;truncover&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;firstobs&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; @@;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; _infile_=compress(_infile_,&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"0D0A"x&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Sales Inventory Returns Region ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Product ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Subsidiary ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Stores;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Sales -- Returns &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;dollar12.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; missing(cats(of Region--Subsidiary)) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;delete&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Scott Bass:&amp;nbsp; &#xD;
Added update that IGNOREDOSEOF did not solve this issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 00:48:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183306#M34814</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2014-11-25T00:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183307#M34815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Ok, this worked...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; foo;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt; infile&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"c:\temp\temp2.csv"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;dsd &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"|" &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;truncover &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;firstobs&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2 &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;termstr&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=CRLF&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Sales Inventory Returns Region ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Product ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Subsidiary ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Stores;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Sales -- Returns &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;dollar12.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; missing(cats(of Region--Subsidiary)) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;delete&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;But this failed:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; foo;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt; infile&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"c:\temp\temp2.csv"&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;dsd &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;"|" &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;truncover &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;firstobs&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: blue; background: white;"&gt;2&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Sales Inventory Returns Region ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$10.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Product ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Subsidiary ~ &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;$20.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Stores;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; Sales -- Returns &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: #0000c0; background: white;"&gt;dollar12.&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt; missing(cats(of Region--Subsidiary)) &lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: fuchsia; background: white;"&gt;delete&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 11.0pt; font-family: 'SAS Monospace';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'SAS Monospace'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Again, the SAS doc:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;TERMSTR=&lt;/P&gt;&lt;P&gt;specifies the end-of-line character for the file. Use this option to share files between the UNIX and Windows operating environments. If termstr is not specified, a single LF or a CRLF function as the end of line character. If termstr=CRLF, then CRLF functions as the EOL character. The following are under Windows:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;CRLF &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Carriage return line feed. Use TERMSTR=CRLF to read Windows or DOS formatted files. &lt;SPAN style="font-size: 12pt; text-decoration: underline;"&gt;CRLF is the default. &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LF&lt;/P&gt;&lt;P&gt;Line feed. Use TERMSTR=LF to read UNIX formatted files. If a file contains CRLF characters, the CR functions as part of the data and not an end of line character.&lt;/P&gt;&lt;P&gt;CR&lt;/P&gt;&lt;P&gt;Carriage Return. Use TERMSTR=CR if the end of line character is a CR.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;So, if I run the code without specifying the &lt;STRONG style="text-decoration: underline;"&gt;default&lt;/STRONG&gt; TERMSTR=CRLF, it fails.&amp;nbsp; If I explicitly specify the &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;default&lt;/STRONG&gt;&lt;/SPAN&gt; TERMSTR=CRLF, it works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sigh...so I assert that whatever the Windows default is, it's not TERMSTR=CRLF.&amp;nbsp; Perhaps a little birdie will enter a doc bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, this is SAS 9.3 on Windows 7.&amp;nbsp; Perhaps SAS 9.4 works differently...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 01:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183307#M34815</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2014-11-25T01:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183308#M34816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't follow how this is the same issue, although I appreciate the reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 01:18:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183308#M34816</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2014-11-25T01:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183309#M34817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="807441" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: I'm obviously not a little birdie, but you missed the following line from the documentation: "&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-size: 13.63636302948px; background-color: #ffffff;"&gt;If termstr is not specified, a single LF or a CRLF function as the end of line character.&lt;/SPAN&gt;"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 01:51:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183309#M34817</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-11-25T01:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Read CSV file with embedded CRLF</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183310#M34818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Scott, I do not know to wh you are referring. I was the one for csv using comma as a field separator or the comma as ad decimal point.&lt;/P&gt;&lt;P&gt;The CR/LF combination of Arthur is a good one as that one keeps the difference between those two.&lt;/P&gt;&lt;P&gt;Would you transfer the file to Unix using a ftp program in ascii-mode it will translate those CR/LF to just the LF. That eliminates the important difference.&lt;/P&gt;&lt;P&gt;Avoiding a ascii mode transfer and using a binary mode would have no negative side effects for that file.&lt;/P&gt;&lt;P&gt;Doing this for other type of files (eg sh scripts) you can cause unreadable files on the Unix system without being noticed.&lt;/P&gt;&lt;P&gt;There was a time (s)ftp did have encoding tables included. They are mostly gone with all Unicode type encodings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be better for having this better documented. Perhaps some KB/note paper "101 windows/unix files"&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Nov 2014 06:34:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Read-CSV-file-with-embedded-CRLF/m-p/183310#M34818</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-11-25T06:34:52Z</dc:date>
    </item>
  </channel>
</rss>

