<?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: How do i mask the values in a variables in order not to show that to a blinded person in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698599#M19647</link>
    <description>&lt;P&gt;In the code above, they will be assigned new random values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can control that with the Call Streaminit. If you run the code below now and in a year, the results will be the same&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set ndsn;
   call streaminit(123);
   newid = catx('-', study, put(rand('integer', 1, 999), z3.), 
                            put(rand('integer', 1, 999), z3.));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 13 Nov 2020 08:47:53 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-11-13T08:47:53Z</dc:date>
    <item>
      <title>How do i mask the values in a variables in order not to show that to a blinded person</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698590#M19642</link>
      <description>&lt;P&gt;I have a dataset with almost more than 1000 subjects and they have subjid in the format of 303-101-120, 303-100-130, 303-103-140........ I need to mask the middle value with some other 3 digit random number and also the last 3 digit value with some other 3 digit value. Is there any possible way i can do that in few steps as its very hectic to change that manually. i have provided a sample code for an example, i have 1000+usubjid. Any help please&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ndsn;
infile datalines;
input subjid  study  site  usubjid $15.;
datalines;
120 303 100 303-100-120
121 303 100 303-100-121
122 303 101 303-101-122
123 303 101 303-101-123
124 303 102 303-102-124
125 303 102 303-102-125
126 303 103 303-103-126
127 303 103 303-103-127
128 303 104 303-104-128
129 303 104 303-104-129
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2020 08:24:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698590#M19642</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2020-11-13T08:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do i mask the values in a variables in order not to show that to a blinded person</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698593#M19643</link>
      <description>&lt;P&gt;When you say 'mask'.. Do you want the overwrite the original values with something else (like 'xxx') or do you want to create a format that does not change the original value, but can make the value appear different?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 08:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698593#M19643</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-13T08:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do i mask the values in a variables in order not to show that to a blinded person</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698595#M19644</link>
      <description>The value should appear different, for example, if the usubjid is 303-100-104 then we need to make it appear as 403-200-304, few stake holders should not see the original value but the format of the variable should remain same.</description>
      <pubDate>Fri, 13 Nov 2020 08:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698595#M19644</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2020-11-13T08:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do i mask the values in a variables in order not to show that to a blinded person</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698597#M19645</link>
      <description>&lt;P&gt;Here is a simple solution. This creates a new variable, so you can hide the 'old' one as you wish.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I simply generate two random integers and insert them with preceding zeros.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set ndsn;
   newid = catx('-', study, put(rand('integer', 1, 999), z3.), 
                            put(rand('integer', 1, 999), z3.));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2020 08:36:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698597#M19645</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-13T08:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do i mask the values in a variables in order not to show that to a blinded person</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698598#M19646</link>
      <description>Thanks a lot for this, it really helps, but one last thing, if i run the same code again after few months when the number of subjects got increased, will the previous random number that was assigned to the old subject, will it be the same or will it get assigned with a new random value</description>
      <pubDate>Fri, 13 Nov 2020 08:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698598#M19646</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2020-11-13T08:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do i mask the values in a variables in order not to show that to a blinded person</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698599#M19647</link>
      <description>&lt;P&gt;In the code above, they will be assigned new random values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We can control that with the Call Streaminit. If you run the code below now and in a year, the results will be the same&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set ndsn;
   call streaminit(123);
   newid = catx('-', study, put(rand('integer', 1, 999), z3.), 
                            put(rand('integer', 1, 999), z3.));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Nov 2020 08:47:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698599#M19647</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-13T08:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do i mask the values in a variables in order not to show that to a blinded person</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698600#M19648</link>
      <description>thanks a lot for this help. This had given me a solution i was looking for hours</description>
      <pubDate>Fri, 13 Nov 2020 08:49:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698600#M19648</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2020-11-13T08:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do i mask the values in a variables in order not to show that to a blinded person</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698601#M19649</link>
      <description>&lt;P&gt;Then I'll charge you two hours only &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a nice day.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 08:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698601#M19649</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-11-13T08:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do i mask the values in a variables in order not to show that to a blinded person</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698996#M19651</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260204"&gt;@Ravindra_&lt;/a&gt;&amp;nbsp; - If you want a masked key which is certain to be the same every time, then using a hash technique is a more reliable approach:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  usubjid = '303-100-120';
  usubjid_key = put(md5(cats('usubjid',usubjid)),$hex10.);
  put _all_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Nov 2020 19:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-i-mask-the-values-in-a-variables-in-order-not-to-show/m-p/698996#M19651</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-11-15T19:49:12Z</dc:date>
    </item>
  </channel>
</rss>

