<?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 Recoding variables from group identifier to interval label. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887452#M350608</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have to recode variables from dataset_1 where each value is represented as a number that ranges from 1 to 10 (quantile group). I have a dataset_2 with 10 rows where the variables are the same. Now I want to replace the group number in dataset_1 by the value [row_i, var_j] in dataset_2. I was considering using a two dimensional array but I'm still stuck with the problem. Does anyone have an idea on how to achieve this ? Thanks in advance !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;O.D.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;E.g.,&lt;BR /&gt;Dataset_1&lt;BR /&gt;height weight time&lt;BR /&gt;1 2 2&lt;BR /&gt;1 3 2&lt;BR /&gt;2 2 2&lt;BR /&gt;&lt;BR /&gt;Dataset_2&lt;BR /&gt;height weight time&lt;BR /&gt;height&amp;lt;10 weight&amp;lt;15 time&amp;lt;1&lt;/P&gt;&lt;P&gt;10&amp;lt;=height&amp;lt;20 15&amp;lt;=weight&amp;lt;30 1&amp;lt;=time&amp;lt;5&lt;/P&gt;&lt;P&gt;20&amp;lt;=height 30&amp;lt;=weight 5&amp;lt;=time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want&lt;/P&gt;&lt;P&gt;height weight time&lt;/P&gt;&lt;P&gt;height&amp;lt;10 15&amp;lt;=weight&amp;lt;30 1&amp;lt;=time&amp;lt;5&lt;/P&gt;&lt;P&gt;height&amp;lt;10 30&amp;lt;=weight 1&amp;lt;=time&amp;lt;5&lt;/P&gt;&lt;P&gt;10&amp;lt;=height&amp;lt;20 15&amp;lt;=weight&amp;lt;30 1&amp;lt;=time&amp;lt;5&lt;/P&gt;</description>
    <pubDate>Wed, 02 Aug 2023 09:18:30 GMT</pubDate>
    <dc:creator>odozzz4</dc:creator>
    <dc:date>2023-08-02T09:18:30Z</dc:date>
    <item>
      <title>Recoding variables from group identifier to interval label.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887452#M350608</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have to recode variables from dataset_1 where each value is represented as a number that ranges from 1 to 10 (quantile group). I have a dataset_2 with 10 rows where the variables are the same. Now I want to replace the group number in dataset_1 by the value [row_i, var_j] in dataset_2. I was considering using a two dimensional array but I'm still stuck with the problem. Does anyone have an idea on how to achieve this ? Thanks in advance !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;O.D.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;E.g.,&lt;BR /&gt;Dataset_1&lt;BR /&gt;height weight time&lt;BR /&gt;1 2 2&lt;BR /&gt;1 3 2&lt;BR /&gt;2 2 2&lt;BR /&gt;&lt;BR /&gt;Dataset_2&lt;BR /&gt;height weight time&lt;BR /&gt;height&amp;lt;10 weight&amp;lt;15 time&amp;lt;1&lt;/P&gt;&lt;P&gt;10&amp;lt;=height&amp;lt;20 15&amp;lt;=weight&amp;lt;30 1&amp;lt;=time&amp;lt;5&lt;/P&gt;&lt;P&gt;20&amp;lt;=height 30&amp;lt;=weight 5&amp;lt;=time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want&lt;/P&gt;&lt;P&gt;height weight time&lt;/P&gt;&lt;P&gt;height&amp;lt;10 15&amp;lt;=weight&amp;lt;30 1&amp;lt;=time&amp;lt;5&lt;/P&gt;&lt;P&gt;height&amp;lt;10 30&amp;lt;=weight 1&amp;lt;=time&amp;lt;5&lt;/P&gt;&lt;P&gt;10&amp;lt;=height&amp;lt;20 15&amp;lt;=weight&amp;lt;30 1&amp;lt;=time&amp;lt;5&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 09:18:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887452#M350608</guid>
      <dc:creator>odozzz4</dc:creator>
      <dc:date>2023-08-02T09:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding variables from group identifier to interval label.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887460#M350613</link>
      <description>&lt;P&gt;Formats are often used to replace values, unfortunately dataset_2 is hardly usable as source for formats. Can you post the dataset in usable form, so that we have something to work with?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 10:49:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887460#M350613</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2023-08-02T10:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding variables from group identifier to interval label.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887462#M350615</link>
      <description>&lt;P&gt;I would turn Dataset_2 into a CNTLIN data set for PROC FORMAT. Then you can use these formats to change the appearance of the values in dataset_1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Agreeing with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;that dataset_2 is in a poor layout, better it should be long and vertical rather than wide.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example of creating a CNTLIN data set for PROC FORMAT:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/proc/n1e19y6lrektafn1kj6nbvhus59w.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/proc/n1e19y6lrektafn1kj6nbvhus59w.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 11:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887462#M350615</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-02T11:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding variables from group identifier to interval label.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887467#M350618</link>
      <description>&lt;P&gt;Here is a sample of variables from the format table. As you can see, the number of groups by variable can be lower than 10.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data format_table;
