<?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: Words Manupulation in a String in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603762#M174952</link>
    <description>&lt;P&gt;Sightly simpler:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;mod&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(I&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;substr&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;X,I&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;upcase&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;char&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(X,I&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Nov 2019 04:59:29 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2019-11-13T04:59:29Z</dc:date>
    <item>
      <title>Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603751#M174943</link>
      <description>&lt;P&gt;HI Good Morning&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wan to below output is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OUTPUT:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
x='sas is the leader in analytics';
put x;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SaS iS tHE lEaDeR iN aNaLyTiCs&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 03:55:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603751#M174943</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-11-13T03:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603754#M174944</link>
      <description>&lt;P&gt;Not sure why you'd want to do this but LENGTH() will give you the length of the string, CHAR() with an index will give you the specific character and you can change the case using UPCASE()/LOWCASE() to change the case. &lt;BR /&gt;&lt;BR /&gt;You need a do loop to loop over the characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;HI Good Morning&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wan to below output is&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OUTPUT:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
x='sas is the leader in analytics';
put x;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;SaS iS tHE lEaDeR iN aNaLyTiCs&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 04:49:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603754#M174944</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-13T04:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603755#M174945</link>
      <description>&lt;P&gt;Hi Reeza&lt;/P&gt;&lt;P&gt;This is interview question&lt;/P&gt;&lt;P&gt;can we solve it&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 04:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603755#M174945</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-11-13T04:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603756#M174946</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
format x $50.;
x='sas is the leader in analytics';
do i=1 to length(x);
	if mod(i,2)&amp;gt;0 then substr(x,i,1)= upcase(substr(x,i,1));
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;-unison&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 04:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603756#M174946</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2019-11-13T04:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603757#M174947</link>
      <description>&lt;P&gt;Here is one way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  length word $20.;
  length y $80.;
  x='sas is the leader in analytics';
  n=1;
  do until (missing(scan(x,n)));
    word=scan(x,n);
    if not missing(word) then do;
      if n eq 1 then do;
        substr(word,1,1) = upcase(substr(word,1,1));
        substr(word,3,1) = upcase(substr(word,3,1));
      end;
      else if n eq 3 then do;
      substr(word,2,1) = upcase(substr(word,2,1));
      substr(word,3,1) = upcase(substr(word,3,1));
      end;
      else do i=2 to length(word) by 2;
        substr(word,i,1) = upcase(substr(word,i,1));
      end;
      put word;
      y=catx(' ',y,word);
      n+1;
    end;
  end;
  put x;
  put y;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 04:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603757#M174947</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2019-11-13T04:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603758#M174948</link>
      <description>&lt;P&gt;Hi Unison&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much&amp;nbsp; brilliant code&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 04:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603758#M174948</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-11-13T04:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603759#M174949</link>
      <description>&lt;P&gt;Than You sir support&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your coding skills are par excellence&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 04:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603759#M174949</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-11-13T04:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603760#M174950</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Reeza&lt;/P&gt;
&lt;P&gt;This is interview question&lt;/P&gt;
&lt;P&gt;can we solve it&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're assuming your interviewer can't see this page by the way.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 04:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603760#M174950</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-13T04:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603762#M174952</link>
      <description>&lt;P&gt;Sightly simpler:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;mod&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(I&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;substr&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;X,I&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;upcase&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;char&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(X,I&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 04:59:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603762#M174952</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-11-13T04:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603784#M174966</link>
      <description>&lt;P&gt;Just my two cents worth - I personally can't see the point of interview questions about things you would never do in a real job. If you want to test a candidate's string manipulation skills then choose real-life examples like names, addresses, job descriptions etc.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 07:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603784#M174966</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-11-13T07:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603819#M174979</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
x='sas is the leader in analytics';
y=prxchange('s/(.)(.)/\u\1\2/',-1,x);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Nov 2019 11:52:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603819#M174979</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-11-13T11:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603864#M174988</link>
      <description>&lt;P&gt;You will fail the question if you provide the response you chose as correct. Carefully compare the test phrase with the output from each suggestion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 13:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603864#M174988</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2019-11-13T13:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603872#M174990</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your example, H and E in "tHE" are both upper case. I guess this is a mistake and so is the remainder of&lt;/P&gt;
&lt;P&gt;the example string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
    x='sas is the leader in analytics';

    upcase_this=1;

    do i=1 to length(x);
        if anyalpha(substr(x,i))=1 then do;
            if upcase_this then substr(x,i,1)=upcase(substr(x,i,1));
            upcase_this=1-upcase_this;
        end;
    end;
    put x;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Nov 2019 14:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603872#M174990</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2019-11-13T14:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603896#M175002</link>
      <description>&lt;P&gt;My first response would be: What are the actual RULES involved in the manipulation? One single literal example =&amp;gt; Type the desired response. Why bother attempting to GUESS an algorithm without rules to implement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example deduce the rule behind:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp; =&amp;gt; 3&lt;/P&gt;
&lt;P&gt;2&amp;nbsp;&amp;nbsp; =&amp;gt; 3&lt;/P&gt;
&lt;P&gt;3&amp;nbsp;&amp;nbsp; =&amp;gt; 5&lt;/P&gt;
&lt;P&gt;4&amp;nbsp;&amp;nbsp; =&amp;gt; 4&lt;/P&gt;
&lt;P&gt;5&amp;nbsp;&amp;nbsp; =&amp;gt; 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what would be the result for 6, 7 and 8?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 16:07:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/603896#M175002</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-13T16:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Words Manupulation in a String</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/604266#M175168</link>
      <description>Maybe, This is a decent question to test if a candidate has the skills they claim. It's basic enough that most programmers should understand it and it's quick without having to ask many questions. This is something a beginner SAS programmer should be able to answer in less than 30 minutes. Some orgs have limits on what we can test - my current one only allows me an hour, where the previous role I used to ask for a take home test that was definitely time intensive.</description>
      <pubDate>Thu, 14 Nov 2019 20:08:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Words-Manupulation-in-a-String/m-p/604266#M175168</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-14T20:08:18Z</dc:date>
    </item>
  </channel>
</rss>

