<?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 Map numbered variable values on a huge set of variables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Map-numbered-variable-values-on-a-huge-set-of-variables/m-p/983038#M43651</link>
    <description>&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;suppose to have the following dataset:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data DB;
  input ID :$20.  Marker1 :$20. Marker2 :$20. Marker3 :$20. Marker4 :$20. Marker5 :$20.;
cards;
0001  CD34      .        .   CD33     Other,specify 
0001    .  CD303 (BDCA2) .     .             .
0002    .       .        .     .           CD14
0002   CD3      .       CD14  CD3           .
 
; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It contains measurements (i.e., numbers not shown for simplicity) for each marker.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For each patient different markers were measured. It means not only different types like CD33 or CD14 but also different choices (Marker1-Marker5). I don't know a lot on this data. I only know that they result from a survey.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can see also, that IDs (patients) are repeated and this is because measurements were repeated during the same day or at different dates. Dates are not shown for simplicity.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Marker* variables are Char but I can only see "Other, specify" when I read the input file. The remining values like for example CD33 are numbers like 11 etc. I have the list of markers and I can link the number to the specific marker, for example: 1 = CD3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that although the numbered markers are 18, the variables Marker* are 50 (Marker1-Marker50).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there an efficient way to map all the numbers to the corresponding marker name on such a huge number of variables (Marker*)?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Feb 2026 19:11:11 GMT</pubDate>
    <dc:creator>NewUsrStat</dc:creator>
    <dc:date>2026-02-04T19:11:11Z</dc:date>
    <item>
      <title>Map numbered variable values on a huge set of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Map-numbered-variable-values-on-a-huge-set-of-variables/m-p/983038#M43651</link>
      <description>&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;suppose to have the following dataset:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data DB;
  input ID :$20.  Marker1 :$20. Marker2 :$20. Marker3 :$20. Marker4 :$20. Marker5 :$20.;
cards;
0001  CD34      .        .   CD33     Other,specify 
0001    .  CD303 (BDCA2) .     .             .
0002    .       .        .     .           CD14
0002   CD3      .       CD14  CD3           .
 
; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It contains measurements (i.e., numbers not shown for simplicity) for each marker.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For each patient different markers were measured. It means not only different types like CD33 or CD14 but also different choices (Marker1-Marker5). I don't know a lot on this data. I only know that they result from a survey.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can see also, that IDs (patients) are repeated and this is because measurements were repeated during the same day or at different dates. Dates are not shown for simplicity.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Marker* variables are Char but I can only see "Other, specify" when I read the input file. The remining values like for example CD33 are numbers like 11 etc. I have the list of markers and I can link the number to the specific marker, for example: 1 = CD3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that although the numbered markers are 18, the variables Marker* are 50 (Marker1-Marker50).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there an efficient way to map all the numbers to the corresponding marker name on such a huge number of variables (Marker*)?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 19:11:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Map-numbered-variable-values-on-a-huge-set-of-variables/m-p/983038#M43651</guid>
      <dc:creator>NewUsrStat</dc:creator>
      <dc:date>2026-02-04T19:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Map numbered variable values on a huge set of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Map-numbered-variable-values-on-a-huge-set-of-variables/m-p/983042#M43652</link>
      <description>Can you provide the list of markers?</description>
      <pubDate>Wed, 04 Feb 2026 20:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Map-numbered-variable-values-on-a-huge-set-of-variables/m-p/983042#M43652</guid>
      <dc:creator>quickbluefish</dc:creator>
      <dc:date>2026-02-04T20:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Map numbered variable values on a huge set of variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Map-numbered-variable-values-on-a-huge-set-of-variables/m-p/983044#M43653</link>
      <description>&lt;P&gt;Sounds like you just want to transpose the data.&amp;nbsp; Perhaps keeping track of where the values appeared originally.&lt;/P&gt;
&lt;P&gt;First let's make a working data set that includes your other series of variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data DB;
  input (ID Marker1-Marker5) (&amp;amp;:$20.) Value1-Value5 ;
cards;
0001  CD34              .     .  CD33  Other,specify  
      1 . . 2 3
0001     .  CD303 (BDCA2)     .     .              .  
      . 4 . . .
0002     .              .     .     .           CD14  
      . . . . 5
0002   CD3              .  CD14   CD3              .
      6 . 7 8 .
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now we can just use a couple of ARRAYs to transpose the marker/value pairs into separate observations.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tall;
  set db;
  by id ;
  if first.id then repeat=0;
  repeat+1;
  array mark Marker1-Marker5 ;
  array val  Value1-Value5 ;
  do location=1 to dim(mark);
    Marker=mark[location];
    Value=val[location];
    if cmiss(marker,value)&amp;lt;2 then output;
  end;
  drop Marker1-Marker5 Value1-Value5;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-02-04 at 3.08.54 PM.png" style="width: 504px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113010i3FC1132BB7C7E1AC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-02-04 at 3.08.54 PM.png" alt="Screenshot 2026-02-04 at 3.08.54 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 20:09:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Map-numbered-variable-values-on-a-huge-set-of-variables/m-p/983044#M43653</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2026-02-04T20:09:18Z</dc:date>
    </item>
  </channel>
</rss>

