<?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: Spaces added to between PIPE delimiter when writing to a flat file. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Spaces-added-to-between-PIPE-delimiter-when-writing-to-a-flat/m-p/474430#M121906</link>
    <description>&lt;P&gt;Please use a code window, its the {i} above the post area.&amp;nbsp; Why are you using&amp;nbsp;&lt;SPAN&gt;&amp;amp;SYSLAST throughout and manually setting it at one point, this is not the way to program in SAS.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As for your question:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;options missing='';
data _null_; 
  set work.w2mfnvh; 
  file "&amp;amp;aa_path.reload.coordinatesdn.&amp;amp;ts..del" dlm='|' dsd;
  if _n_=1 then put "Connection_GlobalID|Street|HouseNumber1|HouseNumber2|Municipality|XCoord|YCoord";
  put connection_globalid street housenumber1 housenumber2 municipality xcoord ycoord;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;What does the above not do?&amp;nbsp; The output file generated there is fine and compliant delimited text - file extension fine!.&amp;nbsp; You only need quotes if the data contains the delimiter, which if it does then change the delimiter.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jun 2018 13:40:56 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-06-29T13:40:56Z</dc:date>
    <item>
      <title>Spaces added to between PIPE delimiter when writing to a flat file.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-added-to-between-PIPE-delimiter-when-writing-to-a-flat/m-p/474427#M121904</link>
      <description>&lt;P&gt;I have tried the answer on this topic:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/Spaces-added-to-between-PIPE-delimiter-when-writing-to-a-flat/m-p/115965#M23697" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/Spaces-added-to-between-PIPE-delimiter-when-writing-to-a-flat/m-p/115965#M23697&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But then i get 4 quotes around my values like """"value""""|"""""column2"""""|"""""""""|&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt; create view work.W2MFNVH as&lt;BR /&gt; select&lt;BR /&gt; (strip(put(VEQUNR3,30.))) as Connection_GlobalID length = 30&lt;BR /&gt; format = $30.,&lt;BR /&gt; VSTREET as Street,&lt;BR /&gt; VHOUSEN1 as HouseNumber1,&lt;BR /&gt; VHOUSEN2 as HouseNumber2,&lt;BR /&gt; VCITY as Municipality,&lt;BR /&gt; (compress(ZGPSCOORY)) as XCoord length = 20&lt;BR /&gt; format = $20.&lt;BR /&gt; label = 'Aansl e gps coordinaat x',&lt;BR /&gt; (compress(ZGPSCOORX)) as YCoord length = 20&lt;BR /&gt; format = $20.&lt;BR /&gt; label = 'Aansl e gps coordinaat y'&lt;BR /&gt; from &amp;amp;SYSLAST&lt;BR /&gt; ;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;%let SYSLAST = work.W2MFNVH;&lt;BR /&gt;options missing='';&lt;BR /&gt;data _null_; &lt;BR /&gt; set &amp;amp;SYSLAST; &lt;BR /&gt; attrib Connection_GlobalID length = $30&lt;BR /&gt; format = $30.; &lt;BR /&gt; attrib Street length = $60&lt;BR /&gt; format = $60.; &lt;BR /&gt; attrib HouseNumber1 length = $10&lt;BR /&gt; format = $10.; &lt;BR /&gt; attrib HouseNumber2 length = $10&lt;BR /&gt; format = $10.; &lt;BR /&gt; attrib Municipality length = $40&lt;BR /&gt; format = $40.; &lt;BR /&gt; attrib XCoord length = $20&lt;BR /&gt; format = $20.; &lt;BR /&gt; attrib YCoord length = $20&lt;BR /&gt; format = $20.; &lt;BR /&gt; quote='"';&lt;BR /&gt; file "&amp;amp;aa_path.reload.coordinatesdn.&amp;amp;ts..del" dlm='|' DSD;&lt;BR /&gt; &lt;BR /&gt; if ( _n_ = 1 ) then &lt;BR /&gt; do;&lt;BR /&gt; put &lt;BR /&gt; "Connection_GlobalID|Street|HouseNumber1|HouseNumber2|Municipality|XCoord|YCoord";&lt;BR /&gt; end;&lt;BR /&gt; put &lt;BR /&gt; quote +(-1) Connection_GlobalID +(-1) quote&lt;BR /&gt; quote +(-1) Street +(-1) quote&lt;BR /&gt; quote +(-1) HouseNumber1 +(-1) quote&lt;BR /&gt; quote +(-1) HouseNumber2 +(-1) quote&lt;BR /&gt; quote +(-1) Municipality +(-1) quote&lt;BR /&gt; quote +(-1) XCoord +(-1) quote&lt;BR /&gt; quote +(-1) YCoord +(-1) quote&lt;BR /&gt; ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 13:21:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-added-to-between-PIPE-delimiter-when-writing-to-a-flat/m-p/474427#M121904</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2018-06-29T13:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Spaces added to between PIPE delimiter when writing to a flat file.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-added-to-between-PIPE-delimiter-when-writing-to-a-flat/m-p/474430#M121906</link>
      <description>&lt;P&gt;Please use a code window, its the {i} above the post area.&amp;nbsp; Why are you using&amp;nbsp;&lt;SPAN&gt;&amp;amp;SYSLAST throughout and manually setting it at one point, this is not the way to program in SAS.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As for your question:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;options missing='';
data _null_; 
  set work.w2mfnvh; 
  file "&amp;amp;aa_path.reload.coordinatesdn.&amp;amp;ts..del" dlm='|' dsd;
  if _n_=1 then put "Connection_GlobalID|Street|HouseNumber1|HouseNumber2|Municipality|XCoord|YCoord";
  put connection_globalid street housenumber1 housenumber2 municipality xcoord ycoord;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;What does the above not do?&amp;nbsp; The output file generated there is fine and compliant delimited text - file extension fine!.&amp;nbsp; You only need quotes if the data contains the delimiter, which if it does then change the delimiter.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 13:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-added-to-between-PIPE-delimiter-when-writing-to-a-flat/m-p/474430#M121906</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-29T13:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Spaces added to between PIPE delimiter when writing to a flat file.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Spaces-added-to-between-PIPE-delimiter-when-writing-to-a-flat/m-p/474435#M121907</link>
      <description>I'm using DI studio, therefor it uses syslast. The above makes sure that i don't have blanks between 2 pipes. But it generates extra quotes (4 double quotes). I have to follow some guidelines like the format has to be .del and string characters needs to have double quotes.</description>
      <pubDate>Fri, 29 Jun 2018 13:52:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Spaces-added-to-between-PIPE-delimiter-when-writing-to-a-flat/m-p/474435#M121907</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2018-06-29T13:52:44Z</dc:date>
    </item>
  </channel>
</rss>