informat avg_trans_value $50. avg_val_day $50. avg_val_day_mcc $50. avg_val_day_pos $50. avg_vol_day $50. avg_vol_day_mcc $50.;
infile datalines delimiter='|';
input avg_trans_value avg_val_day avg_val_day_mcc avg_val_day_pos avg_vol_day avg_vol_day_mcc;
datalines;
avg_trans_value &amp;lt; 13	|avg_val_day &amp;lt; 4.83	|avg_val_day_mcc &amp;lt; 19.98	|avg_val_day_pos &amp;lt; 35.43	|avg_vol_day &amp;lt; 2, _MISSING_	|avg_vol_day_mcc &amp;lt; 1.93
13 &amp;lt;= avg_trans_value &amp;lt; 17	|4.83 &amp;lt;= avg_val_day &amp;lt; 9	|19.98 &amp;lt;= avg_val_day_mcc &amp;lt; 24.54	|35.43 &amp;lt;= avg_val_day_pos &amp;lt; 38.77, _MISSING_	|2 &amp;lt;= avg_vol_day &amp;lt; 3	|1.93 &amp;lt;= avg_vol_day_mcc &amp;lt; 2.27
17 &amp;lt;= avg_trans_value &amp;lt; 19	|9 &amp;lt;= avg_val_day &amp;lt; 10.51	|24.54 &amp;lt;= avg_val_day_mcc &amp;lt; 25.84	|38.77 &amp;lt;= avg_val_day_pos &amp;lt; 66.05	|3 &amp;lt;= avg_vol_day &amp;lt; 4	|2.27 &amp;lt;= avg_vol_day_mcc &amp;lt; 2.32
19 &amp;lt;= avg_trans_value &amp;lt; 23	|10.51 &amp;lt;= avg_val_day &amp;lt; 16.79	|25.84 &amp;lt;= avg_val_day_mcc &amp;lt; 26.52	|66.05 &amp;lt;= avg_val_day_pos	|4 &amp;lt;= avg_vol_day &amp;lt; 6	|2.32 &amp;lt;= avg_vol_day_mcc &amp;lt; 2.48, _MISSING_
23 &amp;lt;= avg_trans_value &amp;lt; 27	|16.79 &amp;lt;= avg_val_day &amp;lt; 24.69, _MISSING_	|26.52 &amp;lt;= avg_val_day_mcc &amp;lt; 28.15	|		|6 &amp;lt;= avg_vol_day	|2.48 &amp;lt;= avg_vol_day_mcc &amp;lt; 2.65
27 &amp;lt;= avg_trans_value &amp;lt; 30	|24.69 &amp;lt;= avg_val_day &amp;lt; 37.96	|28.15 &amp;lt;= avg_val_day_mcc &amp;lt; 34.42	|		|		|2.65 &amp;lt;= avg_vol_day_mcc &amp;lt; 2.8
30 &amp;lt;= avg_trans_value &amp;lt; 36	|37.96 &amp;lt;= avg_val_day &amp;lt; 51.8	|34.42 &amp;lt;= avg_val_day_mcc &amp;lt; 36.4	|		|		|2.8 &amp;lt;= avg_vol_day_mcc &amp;lt; 2.93
36 &amp;lt;= avg_trans_value &amp;lt; 44	|51.8 &amp;lt;= avg_val_day &amp;lt; 83.42	|36.4 &amp;lt;= avg_val_day_mcc &amp;lt; 42.05	|		|		|2.93 &amp;lt;= avg_vol_day_mcc &amp;lt; 3.11
44 &amp;lt;= avg_trans_value &amp;lt; 78, _MISSING_	|83.42 &amp;lt;= avg_val_day	|42.05 &amp;lt;= avg_val_day_mcc &amp;lt; 48.14	|		|		|3.11 &amp;lt;= avg_vol_day_mcc &amp;lt; 3.6
78 &amp;lt;= avg_trans_value	|		|48.14 &amp;lt;= avg_val_day_mcc, _MISSING_	|		|		|3.6 &amp;lt;= avg_vol_day_mcc
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Aug 2023 12:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887467#M350618</guid>
      <dc:creator>odozzz4</dc:creator>
      <dc:date>2023-08-02T12:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding variables from group identifier to interval label.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887469#M350619</link>
      <description>&lt;P&gt;Many of us, including me, will not download Excel (or other Microsoft Office) documents as they are a security threat. I personally will not download any attachments at all. Thus, we request that you provide data as WORKING SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;examples and instructions&lt;/A&gt;). Many people ignore this request —&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/407433"&gt;@odozzz4&lt;/a&gt;&amp;nbsp;please&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;DO NOT IGNORE THIS REQUEST&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 11:50:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887469#M350619</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-08-02T11:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Recoding variables from group identifier to interval label.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887591#M350657</link>
      <description>&lt;P&gt;Just one word for that "format table": Gaaack!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are these supposed to mean. There are more. You have a single value in the table with, a range AND a value of _missing_? If you have a numeric value for avg_trans_value then I doubt you will see "_MISSING_" as a value for the variable and placing it in the middle of those definitions is definitely confusing.&lt;/P&gt;
&lt;P&gt;44 &amp;lt;= avg_trans_value &amp;lt; 78, _MISSING_&lt;/P&gt;
&lt;P&gt;16.79 &amp;lt;= avg_val_day &amp;lt; 24.69, _MISSING_&lt;/P&gt;
&lt;P&gt;48.14 &amp;lt;= avg_val_day_mcc, _MISSING_&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 21:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Recoding-variables-from-group-identifier-to-interval-label/m-p/887591#M350657</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-08-02T21:55:45Z</dc:date>
    </item>
  </channel>
</rss>

