<?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: please - help with sas code in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/please-help-with-sas-code/m-p/230049#M54447</link>
    <description>Sorry, i meant say 180 WANT_mmdd. That is equal to 6 daily generated WANT file.&lt;BR /&gt;&lt;BR /&gt;Yes. I need to know for this period (6 months) how many times the client has already had in revolving, so i really need to consolidate all the WANT% and then set revolving.&lt;BR /&gt;But please consider the WANT% are large tables, i must use the best performance to this issue.</description>
    <pubDate>Thu, 15 Oct 2015 11:01:06 GMT</pubDate>
    <dc:creator>Augusto</dc:creator>
    <dc:date>2015-10-15T11:01:06Z</dc:date>
    <item>
      <title>please - help with sas code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/please-help-with-sas-code/m-p/230008#M54444</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a table (HAVE) that needs to be joinned with others 180 (WANT_YYMMDD) sas data sets. The WANT_YYMMDD is generated daily, so i need to join with the last 6 months WANTs data sets and then to make a sum of the following results:&lt;/P&gt;
&lt;P&gt;if total_pay / total_bill - 1 le 0.99 then revolving = 1; else revolving = 0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The idea is to count how many times the client has already had in revolving in the last six months.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i imagine to do it in a loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;small example.&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;merge&lt;/P&gt;
&lt;P&gt;&amp;nbsp; have (in = _a)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; want_yymmdd (in = b);&lt;/P&gt;
&lt;P&gt;by id;&lt;/P&gt;
&lt;P&gt;if total_pay / total_bill - 1 le 0.99 then revolving = 1; else revolving = 0;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;--&amp;nbsp;&lt;SPAN class=""&gt;&lt;SPAN class="hps"&gt;this&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;small example&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;is missing&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the sum of the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;variable&lt;/SPAN&gt; &lt;/SPAN&gt;revolving&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Observation: Its likely that there is one or more month with 27 or less WANT_YYMMDD data set&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks alot&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 11:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/please-help-with-sas-code/m-p/230008#M54444</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2015-10-15T11:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: please - help with sas code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/please-help-with-sas-code/m-p/230013#M54445</link>
      <description>&lt;P&gt;Not sure if I got your issue:&lt;/P&gt;
&lt;P&gt;You want to join with 240 WANT_mmdd datasets OR you want to merge last 6 months daily generated WANT files?&lt;/P&gt;
&lt;P&gt;columns in HAVE and WANT%?&lt;/P&gt;
&lt;P&gt;Do you want to consolidate all the total_pay and total_bill from all the WANT% datasets and then set 'revolving' based on that?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 05:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/please-help-with-sas-code/m-p/230013#M54445</guid>
      <dc:creator>DCL</dc:creator>
      <dc:date>2015-10-15T05:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: please - help with sas code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/please-help-with-sas-code/m-p/230049#M54447</link>
      <description>Sorry, i meant say 180 WANT_mmdd. That is equal to 6 daily generated WANT file.&lt;BR /&gt;&lt;BR /&gt;Yes. I need to know for this period (6 months) how many times the client has already had in revolving, so i really need to consolidate all the WANT% and then set revolving.&lt;BR /&gt;But please consider the WANT% are large tables, i must use the best performance to this issue.</description>
      <pubDate>Thu, 15 Oct 2015 11:01:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/please-help-with-sas-code/m-p/230049#M54447</guid>
      <dc:creator>Augusto</dc:creator>
      <dc:date>2015-10-15T11:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: please - help with sas code</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/please-help-with-sas-code/m-p/230302#M54476</link>
      <description>&lt;P&gt;I am still not sure on the structure of Have and want datasets. Assuming that Have will have the client_name and want_mmdd contains client_name, bill and pay value, here is a dataset to consolidate the pay and bill values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let cur_month=%sysfunc(month(%sysfunc(today())));&lt;BR /&gt; data result;&lt;/P&gt;
&lt;P&gt;retain pay_idx 1 bill_idx 2 ;&lt;BR /&gt; array agg[3,2] 8 _temporary_; /* As an example i took 3 clients.*/&lt;BR /&gt; if _n_=1 then do;&lt;BR /&gt; dcl hash clients();&lt;BR /&gt; clients.defineKey('client_name');&lt;BR /&gt; clients.defineData('client_idx');&lt;BR /&gt; clients.defineDone();&lt;BR /&gt; do until(clientsEof);&lt;BR /&gt; set have end=clientsEof;&lt;BR /&gt; client_idx+1;&lt;BR /&gt; clients.add();&lt;BR /&gt; end;&lt;BR /&gt; end;&lt;BR /&gt; &lt;BR /&gt; %do month=%sysevalf(&amp;amp;cur_month.-6) %to &amp;amp;cur_month.;&lt;BR /&gt; %do date=1 %to 31;&lt;BR /&gt; %if %sysfunc(exist(work.want_%sysfunc(putn(&amp;amp;month.,z2.))%sysfunc(putn(&amp;amp;date.,z2.)))) %then %do;&lt;BR /&gt; do until (eof);&lt;BR /&gt; set want_%sysfunc(putn(&amp;amp;month.,z2.))%sysfunc(putn(&amp;amp;date.,z2.)) end=eof;&lt;BR /&gt; clients.find();&lt;BR /&gt; agg[client_idx,pay_idx]=sum(agg[client_idx,pay_idx],pay);&lt;BR /&gt; agg[client_idx,bill_idx]=sum(agg[client_idx,bill_idx],bill);&lt;BR /&gt; end;&lt;BR /&gt; %end;&lt;BR /&gt; %end;&lt;BR /&gt; %end;&lt;/P&gt;
&lt;P&gt;/*use client_idx to query the summarized value for each client&amp;nbsp;*/&lt;BR /&gt; agg_bill=agg[client_idx,bill_idx];&lt;BR /&gt; agg_pay=agg[client_idx,pay_idx];&lt;/P&gt;
&lt;P&gt;/* Calculate here */&lt;BR /&gt; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure if this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 18:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/please-help-with-sas-code/m-p/230302#M54476</guid>
      <dc:creator>DCL</dc:creator>
      <dc:date>2015-10-16T18:46:24Z</dc:date>
    </item>
  </channel>
</rss>

