<?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: Ceil and floor calculations at [-1,1] in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Ceil-and-floor-calculations-at-1-1/m-p/451001#M113636</link>
    <description>&lt;P&gt;Switching from CEIL to MIN seems like it would do what you are asking.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Apr 2018 10:50:26 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-04-04T10:50:26Z</dc:date>
    <item>
      <title>Ceil and floor calculations at [-1,1]</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ceil-and-floor-calculations-at-1-1/m-p/450953#M113614</link>
      <description>&lt;P&gt;I am calculating a fraction based on the payments made in four years and I wish to put a cap on my fraction such that it can only be between -1 and 1. Subsequently I'd like to make the following fractions 0 if the cap is maxxed out - an example would be:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data want;
input payment1 payment2 payment3 payment4 fraction1 fraction2 fraction3;
datalines;
100 25 25 25 0.25 0.25 0.25
150 50 50 50 0.33 0.33 0.33
50 10 10 10 0.2 0.2 0.2
10 50 60 70 1 0 0
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've been looking at the ceiling function with the following code&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data want2;
set want;

array fraction(3) fraction1 - fraction3;
array payment(4) payment1 - payment4;

do i = 2 to 4;

fraction(i-1) = payment(i)/payment(1);

end;
run;

data want3;
set want2;
array fraction(3) fraction1 - fraction3;
array fract(3) fract1-fract3;

do i = 1 to 3;

fract = ceil (fraction,1); 

end;
drop i;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but I am getting this error&lt;/P&gt;&lt;P&gt;ERROR 72-185: The CEIL function call has too many arguments.&lt;/P&gt;&lt;P&gt;So in all i'm looking for a way to calculate the fraction of the payments and then make a ceiling at one, then once the ceiling is hit, the subsequent fractions must be zero (which could be done I suppose by just doing an IF-THEN)&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 06:50:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ceil-and-floor-calculations-at-1-1/m-p/450953#M113614</guid>
      <dc:creator>89974114</dc:creator>
      <dc:date>2018-04-04T06:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Ceil and floor calculations at [-1,1]</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ceil-and-floor-calculations-at-1-1/m-p/450961#M113618</link>
      <description>The ceil function rounds up that is it.&lt;BR /&gt;I would suggest to just use an if-statement.</description>
      <pubDate>Wed, 04 Apr 2018 07:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ceil-and-floor-calculations-at-1-1/m-p/450961#M113618</guid>
      <dc:creator>Criptic</dc:creator>
      <dc:date>2018-04-04T07:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Ceil and floor calculations at [-1,1]</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ceil-and-floor-calculations-at-1-1/m-p/451001#M113636</link>
      <description>&lt;P&gt;Switching from CEIL to MIN seems like it would do what you are asking.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 10:50:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ceil-and-floor-calculations-at-1-1/m-p/451001#M113636</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-04T10:50:26Z</dc:date>
    </item>
  </channel>
</rss>

