<?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: sorting categorical data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sorting-categorical-data/m-p/511596#M137698</link>
    <description>Your MERGE is likely wrong. You most likely want a BY statement. &lt;BR /&gt;&lt;BR /&gt;If you can’t figure out the code, use the Tasks and steal the code from the log or in the task itself.</description>
    <pubDate>Fri, 09 Nov 2018 03:57:34 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-11-09T03:57:34Z</dc:date>
    <item>
      <title>sorting categorical data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sorting-categorical-data/m-p/511588#M137696</link>
      <description>&lt;P&gt;I am working on a project and the part I need help on requires:&lt;/P&gt;&lt;P&gt;Data set EMPLOY contains:&lt;/P&gt;&lt;P&gt;ID (employee number),&lt;/P&gt;&lt;P&gt;GENDER, and&lt;/P&gt;&lt;P&gt;&amp;nbsp;DOB (date of birth).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data set PARTS contains:&lt;/P&gt;&lt;P&gt;PART_NO and&lt;/P&gt;&lt;P&gt;PRICE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data set SALES contains:&lt;/P&gt;&lt;P&gt;ID (employee number),&lt;/P&gt;&lt;P&gt;TRANS (transaction number),&lt;/P&gt;&lt;P&gt;PART_NO, and&lt;/P&gt;&lt;P&gt;QUANTITY (for each sales call completed).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Write a SAS program to read the data sets and&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;A listing, sorted by ID, showing ID, the transaction number, and the total sale for each transaction.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I have managed to multiply quantity with price in order to get total sales but I am missing a few values so I know I didn't sort it the right way. I am at a dead end at this point and will appreciate the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my code thus far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname datain 'F:\SAS2018\Data';&lt;/P&gt;&lt;P&gt;/***********************************************************************/&lt;BR /&gt;&lt;BR /&gt;data employ_ds;&lt;BR /&gt;set datain.employ;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=employ_ds;&lt;BR /&gt;format ID z2. Bday MMDDYY8.;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;/***********************************************************************/&lt;BR /&gt;data parts_ds;&lt;BR /&gt;set datain.parts;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=parts_ds;&lt;BR /&gt;format price dollar6.2;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;/***********************************************************************/&lt;BR /&gt;data sales_ds;&lt;BR /&gt;set datain.sales;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=sales_ds;&lt;BR /&gt;run;&lt;BR /&gt;/***********************************************************************/&lt;BR /&gt;data transaction_sales;&lt;BR /&gt;merge datain.sales datain.parts;&lt;BR /&gt;total= quantity*price;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=transcation_sales;&lt;BR /&gt;by ID;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc print data=transaction_sales;&lt;BR /&gt;format ID z2. ;&lt;BR /&gt;run;&lt;BR /&gt;/***************************************************************************************/&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 03:10:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sorting-categorical-data/m-p/511588#M137696</guid>
      <dc:creator>clancaster</dc:creator>
      <dc:date>2018-11-09T03:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: sorting categorical data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sorting-categorical-data/m-p/511596#M137698</link>
      <description>Your MERGE is likely wrong. You most likely want a BY statement. &lt;BR /&gt;&lt;BR /&gt;If you can’t figure out the code, use the Tasks and steal the code from the log or in the task itself.</description>
      <pubDate>Fri, 09 Nov 2018 03:57:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sorting-categorical-data/m-p/511596#M137698</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-11-09T03:57:34Z</dc:date>
    </item>
  </channel>
</rss>

