<?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 Macro in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514428#M2734</link>
    <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to insert the variable "&lt;SPAN&gt;Contribuição Nova (D)" with the follow&amp;nbsp;&lt;/SPAN&gt;calculation that is in colun "&lt;SPAN&gt;Fórmula para calcúlo de D'&lt;/SPAN&gt; in a macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Contribuição Junho&lt;BR /&gt;(A)&lt;/TD&gt;&lt;TD&gt;Probabilidade de Vida&lt;BR /&gt;(B)&lt;/TD&gt;&lt;TD&gt;Percentual Resgate&lt;BR /&gt;( C )&lt;/TD&gt;&lt;TD&gt;Contribuição Nova&lt;BR /&gt;(D)&lt;/TD&gt;&lt;TD&gt;Fórmula para calcúlo de D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;423.51&lt;/TD&gt;&lt;TD&gt;0.9816211&lt;/TD&gt;&lt;TD&gt;8.856%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 378.91&lt;/TD&gt;&lt;TD&gt;=A1*B1*(1-C1)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.9797101&lt;/TD&gt;&lt;TD&gt;6.544%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 346.93&lt;/TD&gt;&lt;TD&gt;=D1*B2*(1-C2)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.9773024&lt;/TD&gt;&lt;TD&gt;6.568%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 316.79&lt;/TD&gt;&lt;TD&gt;=D2*B3*(1-C3)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.9745881&lt;/TD&gt;&lt;TD&gt;6.590%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 288.39&lt;/TD&gt;&lt;TD&gt;=D3*B4*(1-C4)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.9719341&lt;/TD&gt;&lt;TD&gt;6.612%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 261.76&lt;/TD&gt;&lt;TD&gt;=D6*B7*(1-C7)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.9701071&lt;/TD&gt;&lt;TD&gt;6.612%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 237.15&lt;/TD&gt;&lt;TD&gt;=D7*B8*(1-C8)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached the excel file to better understand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that anybody could help me with this case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;</description>
    <pubDate>Mon, 19 Nov 2018 13:45:49 GMT</pubDate>
    <dc:creator>Fdomingos</dc:creator>
    <dc:date>2018-11-19T13:45:49Z</dc:date>
    <item>
      <title>Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514428#M2734</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to insert the variable "&lt;SPAN&gt;Contribuição Nova (D)" with the follow&amp;nbsp;&lt;/SPAN&gt;calculation that is in colun "&lt;SPAN&gt;Fórmula para calcúlo de D'&lt;/SPAN&gt; in a macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Contribuição Junho&lt;BR /&gt;(A)&lt;/TD&gt;&lt;TD&gt;Probabilidade de Vida&lt;BR /&gt;(B)&lt;/TD&gt;&lt;TD&gt;Percentual Resgate&lt;BR /&gt;( C )&lt;/TD&gt;&lt;TD&gt;Contribuição Nova&lt;BR /&gt;(D)&lt;/TD&gt;&lt;TD&gt;Fórmula para calcúlo de D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;423.51&lt;/TD&gt;&lt;TD&gt;0.9816211&lt;/TD&gt;&lt;TD&gt;8.856%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 378.91&lt;/TD&gt;&lt;TD&gt;=A1*B1*(1-C1)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.9797101&lt;/TD&gt;&lt;TD&gt;6.544%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 346.93&lt;/TD&gt;&lt;TD&gt;=D1*B2*(1-C2)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.9773024&lt;/TD&gt;&lt;TD&gt;6.568%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 316.79&lt;/TD&gt;&lt;TD&gt;=D2*B3*(1-C3)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.9745881&lt;/TD&gt;&lt;TD&gt;6.590%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 288.39&lt;/TD&gt;&lt;TD&gt;=D3*B4*(1-C4)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.9719341&lt;/TD&gt;&lt;TD&gt;6.612%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 261.76&lt;/TD&gt;&lt;TD&gt;=D6*B7*(1-C7)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.9701071&lt;/TD&gt;&lt;TD&gt;6.612%&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 237.15&lt;/TD&gt;&lt;TD&gt;=D7*B8*(1-C8)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached the excel file to better understand.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that anybody could help me with this case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 13:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514428#M2734</guid>
      <dc:creator>Fdomingos</dc:creator>
      <dc:date>2018-11-19T13:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514431#M2735</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if nmiss(a,b,c)=0 then newvar=a*b*(1-c);
