<?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 Replace individual characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/797621#M313580</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have set of rules to be applied to individual characters&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input str $34.;&lt;BR /&gt;cards;&lt;BR /&gt;my name is john&lt;BR /&gt;;&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;&lt;STRONG&gt;Below is translation rule&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;Letter&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;translation&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;m&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;y&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;n&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;89&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;a&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;22&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;e&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;87&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;i&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;90&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;s&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;24&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;j&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;o&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;64&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;h&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;n&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hence my output should look like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;124589221287902488643258&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried using translate and tranwrd , but somehow could not get individual letters replacement correct.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is really appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Feb 2022 17:08:27 GMT</pubDate>
    <dc:creator>Swapnil_21</dc:creator>
    <dc:date>2022-02-21T17:08:27Z</dc:date>
    <item>
      <title>Replace individual characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/797621#M313580</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have set of rules to be applied to individual characters&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input str $34.;&lt;BR /&gt;cards;&lt;BR /&gt;my name is john&lt;BR /&gt;;&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;&lt;STRONG&gt;Below is translation rule&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 96pt;" border="0" width="128" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl63" style="height: 15.0pt; width: 48pt;"&gt;Letter&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="border-left: none; width: 48pt;"&gt;translation&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;m&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;y&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;45&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;n&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;89&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;a&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;22&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;e&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;87&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;i&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;90&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;s&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;24&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;j&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;88&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;o&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;64&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;h&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;32&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" class="xl63" style="height: 15.0pt; border-top: none;"&gt;n&lt;/TD&gt;
&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hence my output should look like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;124589221287902488643258&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried using translate and tranwrd , but somehow could not get individual letters replacement correct.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help is really appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 17:08:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/797621#M313580</guid>
      <dc:creator>Swapnil_21</dc:creator>
      <dc:date>2022-02-21T17:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Replace individual characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/797633#M313591</link>
      <description>&lt;P&gt;Do you want to change 'n' into '89' or '8'?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 18:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/797633#M313591</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-02-21T18:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Replace individual characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/797658#M313603</link>
      <description>&lt;P&gt;You could use temporary arrays with the CHAR and RANK functions&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input str $34.;
cards;
my name is john
;

data want;
array v {0:27} $3 _temporary_ 
("  " /*
   a    b    c    d    e    f    g    h    i    j */
 "22" "  " "  " "  " "87" "  " "  " "32" "90" "88" /*
   k    l    m    n    o    p    q    r    s    t */
 "  " "  " "12" "89" "64" "  " "  " "  " "24" "  " /*
   u    v    w    x    y    z */
 "  " "  " "  " "  " "45" "  " 
 "**");

array str2 {99} $3 _temporary_;

set have;
length newStr $200;

call missing(of str2{*});
do i = 1 to length(str);
    str2{i} = v{max( min( rank(char(str, i)) - rank("a") + 1, 27), 0)};
    end;
newStr = cats(of str2{*});
drop i;
run;

proc print data=want noobs; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PGStats_0-1645476430485.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68726iC6505F370BCE1295/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PGStats_0-1645476430485.png" alt="PGStats_0-1645476430485.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 20:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/797658#M313603</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2022-02-21T20:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Replace individual characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/797669#M313608</link>
      <description>&lt;P&gt;Where did the space between the words go? You did not specify any rule on handling them but they do not appear in the output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Translate will not work because that translates one character to one character. So "m" to "12" would be one character to 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also have a problem with either Translate or Tranwrd because you want to map the letter n to two different values and neither of the functions are going to like that because the First n that gets changed to 89 will change both and there won't be one to have just 8.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And last, there is nothing in your list creates a 5 in the next to last position. You say the result should be&lt;/P&gt;
