<?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 scramble the subject id within a dataset with a condition applied only for few datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/730025#M227270</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp; I had tried that yesterday and its working now. Thanks a lot for this solution. I am able to send the reports on time.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Mar 2021 09:56:36 GMT</pubDate>
    <dc:creator>Ravindra_</dc:creator>
    <dc:date>2021-03-30T09:56:36Z</dc:date>
    <item>
      <title>How do i scramble the subject id within a dataset with a condition applied only for few datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729948#M227227</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp; can you please help me with this&lt;/P&gt;&lt;P&gt;The dataset is below&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;&lt;P&gt;and&amp;nbsp;&lt;SPAN&gt;i have got 3 datasets where i need to blind only the subjects those were having a specific condition, for example CM dataset has a variable called CMANG and if CMANG =Yes only then i need to scramble or else the rest of the subjects should remain same without any scrambling. Client is having this requirement only for 3 datasets and the rest of the datasets will be scrambled as per earlier solution you had provided.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks a lot for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 04:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729948#M227227</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2021-03-30T04:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do i scramble the subject id within a dataset with a condition applied only for few datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729963#M227234</link>
      <description>&lt;P&gt;What does scramble mean? Please be specific.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 05:29:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729963#M227234</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-03-30T05:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do i scramble the subject id within a dataset with a condition applied only for few datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729968#M227238</link>
      <description>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 scramble the subject id, i.e i need to assign a subejct id from one record to other record and so on but i should not make any modification to the subject id for example: 1,2,3,4,5 are subject id's and these need to assigned as 3,5,1,4,2. here we are not making any modification but just scrambling subject id. For few datasets i only need to scramble those subjects that were having a specific condition like CMANG=yes... hope this clarifies.</description>
      <pubDate>Tue, 30 Mar 2021 05:49:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729968#M227238</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2021-03-30T05:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do i scramble the subject id within a dataset with a condition applied only for few datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729969#M227239</link>
      <description>&lt;P&gt;Please post data matching your description. You are mentioning the variable cmang, but it is not in the dataset you have posted.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 05:53:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729969#M227239</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-03-30T05:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do i scramble the subject id within a dataset with a condition applied only for few datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729971#M227241</link>
      <description>&lt;P&gt;When you say scramble, do you mean randomly assign a number starting with 1?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 06:02:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729971#M227241</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-03-30T06:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do i scramble the subject id within a dataset with a condition applied only for few datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729978#M227246</link>
      <description>&lt;P&gt;The modified data including CMANG variable as below&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ndsn;
infile datalines;
input subjid  study  site  cmang $3. usubjid $15.;
datalines;
120 303 100 Yes 303-100-120
121 303 100 No  303-100-121
122 303 101 Yes 303-101-122
123 303 101 No  303-101-123
124 303 102 No  303-102-124
125 303 102 No  303-102-125
126 303 103 Yes 303-103-126
127 303 103 No  303-103-127
128 303 104 No  303-104-128
129 303 104 No  303-104-129
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When the variable CMANG=Yes only then they need to get scrambled&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 06:32:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729978#M227246</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2021-03-30T06:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do i scramble the subject id within a dataset with a condition applied only for few datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729993#M227255</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260204"&gt;@Ravindra_&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;Have you tried the &lt;A href="https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-without-making/m-p/729825/highlight/true#M227192" target="_blank" rel="noopener"&gt;suggestion I made yesterday in the previous thread&lt;/A&gt; for exactly this type of data? In short: split -- scramble -- interleave.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In detail:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Split */

data cm_yes cm_rest;
set ndsn;
if cmang='Yes' then output cm_yes;
else output cm_rest;
run;

/* Scramble */

proc surveyselect data=cm_yes(keep=usubjid) seed=5772 noprint
                   out=cm_yes_scrm_id(keep=usubjid) samprate=1 outrandom;
run;

data cm_yes1;
merge cm_yes(drop=usubjid) cm_yes_scrm_id;
run;

/* Interleave */

data want;
set cm_yes1 cm_rest;
by study site subjid;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Mar 2021 07:46:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/729993#M227255</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-03-30T07:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do i scramble the subject id within a dataset with a condition applied only for few datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/730025#M227270</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp; I had tried that yesterday and its working now. Thanks a lot for this solution. I am able to send the reports on time.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 09:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-i-scramble-the-subject-id-within-a-dataset-with-a/m-p/730025#M227270</guid>
      <dc:creator>Ravindra_</dc:creator>
      <dc:date>2021-03-30T09:56:36Z</dc:date>
    </item>
  </channel>
</rss>

