<?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: Calculate volatility in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calculate-volatility/m-p/6385#M2504</link>
    <description>Hi:&lt;BR /&gt;
  This is not really an ODS or Base Reporting procedure (PRINT, REPORT, TABULATE) question. Although, 5 could be done by any of the above procedures; report 6 probably is best done with PROC REPORT.&lt;BR /&gt;
&lt;BR /&gt;
  You can either create your fields as part of the merge that creates table 3 or in a separate query, after table 3 is created.&lt;BR /&gt;
&lt;BR /&gt;
  Then, once that you have table 3, you can work on the report tasks 5 . Here's an example of a few reports using sashelp.shoes:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods listing;&lt;BR /&gt;
proc print data=sashelp.shoes noobs n;&lt;BR /&gt;
  title '5) Detail Listing with Sum';&lt;BR /&gt;
  by region;&lt;BR /&gt;
  var region product sales;&lt;BR /&gt;
  sum sales;&lt;BR /&gt;
run;&lt;BR /&gt;
     &lt;BR /&gt;
proc tabulate data=sashelp.shoes f=8.2;&lt;BR /&gt;
  title '5) Summary Report with Grand Total and Percents';&lt;BR /&gt;
  class region product;&lt;BR /&gt;
  var sales returns;&lt;BR /&gt;
  table region all, n pctn;&lt;BR /&gt;
  table product all, n pctn;&lt;BR /&gt;
  table region all,  sales* (n pctn sum*f=comma12. pctsum);&lt;BR /&gt;
  table product all,  sales* (n pctn sum*f=comma12. pctsum);&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
   &lt;BR /&gt;
#6 doesn't exactly look like a report -- but maybe it is. It looks like you only want the calculation to be done on the 0/1 field that you set in b. Here's a possible solution using a DATA step and PROC REPORT:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data calcvar;&lt;BR /&gt;
  set sashelp.shoes;&lt;BR /&gt;
  where product in ('Slipper', 'Sandal', 'Boot');&lt;BR /&gt;
    if product = 'Slipper' then numvar = 0;&lt;BR /&gt;
    else if product = 'Boot' then numvar = 0;&lt;BR /&gt;
    else numvar = 1;&lt;BR /&gt;
run;&lt;BR /&gt;
      &lt;BR /&gt;
proc report data=calcvar nowd;&lt;BR /&gt;
  title '6) One Possible Solution';&lt;BR /&gt;
  where product in ('Slipper', 'Sandal', 'Boot');&lt;BR /&gt;
  column region product sales inventory numvar ;&lt;BR /&gt;
  define region / group;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales / sum;&lt;BR /&gt;
  define inventory / sum;&lt;BR /&gt;
  define numvar / sum;&lt;BR /&gt;
  break after region / summarize skip;&lt;BR /&gt;
  compute after region;&lt;BR /&gt;
     divnum = numvar.sum / .24;&lt;BR /&gt;
     line 'The number is: ' divnum comma8.2;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
       &lt;BR /&gt;
For further help, you might consider looking at the SAS documentation or contacting Tech Support.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Thu, 17 Jan 2008 16:33:49 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2008-01-17T16:33:49Z</dc:date>
    <item>
      <title>Calculate volatility</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calculate-volatility/m-p/6384#M2503</link>
      <description>Hi  &lt;BR /&gt;
 I got customer data for 24 months and their booking data. i need to find their volatility based on their median  as follows processor . i been asked &lt;BR /&gt;
&lt;BR /&gt;
  Summarise data to partner, month, booknet (table1)&lt;BR /&gt;
