<?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: separated correctly by a single commas &amp;amp; then a single space in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/separated-correctly-by-a-single-commas-amp-then-a-single-space/m-p/762051#M241229</link>
    <description>&lt;P&gt;Hey thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested the code and it fixes the issues. However, I wanted to detect when the issues occurred, rather than fix them. Would you be able to modify your code to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Aug 2021 13:32:47 GMT</pubDate>
    <dc:creator>kalbo</dc:creator>
    <dc:date>2021-08-17T13:32:47Z</dc:date>
    <item>
      <title>separated correctly by a single commas &amp; then a single space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/separated-correctly-by-a-single-commas-amp-then-a-single-space/m-p/762032#M241221</link>
      <description>&lt;P&gt;Hi all I need to write code that checks that a variable names are separated correctly by a single commas &amp;amp; then a single space for example "DOMAIN, LBNAM, LBDAT".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, for example, incorrect values I want to detect are:&lt;/P&gt;&lt;P&gt;DOMAIN , LBNAM, LBDAT&lt;/P&gt;&lt;P&gt;DOMAIN;LBNAM;LBDAT&lt;/P&gt;&lt;P&gt;DOMAIN,,LBNAM, LBDAT&lt;/P&gt;&lt;P&gt;DOMAIN LBNAM LBDAT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 12:29:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/separated-correctly-by-a-single-commas-amp-then-a-single-space/m-p/762032#M241221</guid>
      <dc:creator>kalbo</dc:creator>
      <dc:date>2021-08-17T12:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: separated correctly by a single commas &amp; then a single space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/separated-correctly-by-a-single-commas-amp-then-a-single-space/m-p/762036#M241223</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/160861"&gt;@kalbo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
	s = 'DOMAIN , LBNAM, LBDAT'; output;
	s = 'DOMAIN;LBNAM;LBDAT'; output;
	s = 'DOMAIN,,LBNAM, LBDAT'; output;
	s = 'DOMAIN LBNAM LBDAT'; output;
run;
data b; set a;
	s2 = prxchange('s/(\w*)(\W*)(\w+)/$1, $3/',-1,trim(s));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Aug 2021 12:49:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/separated-correctly-by-a-single-commas-amp-then-a-single-space/m-p/762036#M241223</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2021-08-17T12:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: separated correctly by a single commas &amp; then a single space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/separated-correctly-by-a-single-commas-amp-then-a-single-space/m-p/762051#M241229</link>
      <description>&lt;P&gt;Hey thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested the code and it fixes the issues. However, I wanted to detect when the issues occurred, rather than fix them. Would you be able to modify your code to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 13:32:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/separated-correctly-by-a-single-commas-amp-then-a-single-space/m-p/762051#M241229</guid>
      <dc:creator>kalbo</dc:creator>
      <dc:date>2021-08-17T13:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: separated correctly by a single commas &amp; then a single space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/separated-correctly-by-a-single-commas-amp-then-a-single-space/m-p/762056#M241232</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/160861"&gt;@kalbo&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just check if the string is changed, i.e. s not equal to s2. The following code only outputs incorrect strings, but the comparison result could be assigned to an Error variable instead.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
	s = 'DOMAIN , LBNAM, LBDAT'; output;
	s = 'DOMAIN;LBNAM;LBDAT'; output;
	s = 'DOMAIN,,LBNAM, LBDAT'; output;
	s = 'DOMAIN LBNAM LBDAT'; output;
	s = 'DOMAIN, LBNAM, LBDAT'; output;
run;
data b (drop=s2); set a;
	s2 = prxchange('s/(\w*)(\W*)(\w+)/$1, $3/',-1,trim(s));
	if s ne s2 then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Aug 2021 13:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/separated-correctly-by-a-single-commas-amp-then-a-single-space/m-p/762056#M241232</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2021-08-17T13:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: separated correctly by a single commas &amp; then a single space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/separated-correctly-by-a-single-commas-amp-then-a-single-space/m-p/762063#M241236</link>
      <description>&lt;P&gt;ok great! thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 13:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/separated-correctly-by-a-single-commas-amp-then-a-single-space/m-p/762063#M241236</guid>
      <dc:creator>kalbo</dc:creator>
      <dc:date>2021-08-17T13:58:56Z</dc:date>
    </item>
  </channel>
</rss>

