<?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: Create file on unix, open it on windows in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-file-on-unix-open-it-on-windows/m-p/144524#M11355</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your suggestion, I´ll try the @ variant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;although I think the problem is, that the end-of-line value gets messed up between unix and windows.&lt;/P&gt;&lt;P&gt;I realized it looks like the line is filled until &lt;STRONG&gt;lrecl&lt;/STRONG&gt; is reached instead of having a line for each &lt;STRONG&gt;put&lt;/STRONG&gt;-statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;changing the output format is no option, I´d never do it like I have to if I were given the choice &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Dec 2014 15:29:58 GMT</pubDate>
    <dc:creator>Maze</dc:creator>
    <dc:date>2014-12-10T15:29:58Z</dc:date>
    <item>
      <title>Create file on unix, open it on windows</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-file-on-unix-open-it-on-windows/m-p/144522#M11353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey there,&lt;/P&gt;&lt;P&gt;I ran into a problem I can´t seem to resolve on my own:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I´m creating output in a .txt file on a unix server. The file is then beeing archived (ODS PACKAGE) and sent to several people using the mail-engine.&lt;/P&gt;&lt;P&gt;When I open the file on unix directly, it is perfectly aligned, every record has it´s own line and the same values start in the same columns.&lt;/P&gt;&lt;P&gt;Opening the same file from the mail on an windows environment shows that there is a offset (7 characters, can´t find the reason for the number) which every line is offset from the next one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Unix Output (correct):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;values that are only on the first row&lt;/P&gt;&lt;P&gt;this is the first row&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; randomstring&lt;/P&gt;&lt;P&gt;this is the second row&amp;nbsp;&amp;nbsp;&amp;nbsp; 472&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; anotherstring&lt;/P&gt;&lt;P&gt;this is the third row&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 555&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; laststringvalue&lt;/P&gt;&lt;P&gt;values that are only on the last row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Windows Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;values that are only on the first row this is&lt;/P&gt;&lt;P&gt;the first row&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; randomstring&lt;/P&gt;&lt;P&gt;this is the second row&amp;nbsp;&amp;nbsp;&amp;nbsp; 472&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; anothe&lt;/P&gt;&lt;P&gt;rstring this is the third row&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 555&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; laststring&lt;/P&gt;&lt;P&gt;value values that are only on the last row&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems like there is a problem between the static first row and the first dynamic row generated from column values&lt;/P&gt;&lt;P&gt;The code looks something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data WORK.OUT end=EOF;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file = "/bla/bla/out.txt";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _N_ = 1 then put 'values that are only on the first row';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STR1 $26.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STR2 $7.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STR3 $15.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if EOF then put 'values that are only on the last row';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I´d appreciate it, if someone could point me in the right direction.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 14:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-file-on-unix-open-it-on-windows/m-p/144522#M11353</guid>
      <dc:creator>Maze</dc:creator>
      <dc:date>2014-12-10T14:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Create file on unix, open it on windows</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-file-on-unix-open-it-on-windows/m-p/144523#M11354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does it do the same if you specify the position to put:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; @&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; STR1 @&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;26&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; STR2 @&lt;/SPAN&gt;&lt;STRONG style=": ; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;33&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; STR3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Its likely to be the app you use to look at the data presenting spaces/tabs slightly differently - you get that between apps, for instance using tabs in SAS code, then opening them in Notepad really messes up alignment.&amp;nbsp; The other thing I would suggest is using CSV (or maybe XML) - then it could be opened in Excel or Text quite easily.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 15:11:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-file-on-unix-open-it-on-windows/m-p/144523#M11354</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-12-10T15:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create file on unix, open it on windows</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-file-on-unix-open-it-on-windows/m-p/144524#M11355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your suggestion, I´ll try the @ variant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;although I think the problem is, that the end-of-line value gets messed up between unix and windows.&lt;/P&gt;&lt;P&gt;I realized it looks like the line is filled until &lt;STRONG&gt;lrecl&lt;/STRONG&gt; is reached instead of having a line for each &lt;STRONG&gt;put&lt;/STRONG&gt;-statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;changing the output format is no option, I´d never do it like I have to if I were given the choice &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2014 15:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-file-on-unix-open-it-on-windows/m-p/144524#M11355</guid>
      <dc:creator>Maze</dc:creator>
      <dc:date>2014-12-10T15:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create file on unix, open it on windows</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-file-on-unix-open-it-on-windows/m-p/144525#M11356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;just a heads up:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I fixed the problem by &lt;STRONG&gt;manually inserting a CR/LF&lt;/STRONG&gt; (carriage return/line feed) character (&lt;STRONG&gt;'0D0A'X&lt;/STRONG&gt;) at the end of every line.&lt;/P&gt;&lt;P&gt;The plain file now has an empty row between every relevant row,&lt;/P&gt;&lt;P&gt;but the file inside the package is correctly formatted, which is what matters to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Explanation:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Unix uses LF or in hex '0A'x to indicate the end of a line.&lt;/P&gt;&lt;P&gt;Windows uses CR/LF or in hex '0D0A'x.&lt;/P&gt;&lt;P&gt;(Macintosh uses CR '0D'x)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems like windows just ignores the '0A'x.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I´m working on a cleaner solution that replaces all LF with CR/LF instead of adding a CR/LF to an existing LF.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2014 10:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Create-file-on-unix-open-it-on-windows/m-p/144525#M11356</guid>
      <dc:creator>Maze</dc:creator>
      <dc:date>2014-12-12T10:20:28Z</dc:date>
    </item>
  </channel>
</rss>