&lt;P&gt;1245892212879024886432&lt;FONT color="#FF0000"&gt;&lt;U&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;8&lt;/P&gt;
&lt;P&gt;The 32 just before that comes from the highlighted 5 from the h. If the final n is supposed to become 8, then where did that 5 come from???????&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 22:37:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/797669#M313608</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-21T22:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Replace individual characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/797674#M313611</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292735"&gt;@Swapnil_21&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem of translating &lt;EM&gt;one&lt;/EM&gt; letter into &lt;EM&gt;two&lt;/EM&gt; digits with &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p05ww22zp7lcg3n1bjk7v93tscyo.htm" target="_blank" rel="noopener"&gt;TRANSLATE&lt;/A&gt; can be overcome by means of &lt;EM&gt;hexadecimal&lt;/EM&gt; digits:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
result=put(translate(compress(str),'12458922879024886432'x,'mynaeisjoh'),$hex68.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(assuming that the two inconsistencies the others have mentioned are just typos).&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 22:57:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/797674#M313611</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-02-21T22:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Replace individual characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/798362#M313858</link>
      <description>&lt;P&gt;Looks like I messed up while giving the input . Let me simplify it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Input : War started&lt;/P&gt;
&lt;P&gt;Output: 12345623689&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;W&amp;gt;1,a-&amp;gt;2,r-&amp;gt;3,space-&amp;gt;4,s-&amp;gt;5,t-&amp;gt;6,a-&amp;gt;2,r-&amp;gt;3,t-&amp;gt;6,e-&amp;gt;8,d-&amp;gt;9&lt;/P&gt;
&lt;P&gt;Kindly suggest. If any other approaches then that also suggest. My objective is just to mask the data and i should be able to unmask it later&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 11:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/798362#M313858</guid>
      <dc:creator>Swapnil_21</dc:creator>
      <dc:date>2022-02-24T11:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: Replace individual characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/798366#M313859</link>
      <description>&lt;P&gt;Unmasking is only possible if each char is replaced by the same number of digits. Depending on the chars you expect, using two digits may or may not be sufficient.&lt;/P&gt;
&lt;P&gt;I would define a format as translation table and use a loop for translation. Without the need to unmask the values later, you could use function sha256, the docs have details: &lt;A href="https://documentation.sas.com/doc/de/pgmsascdc/9.4_3.4/lefunctionsref/p04sqiymw1a6unn1uvh943eudcvz.htm" target="_blank"&gt;https://documentation.sas.com/doc/de/pgmsascdc/9.4_3.4/lefunctionsref/p04sqiymw1a6unn1uvh943eudcvz.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 12:19:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/798366#M313859</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-02-24T12:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Replace individual characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/798899#M314067</link>
      <description>&lt;P&gt;You could code and decode your strings using a pseudo-random translation table, based on a (secret) seed. You would need 3 numeric characters in your scrambled string for each character in your original string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input str $34.;
cards;
my name is john
;

/* Set the key to the random permutation */
%let key = 8765764;

data want;
array v {0:255} $3 _temporary_;
if _n_ = 1 then do;
    seed = &amp;amp;key.;
    do i = 0 to 255;
        v{i} = put(i, z3.);
        end;
    call ranperm(seed, of v{*});
    end;
    
length newStr $300;

set have;

call missing(newStr);
do i = 1 to length(str);
    substr(newStr, 3*i-2, 3) = v{rank(char(str, i))};
    end;
drop i seed;
run;

/* Now translate the string back, using the same key, i.e. the same random translation table */

data decode;
array v {0:255} _temporary_;
array x {0:255} _temporary_;
if _n_ = 1 then do;
    seed = &amp;amp;key.;
    do i = 0 to 255;
        x{i} = i;
        end;
    call ranperm(seed, of x{*});
    /* Reverse the translate table */
    do i = 0 to 255;
        v{x{i}} = i;
        end;
    end;
  
set want;

length recStr $100;

call missing(recStr);
do i = 1 to length(newStr)/3;
    substr(recStr, i, 1) = byte(v{input(substr(newStr, 3*i-2, 3), 3.)});
    end;
drop i seed;
run;

proc print data=decode noobs; run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PGStats_0-1645909428116.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/68975iD56D0529E4BFC8DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="PGStats_0-1645909428116.png" alt="PGStats_0-1645909428116.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 21:07:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/798899#M314067</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2022-02-26T21:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Replace individual characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/798950#M314095</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292735"&gt;@Swapnil_21&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to mask the string, you could translate it to octagonal representation. The resulting string is printable and contains only&amp;nbsp;digits 0-7.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everybody could unmask the string if they figure out that it is actually octagonal, so it is not a real encryption with a key, but who would think of octagonal codes in 2022?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And it is a very simple operation i SAS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
  text = 'my name is john';
  text_masked = put(text,$octal200.);
  text_restored = input(text_masked,$octal200.); 
  put text / text_masked  / text_restored;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;my name is john&lt;BR /&gt;155171040156141155145040151163040152157150156&lt;BR /&gt;my name is john&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;turn the string and still have it as a string of printable caharactersby turning it as a string of digits, so it&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Feb 2022 11:39:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Replace-individual-characters/m-p/798950#M314095</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2022-02-27T11:39:45Z</dc:date>
    </item>
  </channel>
</rss>

