<?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 Character function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560901#M156936</link>
    <description>&lt;P&gt;data code2;&lt;BR /&gt;input country$ 10.;&lt;BR /&gt;datalines;&lt;BR /&gt;IndiaIN&lt;BR /&gt;AmericaAM&lt;BR /&gt;IndiaIN&lt;BR /&gt;canadaCA&lt;BR /&gt;FranceFR&lt;BR /&gt;IndiaIN&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=code;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data test4;&lt;BR /&gt;set code2;&lt;BR /&gt;Position=find(country,"IN");&lt;BR /&gt;/*am=find(country,"AM"); */&lt;BR /&gt;/*ca=find(country,"CA");&lt;BR /&gt;fr=find(country,"FR");*/&lt;BR /&gt;Ccode=substr(country,Position);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;expecting all country code under Ccode variable.&lt;/P&gt;</description>
    <pubDate>Wed, 22 May 2019 17:23:38 GMT</pubDate>
    <dc:creator>Ajayvit</dc:creator>
    <dc:date>2019-05-22T17:23:38Z</dc:date>
    <item>
      <title>Character function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560901#M156936</link>
      <description>&lt;P&gt;data code2;&lt;BR /&gt;input country$ 10.;&lt;BR /&gt;datalines;&lt;BR /&gt;IndiaIN&lt;BR /&gt;AmericaAM&lt;BR /&gt;IndiaIN&lt;BR /&gt;canadaCA&lt;BR /&gt;FranceFR&lt;BR /&gt;IndiaIN&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=code;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data test4;&lt;BR /&gt;set code2;&lt;BR /&gt;Position=find(country,"IN");&lt;BR /&gt;/*am=find(country,"AM"); */&lt;BR /&gt;/*ca=find(country,"CA");&lt;BR /&gt;fr=find(country,"FR");*/&lt;BR /&gt;Ccode=substr(country,Position);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;expecting all country code under Ccode variable.&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 17:23:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560901#M156936</guid>
      <dc:creator>Ajayvit</dc:creator>
      <dc:date>2019-05-22T17:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Character function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560905#M156938</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/193095"&gt;@Ajayvit&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you asking for&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

data code2;
input country$ 10.;
datalines;
IndiaIN
AmericaAM
IndiaIN
canadaCA
FranceFR
IndiaIN
;
run;


data test4;
set code2;
Ccode=substr(country,length(country)-2+1);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Ccode=substr(country,length(country)-1);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 May 2019 17:30:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560905#M156938</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-05-22T17:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Character function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560919#M156945</link>
      <description>&lt;P&gt;Do all of the values have the country code as the last two characters?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;code = substr(country,length(country)-1);
country=substr(country,1,length(country)-2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or do you need to hunt for them?&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 17:58:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560919#M156945</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-22T17:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Character function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560928#M156948</link>
      <description>Are you sure you don't have a delimiter? Can you view the file in NotePad++ and show a screenshot with invisible characters shown? It would be bad practice to store data like, not that it hasn't happened before, but it's so bad that I would expect a different approach to be available.</description>
      <pubDate>Wed, 22 May 2019 18:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560928#M156948</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-22T18:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Character function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560996#M156979</link>
      <description>Dear Reeza,&lt;BR /&gt;&lt;BR /&gt;Thank you for replying.&lt;BR /&gt;None of the observation is having delimiter.&lt;BR /&gt;</description>
      <pubDate>Thu, 23 May 2019 00:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560996#M156979</guid>
      <dc:creator>Ajayvit</dc:creator>
      <dc:date>2019-05-23T00:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Character function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560997#M156980</link>
      <description>Dear,&lt;BR /&gt;&lt;BR /&gt;Thank you for your reply. I am getting same o/p what i was expecting.&lt;BR /&gt;</description>
      <pubDate>Thu, 23 May 2019 00:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Character-function/m-p/560997#M156980</guid>
      <dc:creator>Ajayvit</dc:creator>
      <dc:date>2019-05-23T00:34:43Z</dc:date>
    </item>
  </channel>
</rss>

