<?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: Any way to preserve spaces when using put (_ALL_) ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338666#M77169</link>
    <description>&lt;P&gt;Mmm...&amp;nbsp; I had dsd there for a reason, but I can't think of why now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue is not solved when commas (for example) are used as a delimiter and values with commas&amp;nbsp;(for example) must be quoted, but that's not my case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I probably wanted a universal solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not my current need, but I someone&amp;nbsp;knows of a way to preserve the space when values can contain the delimiter and must&amp;nbsp;therefore be quoted automatically, I am still interested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2017 03:42:53 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2017-03-07T03:42:53Z</dc:date>
    <item>
      <title>Any way to preserve spaces when using put (_ALL_) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338354#M77034</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With this data A='aa'; B=' '; C='cc';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need the flat file output to be&lt;/P&gt;
&lt;P&gt;aa| |cc&lt;/P&gt;
&lt;P&gt;and not&lt;/P&gt;
&lt;P&gt;aa||cc&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;put (_ALL_) (+1) and option dsd is the closest I have been to the desired result, but all strings then have a leading space, which is wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any way to not remove spaces when using put (_ALL_)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 05:32:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338354#M77034</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-03-06T05:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to preserve spaces when using put (_ALL_) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338381#M77046</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;put (_ALL_) (+0) ?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 09:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338381#M77046</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2017-03-06T09:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to preserve spaces when using put (_ALL_) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338387#M77049</link>
      <description>&lt;P&gt;Out of interest, why? &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;aa||cc&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The above would be the standard format of a delimited file - || indicating missing, be that either character or numeric depending on the data spec. &amp;nbsp;So what value does adding a space actually give, doesn't it just confuse the issue, e.g. variable is read in as a numeric, but actually contains a space?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 09:36:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338387#M77049</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-03-06T09:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to preserve spaces when using put (_ALL_) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338389#M77050</link>
      <description>Sorry, i misread the question and thought you wanted to remove spaces.</description>
      <pubDate>Mon, 06 Mar 2017 09:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338389#M77050</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2017-03-06T09:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to preserve spaces when using put (_ALL_) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338401#M77056</link>
      <description>&lt;P&gt;Then DO NOT use DSD .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 51         
 52         filename x temp;
 53         data _null_;
 54         file x dlm='|';
 55          A='aa'; B=' '; C='cc';
 56          put (_all_) (:);
 57         run;
 
 NOTE: The file X is:
       Filename=/tmp/SAS_workD06A00000944_localhost.localdomain/#LN00030,
       Owner Name=sasdemo,Group Name=sas,
       Access Permission=-rw-rw-r--,
       Last Modified=06Mar2017:18:26:48
 
 NOTE: 1 record was written to the file X.
       The minimum record length was 7.
       The maximum record length was 7.
 NOTE: DATA statement used (Total process time):
       real time           0.02 seconds
       cpu time            0.03 seconds
       
 
 58         
 59         data _null_;
 60         infile x;
 61         input;
 62         put _infile_;
 63         run;
 
 NOTE: The infile X is:
       Filename=/tmp/SAS_workD06A00000944_localhost.localdomain/#LN00030,
       Owner Name=sasdemo,Group Name=sas,
       Access Permission=-rw-rw-r--,
       Last Modified=06Mar2017:18:26:48,
       File Size (bytes)=8
 
 aa| |cc
 NOTE: 1 record was read from the infile X.
       The minimum record length was 7.
       The maximum record length was 7.
 NOTE: DATA statement used (Total process time):
       real time           0.03 seconds
       cpu time            0.03 seconds
       
 
 64         
 65         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 75         &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Mar 2017 10:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338401#M77056</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-06T10:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to preserve spaces when using put (_ALL_) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338553#M77119</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;Hadoop can store blank strings as empty strings or nulls.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 19:53:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338553#M77119</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-03-06T19:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to preserve spaces when using put (_ALL_) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338666#M77169</link>
      <description>&lt;P&gt;Mmm...&amp;nbsp; I had dsd there for a reason, but I can't think of why now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue is not solved when commas (for example) are used as a delimiter and values with commas&amp;nbsp;(for example) must be quoted, but that's not my case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I probably wanted a universal solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not my current need, but I someone&amp;nbsp;knows of a way to preserve the space when values can contain the delimiter and must&amp;nbsp;therefore be quoted automatically, I am still interested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 03:42:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338666#M77169</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-03-07T03:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Any way to preserve spaces when using put (_ALL_) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338670#M77172</link>
      <description>&lt;P&gt;You can quote it mannually , I think it is easy for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if findc(x,',') then x=quote(x);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;put x;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the alternative way is after you get &amp;nbsp;xx||yy ,you can change it into xx| |yy by tranwrd. I think it is &amp;nbsp;easy for you too.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 03:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-way-to-preserve-spaces-when-using-put-ALL/m-p/338670#M77172</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-07T03:59:40Z</dc:date>
    </item>
  </channel>
</rss>

