<?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: Percentage Order in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Percentage-Order/m-p/171020#M12298</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried implementing the following code, but have received an error regarding the size of the data. I have attached the error below and have subsequently selected 'no'. Just wandering because of this, this could explain why the proc report step hadn't run hence why the 'Rulehits' was the final output?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also tried to group by the rule name (which was originally intended) in proc report , which has eliminated the data capacity error but still hasn't ordered the 'Adverse %' column. As below the 'Adverse' column had already been ordered in the proc sql stage, so am a bit confused as to why it hasn't ordered in the proc report stage by default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Assigning Libname */&lt;/P&gt;&lt;P&gt;libname SIRA 'E:\SAS_BI\CFAD\DATA';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data SAS_Extract;&lt;/P&gt;&lt;P&gt;Set SIRA.SIRA_SCORES;&lt;/P&gt;&lt;P&gt;policy_number_1 = substr(policy_number,verify(policy_number,'0'));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;create table RULEHIT as&amp;nbsp; &lt;/P&gt;&lt;P&gt;select distinct policy_number,&lt;/P&gt;&lt;P&gt;rule_name,&lt;/P&gt;&lt;P&gt;case when action_status in ('Fraud ','Inconsistency','Suspect') then 1 else 0 end as Adverse&lt;/P&gt;&lt;P&gt;from SAS_EXTRACT &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table RULEHITS as&lt;/P&gt;&lt;P&gt;Select RH.Policy_Number, Adverse, rule_name&lt;/P&gt;&lt;P&gt;from RULEHIT RH&lt;/P&gt;&lt;P&gt;group by RH.Policy_Number&lt;/P&gt;&lt;P&gt;order by Adverse descending;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data= RULEHITS split="~" style(header)=[vjust=b] nowd headline headskip;&lt;/P&gt;&lt;P&gt;title1 "Fraud Rates For Most Common SIRA Rule Hits";&lt;/P&gt;&lt;P&gt;column rule_name n Adverse Adverse=pct;&lt;/P&gt;&lt;P&gt;define rule_name / order order=data 'Rule Name';&lt;/P&gt;&lt;P&gt;define n /'N';&lt;/P&gt;&lt;P&gt;define Adverse / analysis Sum 'Adverse';&lt;/P&gt;&lt;P&gt;define Pct / analysis mean format = percent9.2 'Adverse %';&lt;/P&gt;&lt;P&gt;rbreak after / Summarize;&lt;/P&gt;&lt;P&gt;Compute after;&lt;/P&gt;&lt;P&gt;rule_name = 'Total';&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11910i5CBF042EEDAC5DFA/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Rulehits.JPG" title="Rulehits.JPG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11911i8671064F08A30264/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Large Results Error.JPG" title="Large Results Error.JPG" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Feb 2015 15:48:01 GMT</pubDate>
    <dc:creator>ToonKnight</dc:creator>
    <dc:date>2015-02-24T15:48:01Z</dc:date>
    <item>
      <title>Percentage Order</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Percentage-Order/m-p/171017#M12295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm just trying to order the 'Adverse %' column descending wise but have had no success. I've tried using versions of the order function on the 'Adverse %' statement but this has still not outputted the desired result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code for this report is outlined below;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Assigning Libname */&lt;/P&gt;&lt;P&gt;libname SIRA 'E:\SAS_BI\CFAD\DATA';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data SAS_Extract;&lt;/P&gt;&lt;P&gt;Set SIRA.SIRA_SCORES;&lt;/P&gt;&lt;P&gt;policy_number_1 = substr(policy_number,verify(policy_number,'0'));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;create table RULEHIT as&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;select distinct policy_number,&lt;/P&gt;&lt;P&gt;rule_name,&lt;/P&gt;&lt;P&gt;case when action_status in ('Fraud ','Inconsistency','Suspect') then 1 else 0 end as Adverse&lt;/P&gt;&lt;P&gt;from SAS_EXTRACT&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;roc report data= RULEHIT split="~" style(header)=[vjust=b] nowd headline headskip;&lt;/P&gt;&lt;P&gt;title1 "Fraud Rates For Most Common SIRA Rule Hits";&lt;/P&gt;&lt;P&gt;column rule_name n adverse adverse=pct;&lt;/P&gt;&lt;P&gt;define rule_name / group 'Rule Name';&lt;/P&gt;&lt;P&gt;define n / 'N';&lt;/P&gt;&lt;P&gt;define adverse / analysis sum 'Adverse';&lt;/P&gt;&lt;P&gt;define Pct / analysis mean format = percent9.2 'Adverse %';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a also a screenshot attached to show the result output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would really appreciate the help,&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11207iD8FE9E7E7BF7635B/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Pct Order.JPG" title="Pct Order.JPG" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2015 17:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Percentage-Order/m-p/171017#M12295</guid>
      <dc:creator>ToonKnight</dc:creator>
      <dc:date>2015-02-16T17:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Order</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Percentage-Order/m-p/171018#M12296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; You are creating a grouped report. That means your ADVERSE column is a summary column (summarized from your individual detail rows). So you cannot ask for ADVERSE to be summarized and then to set the order in the same step. Generally, this means you have to make 2 passes thru the data. There is an example of this in my paper "Creating Complex Reports" -- see example 3 on page 11. And I believe I have posted the example on the forum in answer to a previous posting.&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/message/16737#16737"&gt;https://communities.sas.com/message/16737#16737&lt;/A&gt; &lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="active_link" href="https://communities.sas.com/message/50676#50676"&gt;https://communities.sas.com/message/50676#50676&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 03:09:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Percentage-Order/m-p/171018#M12296</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2015-02-17T03:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Order</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Percentage-Order/m-p/171019#M12297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For your scenario , This could be done easily by SQL .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2015 05:24:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Percentage-Order/m-p/171019#M12297</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-02-17T05:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Order</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Percentage-Order/m-p/171020#M12298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried implementing the following code, but have received an error regarding the size of the data. I have attached the error below and have subsequently selected 'no'. Just wandering because of this, this could explain why the proc report step hadn't run hence why the 'Rulehits' was the final output?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also tried to group by the rule name (which was originally intended) in proc report , which has eliminated the data capacity error but still hasn't ordered the 'Adverse %' column. As below the 'Adverse' column had already been ordered in the proc sql stage, so am a bit confused as to why it hasn't ordered in the proc report stage by default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Assigning Libname */&lt;/P&gt;&lt;P&gt;libname SIRA 'E:\SAS_BI\CFAD\DATA';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data SAS_Extract;&lt;/P&gt;&lt;P&gt;Set SIRA.SIRA_SCORES;&lt;/P&gt;&lt;P&gt;policy_number_1 = substr(policy_number,verify(policy_number,'0'));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;create table RULEHIT as&amp;nbsp; &lt;/P&gt;&lt;P&gt;select distinct policy_number,&lt;/P&gt;&lt;P&gt;rule_name,&lt;/P&gt;&lt;P&gt;case when action_status in ('Fraud ','Inconsistency','Suspect') then 1 else 0 end as Adverse&lt;/P&gt;&lt;P&gt;from SAS_EXTRACT &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table RULEHITS as&lt;/P&gt;&lt;P&gt;Select RH.Policy_Number, Adverse, rule_name&lt;/P&gt;&lt;P&gt;from RULEHIT RH&lt;/P&gt;&lt;P&gt;group by RH.Policy_Number&lt;/P&gt;&lt;P&gt;order by Adverse descending;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data= RULEHITS split="~" style(header)=[vjust=b] nowd headline headskip;&lt;/P&gt;&lt;P&gt;title1 "Fraud Rates For Most Common SIRA Rule Hits";&lt;/P&gt;&lt;P&gt;column rule_name n Adverse Adverse=pct;&lt;/P&gt;&lt;P&gt;define rule_name / order order=data 'Rule Name';&lt;/P&gt;&lt;P&gt;define n /'N';&lt;/P&gt;&lt;P&gt;define Adverse / analysis Sum 'Adverse';&lt;/P&gt;&lt;P&gt;define Pct / analysis mean format = percent9.2 'Adverse %';&lt;/P&gt;&lt;P&gt;rbreak after / Summarize;&lt;/P&gt;&lt;P&gt;Compute after;&lt;/P&gt;&lt;P&gt;rule_name = 'Total';&lt;/P&gt;&lt;P&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11910i5CBF042EEDAC5DFA/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Rulehits.JPG" title="Rulehits.JPG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11911i8671064F08A30264/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Large Results Error.JPG" title="Large Results Error.JPG" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Feb 2015 15:48:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Percentage-Order/m-p/171020#M12298</guid>
      <dc:creator>ToonKnight</dc:creator>
      <dc:date>2015-02-24T15:48:01Z</dc:date>
    </item>
  </channel>
</rss>