else if a eq . and nmiss(b,c,lag(d))=0 then newvar=lag(d)*b*(1-c);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:45:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514431#M2735</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-11-19T14:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514432#M2736</link>
      <description>&lt;P&gt;Show us your SAS code so far. Show us the SAS LOG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not put data into .xlsx files, as many people will not download and open the files because Microsoft Office files can be a security risk. Instead, put (a portion of ) the data into actual SAS code so we can reproduce your data on our own computers.&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 13:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514432#M2736</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-11-19T13:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514436#M2737</link>
      <description>&lt;P&gt;If you need to carry over values from previous observations, look at the lag() function and retained variables.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514436#M2737</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-19T14:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514443#M2739</link>
      <description>&lt;P&gt;I've tried, but didn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Follow bellow the code that I was using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CONTRIB_NOVO_1 = CONTRIB_ant;&lt;BR /&gt;IF tempo = 1 THEN do;&lt;BR /&gt;CONTRIB_NOVOt = CONTRIB_NOVO_1 * npx * (1 - perc_resgate);&lt;BR /&gt;CONTRIB_NOVO_ant = CONTRIB_NOVOt;&lt;/P&gt;&lt;P&gt;retain CONTRIB_NOVOt CONTRIB_NOVO_ant;&lt;BR /&gt;else do;&lt;BR /&gt;CONTRIB_NOVOt = lag0(CONTRIB_NOVO_ant) * npx * (1 - perc_resgate);&lt;BR /&gt;CONTRIB_NOVO_ant = lag0(CONTRIB_NOVOt);&lt;BR /&gt;end;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514443#M2739</guid>
      <dc:creator>Fdomingos</dc:creator>
      <dc:date>2018-11-19T14:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514445#M2740</link>
      <description>&lt;P&gt;Follow bellow the code of the macro that I am using. It's too long because I&amp;nbsp;need to use many premises, the line that I need to work are in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;red.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro calcular ;&lt;/P&gt;&lt;P&gt;%do cont=1 %to 115;&lt;BR /&gt;%let M=&amp;amp;cont;&lt;BR /&gt;&lt;BR /&gt;data Proj&amp;amp;M. ; set base_ant ;&lt;BR /&gt;&lt;BR /&gt;anobase = year(&amp;amp;dtref)+&amp;amp;M. ;&lt;BR /&gt;dt_ref = INTNX('year',&amp;amp;dtref,&amp;amp;M.,'S');&lt;BR /&gt;tempo = &amp;amp;M. ;&lt;/P&gt;&lt;P&gt;*Alteração do cálculo da rentabilidade;&lt;BR /&gt;rent_fundo = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* idade no tempo = n do estudo ;&lt;BR /&gt;idade = idade_ref + &amp;amp;M. ;&lt;BR /&gt;&lt;BR /&gt;* idade +1 ;&lt;BR /&gt;t = idade + 1 ;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;*******************************************************************&lt;BR /&gt;Comutações - BR EMS Mortalidade Masculina&lt;BR /&gt;13/11/2012&lt;BR /&gt;*******************************************************************;&lt;/P&gt;&lt;P&gt;if idade = 0 then lx = 1000000 ;&lt;BR /&gt;if idade = 1 then lx = 999608.9 ;&lt;BR /&gt;if idade = 2 then lx = 999406.47919775 ;&lt;BR /&gt;if idade = 3 then lx = 999271.559323058 ;&lt;BR /&gt;if idade = 4 then lx = 999164.837120523 ;&lt;BR /&gt;if idade = 5 then lx = 999070.116293964 ;&lt;BR /&gt;if idade = 6 then lx = 998979.600541427 ;&lt;BR /&gt;if idade = 7 then lx = 998888.793295738 ;&lt;BR /&gt;if idade = 8 then lx = 998795.097526927 ;&lt;BR /&gt;if idade = 9 then lx = 998696.516450801 ;&lt;BR /&gt;if idade = 10 then lx = 998591.45357727 ;&lt;BR /&gt;if idade = 11 then lx = 998477.514292417 ;&lt;BR /&gt;if idade = 12 then lx = 998350.008713842 ;&lt;BR /&gt;if idade = 13 then lx = 998199.357697527 ;&lt;BR /&gt;if idade = 14 then lx = 998008.601800271 ;&lt;BR /&gt;if idade = 15 then lx = 997753.411000791 ;&lt;BR /&gt;if idade = 16 then lx = 997405.594161716 ;&lt;BR /&gt;if idade = 17 then lx = 996938.608862529 ;&lt;BR /&gt;if idade = 18 then lx = 996305.35345818 ;&lt;BR /&gt;if idade = 19 then lx = 995412.364969875 ;&lt;BR /&gt;if idade = 20 then lx = 994347.074656885 ;&lt;BR /&gt;if idade = 21 then lx = 993193.035442038 ;&lt;BR /&gt;if idade = 22 then lx = 992039.541050675 ;&lt;BR /&gt;if idade = 23 then lx = 990887.386327699 ;&lt;BR /&gt;if idade = 24 then lx = 989790.374902296 ;&lt;BR /&gt;if idade = 25 then lx = 988725.360458901 ;&lt;BR /&gt;if idade = 26 then lx = 987681.563095864 ;&lt;BR /&gt;if idade = 27 then lx = 986645.386368021 ;&lt;BR /&gt;if idade = 28 then lx = 985621.939108741 ;&lt;BR /&gt;if idade = 29 then lx = 984613.352178451 ;&lt;BR /&gt;if idade = 30 then lx = 983592.209670907 ;&lt;BR /&gt;if idade = 31 then lx = 982555.405122693 ;&lt;BR /&gt;if idade = 32 then lx = 981497.880740159 ;&lt;BR /&gt;if idade = 33 then lx = 980415.386727491 ;&lt;BR /&gt;if idade = 34 then lx = 979294.968023539 ;&lt;BR /&gt;if idade = 35 then lx = 978144.492295105 ;&lt;BR /&gt;if idade = 36 then lx = 976960.64401608 ;&lt;BR /&gt;if idade = 37 then lx = 975730.064388877 ;&lt;BR /&gt;if idade = 38 then lx = 974418.390463319 ;&lt;BR /&gt;if idade = 39 then lx = 973050.501926787 ;&lt;BR /&gt;if idade = 40 then lx = 971631.794294977 ;&lt;BR /&gt;if idade = 41 then lx = 970139.173532582 ;&lt;BR /&gt;if idade = 42 then lx = 968545.234870467 ;&lt;BR /&gt;if idade = 43 then lx = 966819.771534546 ;&lt;BR /&gt;if idade = 44 then lx = 964984.747608173 ;&lt;BR /&gt;if idade = 45 then lx = 963023.705604084 ;&lt;BR /&gt;if idade = 46 then lx = 960929.321649136 ;&lt;BR /&gt;if idade = 47 then lx = 958674.404902954 ;&lt;BR /&gt;if idade = 48 then lx = 956236.591758726 ;&lt;BR /&gt;if idade = 49 then lx = 953562.380506214 ;&lt;BR /&gt;if idade = 50 then lx = 950670.511874853 ;&lt;BR /&gt;if idade = 51 then lx = 947447.358571392 ;&lt;BR /&gt;if idade = 52 then lx = 943872.92392171 ;&lt;BR /&gt;if idade = 53 then lx = 939903.843889327 ;&lt;BR /&gt;if idade = 54 then lx = 935526.241736412 ;&lt;BR /&gt;if idade = 55 then lx = 930830.461318641 ;&lt;BR /&gt;if idade = 56 then lx = 925696.745158376 ;&lt;BR /&gt;if idade = 57 then lx = 920161.448901027 ;&lt;BR /&gt;if idade = 58 then lx = 914139.268266404 ;&lt;BR /&gt;if idade = 59 then lx = 907728.135336272 ;&lt;BR /&gt;if idade = 60 then lx = 900702.591887209 ;&lt;BR /&gt;if idade = 61 then lx = 893103.183978939 ;&lt;BR /&gt;if idade = 62 then lx = 884875.917448125 ;&lt;BR /&gt;if idade = 63 then lx = 876148.474761926 ;&lt;BR /&gt;if idade = 64 then lx = 866782.447566721 ;&lt;BR /&gt;if idade = 65 then lx = 856687.985860603 ;&lt;BR /&gt;if idade = 66 then lx = 845937.408326039 ;&lt;BR /&gt;if idade = 67 then lx = 834506.34072107 ;&lt;BR /&gt;if idade = 68 then lx = 822506.556794671 ;&lt;BR /&gt;if idade = 69 then lx = 809648.640794923 ;&lt;BR /&gt;if idade = 70 then lx = 796051.158626821 ;&lt;BR /&gt;if idade = 71 then lx = 781420.613987534 ;&lt;BR /&gt;if idade = 72 then lx = 765565.667871788 ;&lt;BR /&gt;if idade = 73 then lx = 748189.164568702 ;&lt;BR /&gt;if idade = 74 then lx = 729176.256337598 ;&lt;BR /&gt;if idade = 75 then lx = 708711.268444853 ;&lt;BR /&gt;if idade = 76 then lx = 687525.833368358 ;&lt;BR /&gt;if idade = 77 then lx = 665046.901236046 ;&lt;BR /&gt;if idade = 78 then lx = 641186.082494739 ;&lt;BR /&gt;if idade = 79 then lx = 615611.926764178 ;&lt;BR /&gt;if idade = 80 then lx = 589161.790963599 ;&lt;BR /&gt;if idade = 81 then lx = 560930.68976128 ;&lt;BR /&gt;if idade = 82 then lx = 531290.046345984 ;&lt;BR /&gt;if idade = 83 then lx = 500127.653709597 ;&lt;BR /&gt;if idade = 84 then lx = 468208.156505185 ;&lt;BR /&gt;if idade = 85 then lx = 435668.017373785 ;&lt;BR /&gt;if idade = 86 then lx = 401950.928873598 ;&lt;BR /&gt;if idade = 87 then lx = 367868.102786154 ;&lt;BR /&gt;if idade = 88 then lx = 333170.1947424 ;&lt;BR /&gt;if idade = 89 then lx = 299215.487515423 ;&lt;BR /&gt;if idade = 90 then lx = 265375.711954866 ;&lt;BR /&gt;if idade = 91 then lx = 233341.997464225 ;&lt;BR /&gt;if idade = 92 then lx = 203360.980917435 ;&lt;BR /&gt;if idade = 93 then lx = 175107.714461006 ;&lt;BR /&gt;if idade = 94 then lx = 148801.77281913 ;&lt;BR /&gt;if idade = 95 then lx = 124630.234280263 ;&lt;BR /&gt;if idade = 96 then lx = 102739.157963356 ;&lt;BR /&gt;if idade = 97 then lx = 83226.0021566182 ;&lt;BR /&gt;if idade = 98 then lx = 66133.7948677114 ;&lt;BR /&gt;if idade = 99 then lx = 51447.5688555105 ;&lt;BR /&gt;if idade = 100 then lx = 39093.8088449481 ;&lt;BR /&gt;if idade = 101 then lx = 28943.2499348309 ;&lt;BR /&gt;if idade = 102 then lx = 20817.2501731526 ;&lt;BR /&gt;if idade = 103 then lx = 14497.4910772864 ;&lt;BR /&gt;if idade = 104 then lx = 9738.47071905189 ;&lt;BR /&gt;if idade = 105 then lx = 6281.75866190033 ;&lt;BR /&gt;if idade = 106 then lx = 3870.73614007278 ;&lt;BR /&gt;if idade = 107 then lx = 2264.30825917676 ;&lt;BR /&gt;if idade = 108 then lx = 1248.17479404951 ;&lt;BR /&gt;if idade = 109 then lx = 642.501719761367 ;&lt;BR /&gt;if idade = 110 then lx = 305.381517153782 ;&lt;BR /&gt;if idade = 111 then lx = 132.120503886626 ;&lt;BR /&gt;if idade = 112 then lx = 51.0662262584795 ;&lt;BR /&gt;if idade = 113 then lx = 17.1906177970517 ;&lt;BR /&gt;if idade = &amp;gt; 114 then lx = 0 ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if t = 0 then lx_1 = 1000000 ;&lt;BR /&gt;if t = 1 then lx_1 = 999608.9 ;&lt;BR /&gt;if t = 2 then lx_1 = 999406.47919775 ;&lt;BR /&gt;if t = 3 then lx_1 = 999271.559323058 ;&lt;BR /&gt;if t = 4 then lx_1 = 999164.837120523 ;&lt;BR /&gt;if t = 5 then lx_1 = 999070.116293964 ;&lt;BR /&gt;if t = 6 then lx_1 = 998979.600541427 ;&lt;BR /&gt;if t = 7 then lx_1 = 998888.793295738 ;&lt;BR /&gt;if t = 8 then lx_1 = 998795.097526927 ;&lt;BR /&gt;if t = 9 then lx_1 = 998696.516450801 ;&lt;BR /&gt;if t = 10 then lx_1 = 998591.45357727 ;&lt;BR /&gt;if t = 11 then lx_1 = 998477.514292417 ;&lt;BR /&gt;if t = 12 then lx_1 = 998350.008713842 ;&lt;BR /&gt;if t = 13 then lx_1 = 998199.357697527 ;&lt;BR /&gt;if t = 14 then lx_1 = 998008.601800271 ;&lt;BR /&gt;if t = 15 then lx_1 = 997753.411000791 ;&lt;BR /&gt;if t = 16 then lx_1 = 997405.594161716 ;&lt;BR /&gt;if t = 17 then lx_1 = 996938.608862529 ;&lt;BR /&gt;if t = 18 then lx_1 = 996305.35345818 ;&lt;BR /&gt;if t = 19 then lx_1 = 995412.364969875 ;&lt;BR /&gt;if t = 20 then lx_1 = 994347.074656885 ;&lt;BR /&gt;if t = 21 then lx_1 = 993193.035442038 ;&lt;BR /&gt;if t = 22 then lx_1 = 992039.541050675 ;&lt;BR /&gt;if t = 23 then lx_1 = 990887.386327699 ;&lt;BR /&gt;if t = 24 then lx_1 = 989790.374902296 ;&lt;BR /&gt;if t = 25 then lx_1 = 988725.360458901 ;&lt;BR /&gt;if t = 26 then lx_1 = 987681.563095864 ;&lt;BR /&gt;if t = 27 then lx_1 = 986645.386368021 ;&lt;BR /&gt;if t = 28 then lx_1 = 985621.939108741 ;&lt;BR /&gt;if t = 29 then lx_1 = 984613.352178451 ;&lt;BR /&gt;if t = 30 then lx_1 = 983592.209670907 ;&lt;BR /&gt;if t = 31 then lx_1 = 982555.405122693 ;&lt;BR /&gt;if t = 32 then lx_1 = 981497.880740159 ;&lt;BR /&gt;if t = 33 then lx_1 = 980415.386727491 ;&lt;BR /&gt;if t = 34 then lx_1 = 979294.968023539 ;&lt;BR /&gt;if t = 35 then lx_1 = 978144.492295105 ;&lt;BR /&gt;if t = 36 then lx_1 = 976960.64401608 ;&lt;BR /&gt;if t = 37 then lx_1 = 975730.064388877 ;&lt;BR /&gt;if t = 38 then lx_1 = 974418.390463319 ;&lt;BR /&gt;if t = 39 then lx_1 = 973050.501926787 ;&lt;BR /&gt;if t = 40 then lx_1 = 971631.794294977 ;&lt;BR /&gt;if t = 41 then lx_1 = 970139.173532582 ;&lt;BR /&gt;if t = 42 then lx_1 = 968545.234870467 ;&lt;BR /&gt;if t = 43 then lx_1 = 966819.771534546 ;&lt;BR /&gt;if t = 44 then lx_1 = 964984.747608173 ;&lt;BR /&gt;if t = 45 then lx_1 = 963023.705604084 ;&lt;BR /&gt;if t = 46 then lx_1 = 960929.321649136 ;&lt;BR /&gt;if t = 47 then lx_1 = 958674.404902954 ;&lt;BR /&gt;if t = 48 then lx_1 = 956236.591758726 ;&lt;BR /&gt;if t = 49 then lx_1 = 953562.380506214 ;&lt;BR /&gt;if t = 50 then lx_1 = 950670.511874853 ;&lt;BR /&gt;if t = 51 then lx_1 = 947447.358571392 ;&lt;BR /&gt;if t = 52 then lx_1 = 943872.92392171 ;&lt;BR /&gt;if t = 53 then lx_1 = 939903.843889327 ;&lt;BR /&gt;if t = 54 then lx_1 = 935526.241736412 ;&lt;BR /&gt;if t = 55 then lx_1 = 930830.461318641 ;&lt;BR /&gt;if t = 56 then lx_1 = 925696.745158376 ;&lt;BR /&gt;if t = 57 then lx_1 = 920161.448901027 ;&lt;BR /&gt;if t = 58 then lx_1 = 914139.268266404 ;&lt;BR /&gt;if t = 59 then lx_1 = 907728.135336272 ;&lt;BR /&gt;if t = 60 then lx_1 = 900702.591887209 ;&lt;BR /&gt;if t = 61 then lx_1 = 893103.183978939 ;&lt;BR /&gt;if t = 62 then lx_1 = 884875.917448125 ;&lt;BR /&gt;if t = 63 then lx_1 = 876148.474761926 ;&lt;BR /&gt;if t = 64 then lx_1 = 866782.447566721 ;&lt;BR /&gt;if t = 65 then lx_1 = 856687.985860603 ;&lt;BR /&gt;if t = 66 then lx_1 = 845937.408326039 ;&lt;BR /&gt;if t = 67 then lx_1 = 834506.34072107 ;&lt;BR /&gt;if t = 68 then lx_1 = 822506.556794671 ;&lt;BR /&gt;if t = 69 then lx_1 = 809648.640794923 ;&lt;BR /&gt;if t = 70 then lx_1 = 796051.158626821 ;&lt;BR /&gt;if t = 71 then lx_1 = 781420.613987534 ;&lt;BR /&gt;if t = 72 then lx_1 = 765565.667871788 ;&lt;BR /&gt;if t = 73 then lx_1 = 748189.164568702 ;&lt;BR /&gt;if t = 74 then lx_1 = 729176.256337598 ;&lt;BR /&gt;if t = 75 then lx_1 = 708711.268444853 ;&lt;BR /&gt;if t = 76 then lx_1 = 687525.833368358 ;&lt;BR /&gt;if t = 77 then lx_1 = 665046.901236046 ;&lt;BR /&gt;if t = 78 then lx_1 = 641186.082494739 ;&lt;BR /&gt;if t = 79 then lx_1 = 615611.926764178 ;&lt;BR /&gt;if t = 80 then lx_1 = 589161.790963599 ;&lt;BR /&gt;if t = 81 then lx_1 = 560930.68976128 ;&lt;BR /&gt;if t = 82 then lx_1 = 531290.046345984 ;&lt;BR /&gt;if t = 83 then lx_1 = 500127.653709597 ;&lt;BR /&gt;if t = 84 then lx_1 = 468208.156505185 ;&lt;BR /&gt;if t = 85 then lx_1 = 435668.017373785 ;&lt;BR /&gt;if t = 86 then lx_1 = 401950.928873598 ;&lt;BR /&gt;if t = 87 then lx_1 = 367868.102786154 ;&lt;BR /&gt;if t = 88 then lx_1 = 333170.1947424 ;&lt;BR /&gt;if t = 89 then lx_1 = 299215.487515423 ;&lt;BR /&gt;if t = 90 then lx_1 = 265375.711954866 ;&lt;BR /&gt;if t = 91 then lx_1 = 233341.997464225 ;&lt;BR /&gt;if t = 92 then lx_1 = 203360.980917435 ;&lt;BR /&gt;if t = 93 then lx_1 = 175107.714461006 ;&lt;BR /&gt;if t = 94 then lx_1 = 148801.77281913 ;&lt;BR /&gt;if t = 95 then lx_1 = 124630.234280263 ;&lt;BR /&gt;if t = 96 then lx_1 = 102739.157963356 ;&lt;BR /&gt;if t = 97 then lx_1 = 83226.0021566182 ;&lt;BR /&gt;if t = 98 then lx_1 = 66133.7948677114 ;&lt;BR /&gt;if t = 99 then lx_1 = 51447.5688555105 ;&lt;BR /&gt;if t = 100 then lx_1 = 39093.8088449481 ;&lt;BR /&gt;if t = 101 then lx_1 = 28943.2499348309 ;&lt;BR /&gt;if t = 102 then lx_1 = 20817.2501731526 ;&lt;BR /&gt;if t = 103 then lx_1 = 14497.4910772864 ;&lt;BR /&gt;if t = 104 then lx_1 = 9738.47071905189 ;&lt;BR /&gt;if t = 105 then lx_1 = 6281.75866190033 ;&lt;BR /&gt;if t = 106 then lx_1 = 3870.73614007278 ;&lt;BR /&gt;if t = 107 then lx_1 = 2264.30825917676 ;&lt;BR /&gt;if t = 108 then lx_1 = 1248.17479404951 ;&lt;BR /&gt;if t = 109 then lx_1 = 642.501719761367 ;&lt;BR /&gt;if t = 110 then lx_1 = 305.381517153782 ;&lt;BR /&gt;if t = 111 then lx_1 = 132.120503886626 ;&lt;BR /&gt;if t = 112 then lx_1 = 51.0662262584795 ;&lt;BR /&gt;if t = 113 then lx_1 = 17.1906177970517 ;&lt;BR /&gt;if t = &amp;gt; 114 then lx_1 = 0 ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;prazo_t = prazo1 + tempo;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;************************************************************************;&lt;/P&gt;&lt;P&gt;if TIPO_PRODUTO = 'PGBL' then do;&lt;BR /&gt;if prazo_t &amp;lt;= 1 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0190155283;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0712847902;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0676946333;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0685077466;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0684828745;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0605011893;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0628739629;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0644062518;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0572125491;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0567482963;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0593693587;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 2 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0460049079;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0856837306;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0797938553;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0804787947;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0754482982;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0698438073;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0784374257;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.067361419;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0774361868;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0849656128;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0608775787;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 3 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0372711226;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0904364281;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0920603479;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0850675014;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0704669127;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0805600986;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0750272188;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0664717179;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0641014168;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0767582865;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0643910512;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 4 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0327808219;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0900201904;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0900201904;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.088773671;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0817146249;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0670171706;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0833618708;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0804862357;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0741136246;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0518327786;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0570641306;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 5 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0672953628;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0970985396;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0860174401;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0841035802;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0868799671;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0859142963;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0735356775;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.079856301;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0757732464;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0689182499;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0445960911;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 6 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0576379899;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0919044314;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0885659499;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0849234377;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0956214406;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0929210888;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0779617045;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0927592976;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0834530924;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0488719974;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0551297661;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 7 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0341913498;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0857518227;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0886992814;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0856719978;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0855958007;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0876981057;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0782913482;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0783934262;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0942104545;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0865300595;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0639427067;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 8 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0500681581;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0750561982;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0880945747;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0856628678;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0880153972;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0794757717;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0785740411;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0812560554;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0836129204;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0963263615;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0730847819;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 9 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0588733339;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.081869508;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0883179912;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0855431311;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0899047446;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0797824851;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0779276537;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0825928944;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.084291643;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0966286909;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0668822653;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 10 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0582962182;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0828883705;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0883058827;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0856719879;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0890213041;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.080722418;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0776002657;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0835986081;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0829590482;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0953322729;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0687979492;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 11 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0563;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0862;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0862;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0833;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0892;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0761;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0767;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0771;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0789;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.08745327;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0645926335;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 12 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0548;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.082;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.082;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0799;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.087;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0699;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0742;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0731;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0753;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0885583145;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0648971733;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 13 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0525;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0768;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0768;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0757;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.084;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0623;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0711;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0681;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0707;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0885583145;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0651773228;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 14 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0525;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0706;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0706;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0707;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0802;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0623;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0674;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0681;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0651;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0885583145;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0654367007;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 15 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0525;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0634;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0634;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0649;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0756;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0623;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0631;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0681;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0585;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0885583145;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0656781757;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 16 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0525;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0552;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0552;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0583;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0702;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0623;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0631;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0681;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0585;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0885583145;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0659040605;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t =&amp;gt;17 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0525;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.046;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.046;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0509;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.064;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0623;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0631;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0681;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0585;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0885583145;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0661162467;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if TIPO_PRODUTO = 'VGBL' then do;&lt;BR /&gt;if prazo_t &amp;lt;= 1 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0964044485;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.1136656619;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.113581467;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.1116534183;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.111088891;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.1085795857;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.1073957312;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.1061556817;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0926342869;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0862330475;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0810662821;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if prazo_t = 2 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.1116656086;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.1203548812;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.1203548812;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.1196743779;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.1181813854;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.1169540945;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.1121172922;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.109371471;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.1000036454;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0938845863;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0956293341;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 3 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0962238168;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.1153373576;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.1153373576;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.1153373576;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.1126951329;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.1148956033;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.1143092873;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0969757675;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0952214687;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.1033877971;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0899598358;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 4 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0933836693;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.1308167179;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.1323200766;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.1276333596;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.1269720606;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.1276010317;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.1257958834;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.1225347406;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.1172562986;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.1240413407;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0968892547;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 5 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.1019291932;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.1228947511;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.1232482019;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.1203404301;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.123015238;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.1127065459;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.1149985911;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.1081059344;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0993748847;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.1056344693;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0992798909;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 6 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0847233143;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.1130459001;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.1196099112;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.1196099112;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.1178504226;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.1162078679;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.114773282;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.1124871876;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0977603363;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0910580546;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.094442619;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 7 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0673829576;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.1076980801;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.1137059079;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.1135685188;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.1099915037;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.1136253324;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.1034984188;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.102109848;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0936842761;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0946490111;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0936000601;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 8 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0735727618;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.1022165152;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.1052575574;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.1036631365;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0994831336;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.1052575574;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0983803611;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.1029668338;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0879881828;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0893549456;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0789667751;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 9 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0738141513;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0976223472;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.1028402816;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.1025550291;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0988026969;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0979339325;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0986498182;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.087400427;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0815342811;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.081914309;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.064;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 10 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.077986794;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0967429545;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.1009618855;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.1020911857;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0976777582;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.1002601588;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0924751781;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0824;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0759714746;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0736758055;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0451;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 11 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0745336756;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0990315709;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0758;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0919;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0787;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0859;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0739;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.0711;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0582;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0526;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0451;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 12 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0731414936;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0977264003;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0643;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0817;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0665;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0756;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0615;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.058;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0582;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0342;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0451;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 13 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0718608103;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0965257596;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0643;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0701;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0527;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0639;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0475;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.058;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0582;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0342;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0451;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t = 14 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0706750827;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.0954141401;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0643;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0701;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0527;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0639;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0475;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.058;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0582;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0342;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0451;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if prazo_t =&amp;gt; 15 then do;&lt;BR /&gt;if 0 &amp;lt;= idade &amp;lt;= 20 then perc_resgate = 0.0695711968;&lt;BR /&gt;if 21 &amp;lt;= idade &amp;lt;= 30 then perc_resgate = 0.094379247;&lt;BR /&gt;if 31 &amp;lt;= idade &amp;lt;= 35 then perc_resgate = 0.0643;&lt;BR /&gt;if 36 &amp;lt;= idade &amp;lt;= 40 then perc_resgate = 0.0701;&lt;BR /&gt;if 41 &amp;lt;= idade &amp;lt;= 45 then perc_resgate = 0.0527;&lt;BR /&gt;if 46 &amp;lt;= idade &amp;lt;= 50 then perc_resgate = 0.0639;&lt;BR /&gt;if 51 &amp;lt;= idade &amp;lt;= 55 then perc_resgate = 0.0475;&lt;BR /&gt;if 56 &amp;lt;= idade &amp;lt;= 60 then perc_resgate = 0.058;&lt;BR /&gt;if 61 &amp;lt;= idade &amp;lt;= 65 then perc_resgate = 0.0582;&lt;BR /&gt;if 66 &amp;lt;= idade &amp;lt;= 70 then perc_resgate = 0.0342;&lt;BR /&gt;if idade =&amp;gt; 71 then perc_resgate =0.0451;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;*****************************************************************;&lt;BR /&gt;if TIPO_PRODUTO = 'PGBL' then do ;&lt;BR /&gt;if idade &amp;lt; 45 then conversao_benef = 0 ;&lt;BR /&gt;if 45 &amp;lt;= idade &amp;lt;=49 then conversao_benef = 0.0002248949 ;&lt;BR /&gt;if 50 &amp;lt;= idade &amp;lt;=54 then conversao_benef = 0.0016358182 ;&lt;BR /&gt;if 55 &amp;lt;= idade &amp;lt;=59 then conversao_benef = 0.001590492143609;&lt;BR /&gt;if 60 &amp;lt;= idade &amp;lt;=64 then conversao_benef = 0.00642865683454636 ;&lt;BR /&gt;if 65 &amp;lt;= idade &amp;lt;=70 then conversao_benef = 0.00311600788055233 ;&lt;BR /&gt;if idade &amp;gt; 70 then conversao_benef = 0 ;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;if TIPO_PRODUTO = 'VGBL' then do ;&lt;BR /&gt;if idade &amp;lt; 45 then conversao_benef = 0 ;&lt;BR /&gt;if 45 &amp;lt;= idade &amp;lt;=49 then conversao_benef = 0.0000063079 ;&lt;BR /&gt;if 50 &amp;lt;= idade &amp;lt;=54 then conversao_benef = 0.0000063079 ;&lt;BR /&gt;if 55 &amp;lt;= idade &amp;lt;=59 then conversao_benef = 0.0000474506 ;&lt;BR /&gt;if 60 &amp;lt;= idade &amp;lt;=64 then conversao_benef = 0.000201594312207188 ;&lt;BR /&gt;if 65 &amp;lt;= idade &amp;lt;=70 then conversao_benef = 0.00008890812 ;&lt;BR /&gt;if idade &amp;gt; 70 then conversao_benef = 0 ;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;npx= lx_1 / lx ;&lt;/P&gt;&lt;P&gt;if idade &amp;gt; 115 then npx = 0 ;&lt;BR /&gt;if lx_1 = . then npx = 0 ;&lt;/P&gt;&lt;P&gt;perc_aporte = 0.007495029;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* 1) Atualiza contribuição para novo exercicio&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;CONTRIB_NOVO=CONTRIB_ant* npx * (1 - perc_resgate);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;* 2) Abertura das Demais Variaveis ;&lt;BR /&gt;* se converteu em aposentadoria não aporta mais;&lt;BR /&gt;*if marca = 1 then perc_aporte = 0 ;&lt;BR /&gt;Aporte = SALDO_PROV_ant*npx*perc_aporte;&lt;BR /&gt;Resgate = (SALDO_PROV_ant*npx*perc_resgate);&lt;BR /&gt;Resgate_Morte = SALDO_PROV_ant*(1-npx) ;&lt;BR /&gt;Contrib = CONTRIB_NOVO ;&lt;BR /&gt;&lt;BR /&gt;if aporte &amp;lt; 0 then aporte = 0 ;&lt;BR /&gt;if resgate &amp;lt; 0 then resgate = 0 ;&lt;BR /&gt;if Contrib &amp;lt; 0 then Contrib = 0 ;&lt;BR /&gt;if resgate_Morte &amp;lt; 0 then resgate_morte = 0 ;&lt;BR /&gt;&lt;BR /&gt;if aporte = . then aporte = 0 ;&lt;BR /&gt;if resgate = . then resgate = 0 ;&lt;BR /&gt;if Resgate_Morte = . then Resgate_Morte = 0 ;&lt;BR /&gt;if contrib = . then contrib = 0 ;&lt;/P&gt;&lt;P&gt;total_entradas = (aporte + contrib) ;&lt;BR /&gt;/*if total_entradas not eq 0 then do ;&lt;BR /&gt;vl_carregamento = total_entradas * carregamento ; */&lt;BR /&gt;/*end; else vl_carregamento = 0 ;*/&lt;/P&gt;&lt;P&gt;* Devemos utilizar a Rentabilidade Nominal e deduzir a TAF para chegar no Saldo PMBaC no final de t;&lt;BR /&gt;rent_taf = ((1+rent_fundo)/(1+taf_aa))-1;&lt;BR /&gt;&lt;BR /&gt;* Qtdade do tempo ;&lt;BR /&gt;qtde = qtde_ant* npx * (1 - perc_resgate);&lt;/P&gt;&lt;P&gt;* PGBL / VGBL ;&lt;BR /&gt;if TIPO_PRODUTO in ('PGBL' 'VGBL') then&lt;BR /&gt;SALDO_PROV_novo0 = SALDO_PROV_ant*npx*(1+rent_fundo)+(SALDO_PROV_ant*npx*perc_aporte)*((1+rent_fundo))-(SALDO_PROV_ant*npx*perc_resgate)*((1+ rent_fundo)) + CONTRIB_NOVO*(( 1+ rent_fundo));&lt;BR /&gt;&lt;BR /&gt;* Variavel Saldo Concessão em Benefício&lt;BR /&gt;Condições: a) só entra em beneficio 1 vez, b) ao entrar em beneficio não contribui mais apenas resgata ou morre;&lt;BR /&gt;Entrada_benef = 0;&lt;BR /&gt;if conversao_benef not eq 0 then do ;&lt;BR /&gt;Entrada_benef = SALDO_PROV_novo0 * conversao_benef ;&lt;BR /&gt;qtde_benef = qtde * conversao_benef ;&lt;BR /&gt;marca = 1 ;&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if TIPO_PRODUTO in ('PGBL' 'VGBL') then SALDO_PROV_novo = SALDO_PROV_novo0 - Entrada_benef ;&lt;BR /&gt;&lt;BR /&gt;if SALDO_PROV_novo = . then SALDO_PROV_novo = 0 ;&lt;/P&gt;&lt;P&gt;* RENTABILIDADE PGBL / VGBL ;&lt;BR /&gt;if TIPO_PRODUTO in ('PGBL' 'VGBL') THEN DO ;&lt;BR /&gt;Rentabilidade = SALDO_PROV_novo - SALDO_PROV_ant - aporte + resgate + resgate_morte - contrib_novo + Entrada_benef;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;*Zera movimento negativos;&lt;BR /&gt;if rentabilidade &amp;lt; 0 then rentabilidade = 0 ;&lt;BR /&gt;if Entrada_benef &amp;lt; 0 then Entrada_benef = 0 ;&lt;BR /&gt;&lt;BR /&gt;if Rentabilidade = . then Rentabilidade = 0 ;&lt;BR /&gt;if Entrada_benef = . then Entrada_benef = 0 ;&lt;BR /&gt;&lt;BR /&gt;if Contrib = . then Contrib = 0 ;&lt;/P&gt;&lt;P&gt;* Calculo TAF que Retorna para a Seguradora líquido de impostos;&lt;BR /&gt;TAF_Banco = (mean(SALDO_PROV_ant)*&amp;amp;DA );&lt;BR /&gt;Taf_seguradora = taf_banco * 0.12 ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;* &amp;gt;&amp;gt;&amp;gt;&amp;gt; Resultado por plano &amp;lt;&amp;lt;&amp;lt;&amp;lt; ;&lt;BR /&gt;proc means data=Proj&amp;amp;M. nway noprint;&lt;BR /&gt;class anobase TIPO_PRODUTO TABUA_ATUARIAL juros EXCEDENTE_FINANCEIRO Indice;&lt;BR /&gt;var SALDO_PROV_ant Contrib Aporte Resgate Resgate_Morte Entrada_benef Rentabilidade&lt;BR /&gt;SALDO_PROV_novo TAF_Banco Taf_seguradora qtde qtde_benef;&lt;BR /&gt;format SALDO_PROV_ant Contrib Aporte Resgate Resgate_Morte Entrada_benef&lt;BR /&gt;Rentabilidade SALDO_PROV_novo TAF_Banco Taf_seguradora qtde qtde_benef commax15.2;&lt;BR /&gt;output out=tot&amp;amp;M. sum= ;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc append base = Total_Fluxo_acum DATA=tot&amp;amp;M. force ; run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;* Cria base de Entradas em Beneficio ;&lt;BR /&gt;Data proj_benef&amp;amp;M.;&lt;BR /&gt;set Proj&amp;amp;M. ;&lt;BR /&gt;&lt;BR /&gt;if idade =&amp;gt; 115 then delete ;&lt;BR /&gt;if marca = 1 ;&lt;BR /&gt;anobase = &amp;amp;M. ;&lt;BR /&gt;if entrada_benef not eq 0 ;&lt;BR /&gt;format Entrada_benef qtde_benef commax15.8 ;&lt;BR /&gt;keep anobase TIPO_PRODUTO Processo_SUSEP PLANOS_NOMES&lt;BR /&gt;TABUA_ATUARIAL juros EXCEDENTE_FINANCEIRO idade Entrada_benef Indice qtde_benef;&lt;BR /&gt;&lt;BR /&gt;proc append base = Total_Fluxo_Benef DATA=Proj&amp;amp;M.; run;&lt;/P&gt;&lt;P&gt;%end;&lt;BR /&gt;%mend calcular;&lt;BR /&gt;%calcular;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:17:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514445#M2740</guid>
      <dc:creator>Fdomingos</dc:creator>
      <dc:date>2018-11-19T14:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Macro</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514449#M2741</link>
      <description>&lt;P&gt;lag0() will return the &lt;EM&gt;current&lt;/EM&gt; value. To look back into the previous observation, use lag().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And do not use any of the lag() functions in a conditional branch. Make sure that lag() functions are called once per every data step iteration, or they won't fill their queue correctly.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Nov 2018 14:28:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macro/m-p/514449#M2741</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-19T14:28:12Z</dc:date>
    </item>
  </channel>
</rss>

