<?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: Reverse Strings in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reverse-Strings/m-p/462599#M117798</link>
    <description>&lt;P&gt;Well, that's not really reversed, just swapped over.&amp;nbsp; You could do:&lt;/P&gt;
&lt;PRE&gt;want=catx(';',scan(have,2,";"),scan(have,1,";"));
&lt;/PRE&gt;
&lt;P&gt;I suspect your issue is more complicated than that.&amp;nbsp; I would split the string up into rows of data with one element per row.&amp;nbsp; Then have a look up merge, for country, and one for city, merge that on to get a flag for wether it is a country or city, then transpose it up.&amp;nbsp; Provide some test data in the form of a datastep and can show code.&lt;/P&gt;</description>
    <pubDate>Wed, 16 May 2018 08:41:57 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-05-16T08:41:57Z</dc:date>
    <item>
      <title>Reverse Strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reverse-Strings/m-p/462596#M117796</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody know a quick way to reverse strings. I basically have some strings like the below;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Germany; Munich&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I want to change them to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Munich; Germany&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you know a good function to use to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Chris&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 08:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reverse-Strings/m-p/462596#M117796</guid>
      <dc:creator>cmoore</dc:creator>
      <dc:date>2018-05-16T08:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse Strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reverse-Strings/m-p/462599#M117798</link>
      <description>&lt;P&gt;Well, that's not really reversed, just swapped over.&amp;nbsp; You could do:&lt;/P&gt;
&lt;PRE&gt;want=catx(';',scan(have,2,";"),scan(have,1,";"));
&lt;/PRE&gt;
&lt;P&gt;I suspect your issue is more complicated than that.&amp;nbsp; I would split the string up into rows of data with one element per row.&amp;nbsp; Then have a look up merge, for country, and one for city, merge that on to get a flag for wether it is a country or city, then transpose it up.&amp;nbsp; Provide some test data in the form of a datastep and can show code.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 08:41:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reverse-Strings/m-p/462599#M117798</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-05-16T08:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse Strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reverse-Strings/m-p/462600#M117799</link>
      <description>&lt;P&gt;Thanks a lot for your advice&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 08:45:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reverse-Strings/m-p/462600#M117799</guid>
      <dc:creator>cmoore</dc:creator>
      <dc:date>2018-05-16T08:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Reverse Strings</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reverse-Strings/m-p/462602#M117801</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
  a='Munich; Germany';
  b=catt(scan(a,2,";"),"; ",scan(a,1,";"));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 May 2018 08:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reverse-Strings/m-p/462602#M117801</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2018-05-16T08:48:27Z</dc:date>
    </item>
  </channel>
</rss>

