<?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: SAS creating a dynamic interval in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-creating-a-dynamic-interval/m-p/85445#M501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using PROC IML? If so, please post some sample code. If you are using the DATA step, you might want to post these questions to the DATA step forum at &lt;A _jive_internal="true" href="https://communities.sas.com/community/support-communities/sas_macro_facility_data_step_and_sas_language_elements"&gt;https://communities.sas.com/community/support-communities/sas_macro_facility_data_step_and_sas_language_elements&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 17 Jun 2012 17:12:12 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2012-06-17T17:12:12Z</dc:date>
    <item>
      <title>SAS creating a dynamic interval</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-creating-a-dynamic-interval/m-p/85444#M500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0px 0px 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;This is somewhat complex (well to me at least).&lt;/P&gt;&lt;P style="margin: 0px 0px 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Here is what I have to do: Say that I have the following dataset:&lt;/P&gt;&lt;PRE style="margin: 0 0 10px; padding: 5px; font-size: 14px; background-color: #eeeeee; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; color: #000000;"&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;date price volume &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;02-Sep 40 100 &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;03-Sep 45 200 &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;04-Sep 46 150 &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;05-Sep 43 300 &lt;/CODE&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P style="margin: 0px 0px 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Say that I have a breakpoint where I wish to create an interval in my dataset. For instance, let my breakpoint = 200 volume transaction.&lt;/P&gt;&lt;P style="margin: 0px 0px 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;What I want is to create an ID column and record an ID variable =1,2,3,... for every breakpoint = 200. When you sum all the volume per ID, the value must be constant across all ID variables.&lt;/P&gt;&lt;P style="margin: 0px 0px 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;So using my example above, my final dataset should look like the following:&lt;/P&gt;&lt;PRE style="margin: 0 0 10px; padding: 5px; font-size: 14px; background-color: #eeeeee; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; color: #000000;"&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;date price volume id &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;02-Sep 40 100 1 &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;03-Sep 45 100 1 &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;03-Sep 45 100 2 &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;04-Sep 46 100 2 &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;04-Sep 46 50 3 &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;"&gt;05-Sep 43 150 &lt;/CODE&gt;3&lt;/P&gt;
&lt;P&gt;05-Sep 43 150 4 (last row can miss some value but that is fine. I will kick out the last id) &lt;/P&gt;
&lt;/PRE&gt;&lt;P style="margin: 0px 0px 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;As you can see, I had to "decompose" some rows (like the second row for instance, I break the 200 into two 100 volume) in order to have constant value of the sum, 200, of volume across all ID.&lt;/P&gt;&lt;P style="margin: 0px 0px 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Can anyone help me out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jun 2012 16:50:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-creating-a-dynamic-interval/m-p/85444#M500</guid>
      <dc:creator>charlesmartineau</dc:creator>
      <dc:date>2012-06-17T16:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS creating a dynamic interval</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-creating-a-dynamic-interval/m-p/85445#M501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using PROC IML? If so, please post some sample code. If you are using the DATA step, you might want to post these questions to the DATA step forum at &lt;A _jive_internal="true" href="https://communities.sas.com/community/support-communities/sas_macro_facility_data_step_and_sas_language_elements"&gt;https://communities.sas.com/community/support-communities/sas_macro_facility_data_step_and_sas_language_elements&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jun 2012 17:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-creating-a-dynamic-interval/m-p/85445#M501</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-06-17T17:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS creating a dynamic interval</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-creating-a-dynamic-interval/m-p/85446#M502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rick, I could use IML. But you are right. I have to post my question in the appropriate section - sas macro facility. Hopefully someone can help out. I've been struggling with this one!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jun 2012 18:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/SAS-creating-a-dynamic-interval/m-p/85446#M502</guid>
      <dc:creator>charlesmartineau</dc:creator>
      <dc:date>2012-06-17T18:07:06Z</dc:date>
    </item>
  </channel>
</rss>

