<?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: Help to join and re-label variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334919#M75688</link>
    <description>Apologies it was not clear. The DAD_01 in table one links to the ID 01 in table two. So I would first have to extract the integers from DAD_01 to link it to ID 01</description>
    <pubDate>Wed, 22 Feb 2017 12:26:47 GMT</pubDate>
    <dc:creator>Havi</dc:creator>
    <dc:date>2017-02-22T12:26:47Z</dc:date>
    <item>
      <title>Help to join and re-label variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334907#M75684</link>
      <description>&lt;P&gt;Hi Guys&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help with the issue below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have table one: SAMPLE1&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Date &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Grade &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Cost &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DAD_01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DAD_03 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DAD_10 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DAD_20&lt;BR /&gt;20170101 &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 100 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;70&lt;BR /&gt;20170101 &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 200 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;125 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 75&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have table two: REFERENCE1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CATEGORY &amp;nbsp; &amp;nbsp; &amp;nbsp; NAME &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UNIT&lt;BR /&gt;01 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PAID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XXX &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;R&lt;BR /&gt;03 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UNPAID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;YYY &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&lt;BR /&gt;10 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; PAID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ZZZ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; R&lt;BR /&gt;20 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; UNPAID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PPP &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;X&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The desired output is to link the ID in table one to the reference data in table two:&lt;/P&gt;
&lt;P&gt;The desired output:&lt;/P&gt;
&lt;P&gt;Date &amp;nbsp; &amp;nbsp; &amp;nbsp; Grade &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Cost &amp;nbsp; &amp;nbsp; &amp;nbsp; R_PAID &amp;nbsp; &amp;nbsp; &amp;nbsp; X_UNPAID &lt;BR /&gt;20170101 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 70&lt;BR /&gt;20170101 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;200 &amp;nbsp; &amp;nbsp; &amp;nbsp; 125 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;75 &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 12:11:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334907#M75684</guid>
      <dc:creator>Havi</dc:creator>
      <dc:date>2017-02-22T12:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help to join and re-label variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334912#M75685</link>
      <description>&lt;P&gt;Fist off, post test data in the form of a datastep. &amp;nbsp;Also, "&lt;SPAN&gt;The desired output is to link the ID in table one to the reference data in table two:" - how, there doesn't appear to be any logical link between them. &amp;nbsp;Also clarify why you want to do it as simply:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data want (keep=date grade cost r_paid x_unpaid);
  set have;
  array vars{*} dad_:;
  do i=1 to dim(vars{*});
    if vars{i} ne "" and r_paid="" then r_paid=vars{i};
    else if vars{i} ne "" and x_unpaid="" then x_unpaid=vars{i};
  end;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Should get you the output, the second table is irrelevant.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 12:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334912#M75685</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-02-22T12:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help to join and re-label variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334913#M75686</link>
      <description>&lt;P&gt;What if both&amp;nbsp;&lt;SPAN&gt;DAD_01 and&amp;nbsp;DAD_10 contains values?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 12:19:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334913#M75686</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-02-22T12:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: Help to join and re-label variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334917#M75687</link>
      <description>&lt;P&gt;I would want to sum the values from DAD_01 and DAD_10&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 12:24:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334917#M75687</guid>
      <dc:creator>Havi</dc:creator>
      <dc:date>2017-02-22T12:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help to join and re-label variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334919#M75688</link>
      <description>Apologies it was not clear. The DAD_01 in table one links to the ID 01 in table two. So I would first have to extract the integers from DAD_01 to link it to ID 01</description>
      <pubDate>Wed, 22 Feb 2017 12:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334919#M75688</guid>
      <dc:creator>Havi</dc:creator>
      <dc:date>2017-02-22T12:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help to join and re-label variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334920#M75689</link>
      <description>Ideally I want to sum all the values in table one with the ID properties from table two. Table two is important and acts as a reference table for the ID's to determine PAID/UNPAID and UNIT i.e R/X. I then want to concat the properties eg R_PAID with the values from the ID.</description>
      <pubDate>Wed, 22 Feb 2017 12:34:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334920#M75689</guid>
      <dc:creator>Havi</dc:creator>
      <dc:date>2017-02-22T12:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help to join and re-label variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334924#M75691</link>
      <description>&lt;P&gt;Ah, ok I see. &amp;nbsp;Then the logic would be something like:&lt;BR /&gt;1) Normalise sample1, something like:&lt;/P&gt;
&lt;PRE&gt;proc transpose data=sample1 out=sample;
  by date grade cost;
  var dad:;
run;
&lt;/PRE&gt;
&lt;P&gt;2) Process that to remove DAD_from _name_.&lt;/P&gt;
&lt;P&gt;3) Datastep sum up the values, or use summary/means&lt;/P&gt;
&lt;P&gt;4) Merge other dataset.&lt;/P&gt;
&lt;P&gt;5) Transpose back up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you post test data, in the form of a datastep, then I can try some code.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 12:39:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-to-join-and-re-label-variables/m-p/334924#M75691</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-02-22T12:39:48Z</dc:date>
    </item>
  </channel>
</rss>

