<?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: Rounding the fixed number to produce unoverlapped interval range in macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566575#M159253</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The author's response to my inquiry how to modify his annual rate macro to monthly and weekly is following.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dickman.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30316iA0FECF1419D12FE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="dickman.png" alt="dickman.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and his complete program for calculating annual rate is here: &lt;A href="http://www.pauldickman.com/survival/sas/survival.sas" target="_blank" rel="noopener"&gt;http://www.pauldickman.com/survival/sas/survival.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2019 14:25:08 GMT</pubDate>
    <dc:creator>Cruise</dc:creator>
    <dc:date>2019-06-17T14:25:08Z</dc:date>
    <item>
      <title>Rounding the fixed number to produce unoverlapped interval range in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566546#M159241</link>
      <description>&lt;P&gt;Hello folks :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to calculate monthly survival rates using the %lexis macro shown in the code snippet below. DX and EXIT are date of diagnosis and date of censoring in days , respectively. Scale is set to 365.24 because time units need to be in years. In order to calculate&lt;FONT face="arial,helvetica,sans-serif"&gt; monthly rate &lt;/FONT&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;"breaks = %str( 0 to 1 by 0.083333)" was used where 0.083333~1/12&amp;nbsp;&lt;/FONT&gt;&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;. However, I have to round 0.083333 in the calculation of a variable 'length' to more decimal places to produce a correct time range. The current range has overlapped borders: 0.2-0.2; 0.7-0.7 as shown int he image below. The desired output is either range 1 or range 2 depending on the number of places for rounding.&amp;nbsp; Please see image below. &lt;BR /&gt;&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;I don't use macro extensively. Would you please help in rounding of 0.08333 in the macro below to more decimal places to produce a desired time range such as range 1 or 2 shown in red in the image below?&amp;nbsp; &lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="desired range.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30315iF6481379A8161319/image-size/large?v=v2&amp;amp;px=999" role="button" title="desired range.png" alt="desired range.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input id age yydx year8594 dx exit d;
cards;
1 78 1978 0 6854 9365 1 
21 76 1976 0 6063 6078 1 
;

%macro Lexis ( data = ,       /* Data set with original data,             */
                              /*    defaults to _last_                    */
                out = ,       /* Where to put the result,                 */
                              /*    defaults to &amp;amp;data.                    */
              entry = entry,  /* Variable holding the entry date          */
               exit = exit,   /* Variable holding the exit date           */
               fail = fail,   /* Variable holding the exit status         */
                              /* If any of the entry, exit or fail        */
                              /*    variables are missing the person is   */
                              /*    discarded from the computations.      */
             breaks = ,       /* Specification of the cutpoints on        */
                              /*    the transformed scale.                */
                              /*    Syntax as for a do statement.         */
                              /*    The ONLY Mandatory argument.          */
               cens = 0,      /* Code for censoring (may be a variable)   */
              scale = 1,      /* Factor to transform from the scale       */
                              /*    of entry and exit to the scale        */
                              /*    where breaks and risk are given       */
             origin = 0,      /* Origin of the transformed scale          */
               risk = risk,   /* Variable recieving the risk time         */
              lrisk = lrisk,  /* Variable recieving the log(risk time)    */
               left = left,   /* Variable recieving left  endpoint of int */
              other = ,       /* Other dataset statements to be used such */
                              /*     as: %str( format var ddmmyy10. ; )   */
                              /*     or: %str( label risk ="P-years" ; )  */
               disc = discrd, /* Dataset holding discarded observations   */
           /*-------------------------------------------------------------*/
           /* Variables for making life-tables and other housekeeping:    */
           /* These will only appear in the output dataset if given here  */
           /* The existence of these arguments are tested in the macro so */
           /* they cannot have names that are also logical operators such */
           /* as: or, and, eq, ne, le, lt, gt.                            */
           /*-------------------------------------------------------------*/
              right = ,       /* Variable recieving right endpoint of int */
               lint = ,       /* Variable recieving interval length       */
            os_left = ,       /* Variable recieving left  endpoint of int */
           os_right = ,       /* Variable recieving right endpoint of int */
            os_lint = ,       /* Variable recieving interval length       */
                              /*    - the latter three on original scale  */
               cint = ,       /* Variable recieving censoring indicator   */
                              /*    for the current input record          */
               nint =         /* Variable recieving index of follow-up    */
                              /*       interval;                          */
              );

