<?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: Recoding variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Recoding-variables/m-p/491953#M129188</link>
    <description>&lt;P&gt;Recode from what to what? You didn’t explain that part.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the missing that’s trivial. Add an IF statement than checks your two variables and if they are not correct CALL MISSING sets the variables to missing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If ... then call missing (var1,var2, ...., varn);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: You're probably looking at two array and a loop here. Not sure if you’re indicating just those two values with the set to missing or any N where a/2. Some sample input and output data would help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Array tutorial on recoding here&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-arrays/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-arrays/&lt;/A&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221360"&gt;@yoyong&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need help with recording.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two sets of variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First set contains the following:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LOC_P1__1,&amp;nbsp; &amp;nbsp;LOC_P1__2,..&amp;nbsp; LOC_P1__N,&amp;nbsp; &amp;nbsp; LOC_P2__1, LOC_P2__2, LOC_P2__N,...&lt;/P&gt;
&lt;P&gt;Second set contains the following:&amp;nbsp;TYPE&lt;SPAN&gt;_P1__1, TYPE_P1__2,..TYPE_P1__N, TYPE_P2__1,TYPE_P2__2, TYPE_P2__N,...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The options for 1st set are: a,b,c,d.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The options for 2nd set are: 1,2,3,4.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For each pair of variables (e.g. LOC_P1__1 and TYPE_P1__1, LOC_P1__N and TYPE_P1__N), I would like to recode where LOC_P1__1 = a and TYPE_P1__1 = 2; otherwise other possible combinations should be equal to missing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How do I recode it without doing it multiple times?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Sep 2018 01:22:58 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-09-03T01:22:58Z</dc:date>
    <item>
      <title>Recoding variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recoding-variables/m-p/491940#M129182</link>
      <description>&lt;P&gt;Hi everyone.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help with recording.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two sets of variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First set contains the following:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LOC_P1__1,&amp;nbsp; &amp;nbsp;LOC_P1__2,..&amp;nbsp; LOC_P1__N,&amp;nbsp; &amp;nbsp; LOC_P2__1, LOC_P2__2, LOC_P2__N,...&lt;/P&gt;&lt;P&gt;Second set contains the following:&amp;nbsp;TYPE&lt;SPAN&gt;_P1__1, TYPE_P1__2,..TYPE_P1__N, TYPE_P2__1,TYPE_P2__2, TYPE_P2__N,...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The options for 1st set are: a,b,c,d.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The options for 2nd set are: 1,2,3,4.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For each pair of variables (e.g. LOC_P1__1 and TYPE_P1__1, LOC_P1__N and TYPE_P1__N), I would like to recode where LOC_P1__1 = a and TYPE_P1__1 = 2; otherwise other possible combinations should be equal to missing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How do I recode it without doing it multiple times?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Sep 2018 23:28:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recoding-variables/m-p/491940#M129182</guid>
      <dc:creator>yoyong</dc:creator>
      <dc:date>2018-09-02T23:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recoding-variables/m-p/491953#M129188</link>
      <description>&lt;P&gt;Recode from what to what? You didn’t explain that part.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the missing that’s trivial. Add an IF statement than checks your two variables and if they are not correct CALL MISSING sets the variables to missing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If ... then call missing (var1,var2, ...., varn);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: You're probably looking at two array and a loop here. Not sure if you’re indicating just those two values with the set to missing or any N where a/2. Some sample input and output data would help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Array tutorial on recoding here&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-arrays/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-arrays/&lt;/A&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221360"&gt;@yoyong&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need help with recording.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two sets of variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First set contains the following:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LOC_P1__1,&amp;nbsp; &amp;nbsp;LOC_P1__2,..&amp;nbsp; LOC_P1__N,&amp;nbsp; &amp;nbsp; LOC_P2__1, LOC_P2__2, LOC_P2__N,...&lt;/P&gt;
&lt;P&gt;Second set contains the following:&amp;nbsp;TYPE&lt;SPAN&gt;_P1__1, TYPE_P1__2,..TYPE_P1__N, TYPE_P2__1,TYPE_P2__2, TYPE_P2__N,...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The options for 1st set are: a,b,c,d.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The options for 2nd set are: 1,2,3,4.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For each pair of variables (e.g. LOC_P1__1 and TYPE_P1__1, LOC_P1__N and TYPE_P1__N), I would like to recode where LOC_P1__1 = a and TYPE_P1__1 = 2; otherwise other possible combinations should be equal to missing.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;How do I recode it without doing it multiple times?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Sep 2018 01:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recoding-variables/m-p/491953#M129188</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-03T01:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recoding-variables/m-p/491998#M129218</link>
      <description>&lt;P&gt;Post test data in the form of a datastep:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then show what the output should look like.&amp;nbsp; It is impossible for us to suggest something on things we cannot see.&amp;nbsp; From your text it looks like you have some variables for Last Observation Carried Forward (LOCF), could I ask why your not utilising CDISC standards on the format of your data, as these would then be identified as parameters?&amp;nbsp; That would be a very different structure to the one you describe.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Sep 2018 07:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recoding-variables/m-p/491998#M129218</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-03T07:44:54Z</dc:date>
    </item>
  </channel>
</rss>

