<?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: Guidance, trying to take the difference of columns to an output table. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Guidance-trying-to-take-the-difference-of-columns-to-an-output/m-p/545173#M150788</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/197485"&gt;@zsmith93&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;A href="https://www.kaggle.com/wsj/college-salaries#degrees-that-pay-back.csv" target="_blank" rel="noopener"&gt;https://www.kaggle.com/wsj/college-salaries#degrees-that-pay-back.csv&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but when I run my proc's the process just keeps running indefinitely.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show us your code, or better yet, the LOG (the entire LOG, not just the errors) by pasting the LOG into the window that appears when you click on the {i} icon.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2019 10:54:06 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-03-22T10:54:06Z</dc:date>
    <item>
      <title>Guidance, trying to take the difference of columns to an output table.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Guidance-trying-to-take-the-difference-of-columns-to-an-output/m-p/544968#M150725</link>
      <description>&lt;P&gt;So my goal is to take two data sets and make an output table in which I take the difference between two fields while also keeping one of the fields from both data sets that correspond to their records.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;E.g., import(major, median, ...) and import1(name, region, strtMedian, ...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data Diff_Acct_Cali;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;set work.accounting_major, work.cali_region;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;difference = (accounting_major.median - cali_region.startMedian);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;keep accounting_major.major cali_region.name difference;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm trying to do is take a record from work.accounting_major and work.cali_region particularly median and startMedian respectively. Save the difference into a new record that has the field major from accounting_major and name from cali_region.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All that gets outputted is a table with a column labeled difference with nothing in it. What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 18:03:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Guidance-trying-to-take-the-difference-of-columns-to-an-output/m-p/544968#M150725</guid>
      <dc:creator>zsmith93</dc:creator>
      <dc:date>2019-03-21T18:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Guidance, trying to take the difference of columns to an output table.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Guidance-trying-to-take-the-difference-of-columns-to-an-output/m-p/544978#M150730</link>
      <description>&lt;P&gt;Since we don't have your data, all we can do is clean up your code. Then it's up to you to get it to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;set work.accounting_major, work.cali_region;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;probably should be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;merge work.accounting_major work.cali_region;
by id_variable; /* MAY NOT BE NEEDED, but we don't have your data to know for sure */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Merges are usually needed if you want to do a subtraction of a variable in one data set from a variable in another data set.&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;Then,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;difference = (accounting_major.median - cali_region.startMedian);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is a problem as well, you can't use SQL syntax mixed in with DATA step syntax. You need to use only data step syntax. Most likely you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;difference = median - startmedian;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but again, I don't have your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might want to work through some beginner examples and view some beginner tutorials on SAS, as these are rather basic errors.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 18:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Guidance-trying-to-take-the-difference-of-columns-to-an-output/m-p/544978#M150730</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-21T18:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Guidance, trying to take the difference of columns to an output table.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Guidance-trying-to-take-the-difference-of-columns-to-an-output/m-p/545043#M150744</link>
      <description>&lt;P&gt;&lt;A href="https://www.kaggle.com/wsj/college-salaries#degrees-that-pay-back.csv" target="_blank" rel="noopener"&gt;https://www.kaggle.com/wsj/college-salaries#degrees-that-pay-back.csv&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The data sets can be found there. What I'm trying to do is compare the median salary of each major from the&amp;nbsp;&lt;SPAN&gt;degrees-that-pay-back.csv&amp;nbsp;compared to each university in a given region from the&amp;nbsp;salaries-by-region.csv. I'm trying to present this as a bar graph where the y axis is the median salary and the x axis would the universities. Yes I understand this should be very easy but when I run my proc's the process just keeps running indefinitely.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 21:02:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Guidance-trying-to-take-the-difference-of-columns-to-an-output/m-p/545043#M150744</guid>
      <dc:creator>zsmith93</dc:creator>
      <dc:date>2019-03-21T21:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Guidance, trying to take the difference of columns to an output table.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Guidance-trying-to-take-the-difference-of-columns-to-an-output/m-p/545173#M150788</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/197485"&gt;@zsmith93&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;A href="https://www.kaggle.com/wsj/college-salaries#degrees-that-pay-back.csv" target="_blank" rel="noopener"&gt;https://www.kaggle.com/wsj/college-salaries#degrees-that-pay-back.csv&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but when I run my proc's the process just keeps running indefinitely.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show us your code, or better yet, the LOG (the entire LOG, not just the errors) by pasting the LOG into the window that appears when you click on the {i} icon.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2019 10:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Guidance-trying-to-take-the-difference-of-columns-to-an-output/m-p/545173#M150788</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-22T10:54:06Z</dc:date>
    </item>
  </channel>
</rss>