%if &amp;amp;breaks.= %then %put ERROR: breaks MUST be specified. ;
%if &amp;amp;data.  = %then %let data = &amp;amp;syslast. ;
%if &amp;amp;out.   = %then %do ;
                    %let out=&amp;amp;data. ;
                    %put
NOTE: Output dataset not specified, input dataset %upcase(&amp;amp;data.) will be overwritten. ;
                  %end ;

data &amp;amp;disc. &amp;amp;out. ;
  set &amp;amp;data. ;
  if ( nmiss ( &amp;amp;entry., &amp;amp;exit., &amp;amp;fail., &amp;amp;origin. ) gt 0 ) 
     then do ; output &amp;amp;disc. ;
               goto next ;
          end ;
  * Labelling of variables ;
  label &amp;amp;entry.  = 'Entry into interval' ;
  label &amp;amp;exit.   = 'Exit from interval' ;
  label &amp;amp;fail.   = 'Failure indicator for interval' ;
  label &amp;amp;risk.   = 'Risktime in interval' ;
  label &amp;amp;lrisk.  = 'Natural log of risktime in interval' ;
  label &amp;amp;left.   = 'Left endpoint of interval (transformed scale)' ;
%if    &amp;amp;right.^= %then  label &amp;amp;right. = 'Right endpoint of interval (transformed scale)' ; ;
%if     &amp;amp;lint.^= %then  label &amp;amp;lint. = 'Interval width (transformed scale)' ; ;
%if  &amp;amp;os_left.^= %then  label &amp;amp;os_left. = 'Left endpoint of interval (original scale)' ; ;
%if &amp;amp;os_right.^= %then  label &amp;amp;os_right. = 'Right endpoint of interval (original scale)' ; ; 
%if  &amp;amp;os_lint.^= %then  label &amp;amp;os_lint. = 'Interval width (original scale)' ; ;
%if     &amp;amp;cint.^= %then  label &amp;amp;cint. = 'Indicator for censoring during the interval' ; ;
%if     &amp;amp;nint.^= %then  label &amp;amp;nint. = 'Sequential index for follow-up interval' ; ;
  &amp;amp;other. ;
  drop _entry_ _exit_ _fail_
       _origin_ _break_
       _cur_r _cur_l _int_r _int_l
       _first_ _cint_ _nint_;

/*
Temporary variables in this macro:

  _entry_  holds entry date on the transformed timescale
  _exit_   holds exit  date on the transformed timescale
  _fail_   holds exit  status
  _break_  current cut-point
  _origin_ origin of the time scale
  _cur_l   left  endpoint of current risk interval
  _cur_r   right endpoint of current risk interval
  _int_l   left  endpoint of current break interval
  _int_r   right endpoint of current break interval
  _first_  indicator for processing of the first break interval
  _cint_   indicator for censoring during the interval
  _nint_   sequential index of interval
   
If a variable with any of these names appear in the input dataset it will
not be present in the output dataset.
*/

  _origin_ = &amp;amp;origin. ;
  _entry_  = ( &amp;amp;entry. - _origin_ ) / &amp;amp;scale. ;
  _exit_   = ( &amp;amp;exit.  - _origin_ ) / &amp;amp;scale. ;
  _fail_   = &amp;amp;fail. ;
  _cur_l   = _entry_ ;
  _first_  = 1 ;

  do _break_ = &amp;amp;breaks. ;
     if _first_ then do ;
        _nint_=-1;
        _cur_l = max ( _break_, _entry_ ) ;
        _int_l = _break_ ;
     end ;
     _nint_ + 1;
     _first_ = 0 ;
     _int_r = _break_ ;
     _cur_r = min ( _exit_, _break_ ) ;
     if _cur_r gt _cur_l then do ;
