<?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: How to write the code for this logic in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-for-this-logic/m-p/316951#M69334</link>
    <description>can you please write down the sample code</description>
    <pubDate>Tue, 06 Dec 2016 07:33:36 GMT</pubDate>
    <dc:creator>SBRVamsi</dc:creator>
    <dc:date>2016-12-06T07:33:36Z</dc:date>
    <item>
      <title>How to write the code for this logic</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-for-this-logic/m-p/316932#M69322</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data looks like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID &amp;nbsp; &amp;nbsp; &amp;nbsp;'28-Feb-14'n &amp;nbsp;...'28-Feb-16'n &amp;nbsp;Policy_Start&lt;/P&gt;&lt;P&gt;101 &amp;nbsp; &amp;nbsp; 90.20 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ..... &amp;nbsp;30.89 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 21JAN2014&lt;/P&gt;&lt;P&gt;102 &amp;nbsp; &amp;nbsp; 76.90 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;....... 45.67 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13MAR2015&lt;/P&gt;&lt;P&gt;103 &amp;nbsp; &amp;nbsp; 66.66 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...... 67.45 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20JUN2015&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need to add up all the columns which are less than this formula&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;New_Column=(sum(all_columns_which are less than policy_start+365&amp;nbsp;)&amp;lt;(policy_start+365))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;please kindly note all the columns names are with date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So how i refer only those columns to sum up .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please revert asap.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Vamsi.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2016 05:22:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-for-this-logic/m-p/316932#M69322</guid>
      <dc:creator>SBRVamsi</dc:creator>
      <dc:date>2016-12-06T05:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the code for this logic</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-for-this-logic/m-p/316937#M69326</link>
      <description>&lt;P&gt;Question:&amp;nbsp; what about leap years?&amp;nbsp; Do you really want policy_start+365, or do you want INTNX('year',policy_start,1,'s')?&amp;nbsp; (look it up).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pseudo-code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&amp;nbsp; Make a DATA step,&amp;nbsp;using&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;array values {*} '28-feb-14'n -- '28-feb-16'n;&lt;/LI&gt;
&lt;/UL&gt;
&lt;LI&gt;Loop over the values array:&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Get the name of the variable (see VNAME function).&amp;nbsp; This yields a character value like "28-feb-14".&lt;/LI&gt;
&lt;LI&gt;Convert that character value&amp;nbsp;to a sas date value (see the INPUT function)&lt;/LI&gt;
&lt;LI&gt;if the value&amp;nbsp;is less than the target date, add the corresponing element of values to sum&lt;/LI&gt;
&lt;/UL&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2016 06:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-for-this-logic/m-p/316937#M69326</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2016-12-06T06:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the code for this logic</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-for-this-logic/m-p/316950#M69333</link>
      <description>&lt;P&gt;Transpose your data to a long format makes this much easier.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dates shouldn't be variable names - you're storing information in your variable names.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is fine for reporting but not great for data analysis.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's harder to develop dynamic processes around variable names that constantly change and the number of variables will also change. And when adding data you have to add new columns instead of rows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you change your data to a long format for analysis and then transpose for reporting?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2016 07:15:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-for-this-logic/m-p/316950#M69333</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-06T07:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to write the code for this logic</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-for-this-logic/m-p/316951#M69334</link>
      <description>can you please write down the sample code</description>
      <pubDate>Tue, 06 Dec 2016 07:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-the-code-for-this-logic/m-p/316951#M69334</guid>
      <dc:creator>SBRVamsi</dc:creator>
      <dc:date>2016-12-06T07:33:36Z</dc:date>
    </item>
  </channel>
</rss>

