<?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: Selection of the previous date and comparison of the result with the current one in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Selection-of-the-previous-date-and-comparison-of-the-result-with/m-p/781222#M248990</link>
    <description>&lt;P&gt;So you have a macro variable with a date in DATE9. format, and need another macro variable that contains the raw value of the last day of the previous month from that?&lt;/P&gt;</description>
    <pubDate>Fri, 19 Nov 2021 11:00:19 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-11-19T11:00:19Z</dc:date>
    <item>
      <title>Selection of the previous date and comparison of the result with the current one</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selection-of-the-previous-date-and-comparison-of-the-result-with/m-p/781211#M248988</link>
      <description>&lt;P&gt;I have this problem because I have a promt set for which picks the report date for me, I select it with where in proc sql. However, it also needs to create a table where I will compare with the previous last date. What function to use for this?&lt;/P&gt;
&lt;PRE&gt;%let gv_date_dly=%sysevalf(%bquote('&amp;amp;date_dly.'d));
&lt;/PRE&gt;
&lt;P&gt;this is the code for selecting the actual results,&lt;/P&gt;
&lt;PRE&gt;proc sql;
create table zabcheck as
select 
sum(zab_hip) as hip_curr
,zab_data_spr as date_curr
from _mart.zab_kred 
where zab_data_spr=&amp;amp;gv_date_dly. and zab_hip = 1
group by zab_data_spr
;
quit;&lt;/PRE&gt;
&lt;P&gt;And i would like to create table where&lt;/P&gt;
&lt;P&gt;where zab_data_spr=&amp;amp;gv_date_dly.&amp;nbsp; will be for previous date ( always last day of month)&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 10:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selection-of-the-previous-date-and-comparison-of-the-result-with/m-p/781211#M248988</guid>
      <dc:creator>Gieorgie</dc:creator>
      <dc:date>2021-11-19T10:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Selection of the previous date and comparison of the result with the current one</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selection-of-the-previous-date-and-comparison-of-the-result-with/m-p/781222#M248990</link>
      <description>&lt;P&gt;So you have a macro variable with a date in DATE9. format, and need another macro variable that contains the raw value of the last day of the previous month from that?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 11:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selection-of-the-previous-date-and-comparison-of-the-result-with/m-p/781222#M248990</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-19T11:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Selection of the previous date and comparison of the result with the current one</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selection-of-the-previous-date-and-comparison-of-the-result-with/m-p/781223#M248991</link>
      <description>Exactly, every day of the report until the last day of the month.</description>
      <pubDate>Fri, 19 Nov 2021 11:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selection-of-the-previous-date-and-comparison-of-the-result-with/m-p/781223#M248991</guid>
      <dc:creator>Gieorgie</dc:creator>
      <dc:date>2021-11-19T11:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Selection of the previous date and comparison of the result with the current one</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selection-of-the-previous-date-and-comparison-of-the-result-with/m-p/781226#M248993</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let date_dly = 15nov2021;

%let gv_date_dl = %sysfunc(intnx(month,%sysevalf("&amp;amp;date_dly."d),-1,e));

%put &amp;amp;=gv_date_dl;

%put %sysfunc(putn(&amp;amp;gv_date_dl.,yymmdd10.));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The last two statements are for control purposes only.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 11:13:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selection-of-the-previous-date-and-comparison-of-the-result-with/m-p/781226#M248993</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-11-19T11:13:51Z</dc:date>
    </item>
  </channel>
</rss>