/*
Endpoints of risk interval are put back on original scale.
If any of left or right are specified the corresponding endpoint
of the break-interval are output.
*/
        &amp;amp;entry.  = _cur_l * &amp;amp;scale. + _origin_ ;
        &amp;amp;exit.   = _cur_r * &amp;amp;scale. + _origin_ ;
        &amp;amp;risk.   = _cur_r - _cur_l ;
        &amp;amp;lrisk.  = log ( &amp;amp;risk. ) ;
        &amp;amp;fail.   = _fail_ * ( _exit_ eq _cur_r ) +
                   &amp;amp;cens. * ( _exit_ gt _cur_r ) ;
        _cint_   = not( _fail_ ) * ( _exit_ eq _cur_r ) ;            
        %if     &amp;amp;left.^= %then &amp;amp;left.     = _int_l ; ;
        %if    &amp;amp;right.^= %then &amp;amp;right.    = _int_r ; ;
        %if     &amp;amp;lint.^= %then &amp;amp;lint.     = _int_r - _int_l ; ;
        %if  &amp;amp;os_left.^= %then &amp;amp;os_left.  = _int_l * &amp;amp;scale. + _origin_ ; ;
        %if &amp;amp;os_right.^= %then &amp;amp;os_right. = _int_r * &amp;amp;scale. + _origin_ ; ; 
        %if  &amp;amp;os_lint.^= %then &amp;amp;os_lint.  = ( _int_r - _int_l ) * &amp;amp;scale. ; ;
        %if     &amp;amp;cint.^= %then &amp;amp;cint.     = _cint_ ; ;
        %if     &amp;amp;nint.^= %then &amp;amp;nint.     = _nint_ ; ;
        output &amp;amp;out. ;
     end ;
     _cur_l = max ( _entry_, _break_ ) ;
     _int_l = _break_ ;
  end ;
  next: ;
run ;

%mend Lexis;

%lexis (data=have, out=have, breaks = %str( 0 to 1 by 0.083333), origin = dx, entry = dx, exit = exit,
fail = d, scale = 365.24, right = right, risk = y, lrisk = ln_y, lint = length, cint = w, nint = fu);