&lt;BR /&gt;
2.       Calculate median booknet for each customer&lt;BR /&gt;
&lt;BR /&gt;
3.       Create a table containing customer, booknet_median (table2)&lt;BR /&gt;
&lt;BR /&gt;
4.       Merge table1 and table 2 (into table3), create fields&lt;BR /&gt;
&lt;BR /&gt;
a.        ‘vola’ = booknet/booknet_median*100, &lt;BR /&gt;
&lt;BR /&gt;
b.      vola_75_125 = if index between 75 and 125 then 1 else 0&lt;BR /&gt;
&lt;BR /&gt;
5.       Summarise table3 by customer, sum vola_75_125 (table 4)&lt;BR /&gt;
&lt;BR /&gt;
6.       Calculate volatility as sum vola_75_125/24%&lt;BR /&gt;
&lt;BR /&gt;
 so for i used  proc summey an d i am stucked at    ' a'  can any one help me out &lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
chand</description>
      <pubDate>Wed, 16 Jan 2008 09:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calculate-volatility/m-p/6384#M2503</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-01-16T09:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate volatility</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calculate-volatility/m-p/6385#M2504</link>
      <description>Hi:&lt;BR /&gt;
  This is not really an ODS or Base Reporting procedure (PRINT, REPORT, TABULATE) question. Although, 5 could be done by any of the above procedures; report 6 probably is best done with PROC REPORT.&lt;BR /&gt;
&lt;BR /&gt;
  You can either create your fields as part of the merge that creates table 3 or in a separate query, after table 3 is created.&lt;BR /&gt;
&lt;BR /&gt;
  Then, once that you have table 3, you can work on the report tasks 5 . Here's an example of a few reports using sashelp.shoes:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods listing;&lt;BR /&gt;
proc print data=sashelp.shoes noobs n;&lt;BR /&gt;
  title '5) Detail Listing with Sum';&lt;BR /&gt;
  by region;&lt;BR /&gt;
  var region product sales;&lt;BR /&gt;
  sum sales;&lt;BR /&gt;
run;&lt;BR /&gt;
     &lt;BR /&gt;
proc tabulate data=sashelp.shoes f=8.2;&lt;BR /&gt;
  title '5) Summary Report with Grand Total and Percents';&lt;BR /&gt;
  class region product;&lt;BR /&gt;
  var sales returns;&lt;BR /&gt;
  table region all, n pctn;&lt;BR /&gt;
  table product all, n pctn;&lt;BR /&gt;
  table region all,  sales* (n pctn sum*f=comma12. pctsum);&lt;BR /&gt;
  table product all,  sales* (n pctn sum*f=comma12. pctsum);&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
   &lt;BR /&gt;
#6 doesn't exactly look like a report -- but maybe it is. It looks like you only want the calculation to be done on the 0/1 field that you set in b. Here's a possible solution using a DATA step and PROC REPORT:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data calcvar;&lt;BR /&gt;
  set sashelp.shoes;&lt;BR /&gt;
  where product in ('Slipper', 'Sandal', 'Boot');&lt;BR /&gt;
    if product = 'Slipper' then numvar = 0;&lt;BR /&gt;
    else if product = 'Boot' then numvar = 0;&lt;BR /&gt;
    else numvar = 1;&lt;BR /&gt;
run;&lt;BR /&gt;
      &lt;BR /&gt;
proc report data=calcvar nowd;&lt;BR /&gt;
  title '6) One Possible Solution';&lt;BR /&gt;
  where product in ('Slipper', 'Sandal', 'Boot');&lt;BR /&gt;
  column region product sales inventory numvar ;&lt;BR /&gt;
  define region / group;&lt;BR /&gt;
  define product / group;&lt;BR /&gt;
  define sales / sum;&lt;BR /&gt;
  define inventory / sum;&lt;BR /&gt;
  define numvar / sum;&lt;BR /&gt;
  break after region / summarize skip;&lt;BR /&gt;
  compute after region;&lt;BR /&gt;
     divnum = numvar.sum / .24;&lt;BR /&gt;
     line 'The number is: ' divnum comma8.2;&lt;BR /&gt;
  endcomp;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
       &lt;BR /&gt;
For further help, you might consider looking at the SAS documentation or contacting Tech Support.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 17 Jan 2008 16:33:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calculate-volatility/m-p/6385#M2504</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2008-01-17T16:33:49Z</dc:date>
    </item>
  </channel>
</rss>