data have; set have;
range=put(left,4.1) || ' - ' || left(put(right,4.1));
run;
proc print; run; 

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; interested in this kinda problem?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 14:14:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566546#M159241</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-06-17T14:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding the fixed number to produce unoverlapped interval range in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566562#M159250</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;However&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;I have to&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;round&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0.083333&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;in&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;the calculation of a variable&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'length'&lt;/SPAN&gt;&lt;SPAN&gt;to more decimal places to produce a correct&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;time&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;range&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;The current&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;range&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;has overlapped borders:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0.2&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;-0.2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0.7&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;-0.7&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;as shown&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;int&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;he image below&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;Either&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;range&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;range&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;is fine depending on the number of places for rounding&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;I do not understand the relationship between the 0.083333 and the 0.2-0.2. Please explain.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;Also, please show us the desired output.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 13:33:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566562#M159250</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-17T13:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding the fixed number to produce unoverlapped interval range in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566570#M159252</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interval length in the life table is defined by the 'breaks' in the macro. For example, breaks = %str( 0 to 10 by 1) would create 1 year length intervals such as 0-1, 1-2, 2-3, 3-4, 4-5, 5-6, 6-7. 7-8, 8-9, 9-10 for 10 year annual survival rates. Here the unit of transforming scale as they called is one. Therefore, macro variables called left (left endpoint of interval) and right&amp;nbsp;(right endpoint of interval) starts with 0 to 1 for the 1st year survival rate then continues until 9-10.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, &lt;BR /&gt;because underlying unit of time based on the input data (annual population lifetable) is a calendar year, I have to cut one year time unit by 12 which is 0.08333~1/12 and define that length in the breaks which is: breaks=%str(0 to 1 by 0.08333) to cut one-year length to 12 parts. This would ideally create 0-1mo, 1-2mo et,c, 11-12 mo intervals in the final life table I posted below (range 1 or range 2 in red). However, 0.083333 doesn't straight forwardly work as 1 unit as was the case for 1-10 annual rates where transforming scale unit is an integer 1.&lt;/P&gt;
&lt;P&gt;When Zero is taken as the left endpoint of the first interval the following image explains why I get 0.2-0.2 and 0.7-0.7 ranges overlapped in the life table. Please see life table I also included in this response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="showcase to Paige.png" style="width: 239px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30312i5115B91F3D1EF7A7/image-size/large?v=v2&amp;amp;px=999" role="button" title="showcase to Paige.png" alt="showcase to Paige.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Macro variable for a variable 'length' is a '&amp;amp;lint' and &amp;amp;lint is created as below in the macro.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%if &amp;amp;left.^= %then &amp;amp;left. = _int_l ; ;&lt;BR /&gt;%if &amp;amp;right.^= %then &amp;amp;right. = _int_r ; ;&lt;BR /&gt;%if &amp;amp;lint.^= %then &amp;amp;lint. = _int_r - _int_l ;&lt;/P&gt;
&lt;P class="x_MsoNormal"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="x_MsoNormal"&gt;Does it clarify? My problem is that I don't how to round 0.08333 in the macro. But I conceptually understand the underlying logic.&lt;/P&gt;
&lt;P class="x_MsoNormal"&gt;The desired output is the range 1 or range 2 in the image below depending how many places we decided to round for.&lt;/P&gt;
&lt;P class="x_MsoNormal"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="x_MsoNormal"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="desired range.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30314i4A68713B26377799/image-size/large?v=v2&amp;amp;px=999" role="button" title="desired range.png" alt="desired range.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 14:13:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566570#M159252</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-06-17T14:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding the fixed number to produce unoverlapped interval range in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566575#M159253</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The author's response to my inquiry how to modify his annual rate macro to monthly and weekly is following.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dickman.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30316iA0FECF1419D12FE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="dickman.png" alt="dickman.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and his complete program for calculating annual rate is here: &lt;A href="http://www.pauldickman.com/survival/sas/survival.sas" target="_blank" rel="noopener"&gt;http://www.pauldickman.com/survival/sas/survival.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 14:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566575#M159253</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-06-17T14:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding the fixed number to produce unoverlapped interval range in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566582#M159258</link>
      <description>&lt;P&gt;To get range2, you multiply left and right by 12 (OR divide by length), then round to an integer&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 14:30:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566582#M159258</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-17T14:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding the fixed number to produce unoverlapped interval range in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566584#M159259</link>
      <description>&lt;P&gt;That sounds like it. Can you help reflect your suggestion inside the macro please? I understand it but couldn't modify the macro.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 14:54:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566584#M159259</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-06-17T14:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding the fixed number to produce unoverlapped interval range in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566602#M159263</link>
      <description>&lt;P&gt;I don't think this is a problem with the macro. I think the problem is here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; have&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; have&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;range&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;left&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;4.1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;||&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;' - '&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;||&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;left&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;put&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;right&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;4.1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and I challenge you to make the proper changes here to fix the problem.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 14:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566602#M159263</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-17T14:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding the fixed number to produce unoverlapped interval range in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566603#M159264</link>
      <description>&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Ok. I'll try and post it back in here</description>
      <pubDate>Mon, 17 Jun 2019 14:58:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566603#M159264</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-06-17T14:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding the fixed number to produce unoverlapped interval range in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566605#M159265</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt; do you mean this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have1; set have;
range=put(left*12,4.0) || ' - ' || left(put(right*12,4.0));
run;
proc print; run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rounded.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30330i2FC9CD431B549698/image-size/large?v=v2&amp;amp;px=999" role="button" title="rounded.png" alt="rounded.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 15:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566605#M159265</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-06-17T15:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding the fixed number to produce unoverlapped interval range in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566617#M159271</link>
      <description>&lt;P&gt;This created weekly rates:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%lexis (data=have, out=have_week, breaks = %str( 0 to 1 by 0.0192307692307692), origin = dx, entry = dx, exit = exit,
fail = d, scale = 365.4, right = right, risk = y, lrisk = ln_y, lint = length, cint = w, nint = fu);
data have_week1; set have_week;
range=put(left*52,4.0) || ' - ' || left(put(right*52,4.0));
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="weekly.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30331i3C983389100F8217/image-size/large?v=v2&amp;amp;px=999" role="button" title="weekly.png" alt="weekly.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 15:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rounding-the-fixed-number-to-produce-unoverlapped-interval-range/m-p/566617#M159271</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2019-06-17T15:23:33Z</dc:date>
    </item>
  </channel>
</rss>

