<?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: Increment date automatically in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851133#M37324</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437885"&gt;@Kirito1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I want to do something like this but this is just normal a normal counting this code is doing. I am applying this code on a dataset I want it to update every time it reads the data.&lt;/P&gt;
&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;DATA B; SET A (where=('DATE_OF_APPROVAL'N GE '01DEC2022'D));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have hard coded the date here but if I run this data on 02Dec2022 I don't want to specify the Date everytime I run the code.&lt;/P&gt;
&lt;P&gt;I somehow want to use the below code to update '&lt;CODE class=""&gt;DATE_OF_APPROVAL&lt;/CODE&gt;' everytime&amp;nbsp; I run this code.&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think what you want is the TODAY() function. The is no incrementing here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA B; 
SET A (where=(DATE_OF_APPROVAL GE today()));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Dec 2022 12:10:22 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-12-26T12:10:22Z</dc:date>
    <item>
      <title>Increment date automatically</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851128#M37319</link>
      <description>&lt;P&gt;Suppose I have Date 25Dec2022 and I have declared it as date. Now I want it to increment the date every time I run it.&lt;/P&gt;&lt;P&gt;After running the code it should be 26Dec2022 and Again If we ran that code it should be 27Dec2022 and so on..&lt;/P&gt;&lt;P&gt;Can anyone suggest how should I proceed with it.&lt;/P&gt;&lt;P&gt;I think INTNX function would be useful but how would I automate this process After I have declared it once.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 11:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851128#M37319</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2022-12-26T11:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: Increment date automatically</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851129#M37320</link>
      <description>&lt;P&gt;&amp;nbsp;You can increment dates by arithmetic. You want to simply add 1 to the date variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not clear if you want to do this in a data step or in a macro variable or somewhere else, so I offer no example of doing this. Please clarify.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Terminology : unlike other computer languages, in SAS you cannot "declare" anything. The variable either is a date variable or it is not a date variable.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 11:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851129#M37320</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-26T11:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Increment date automatically</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851130#M37321</link>
      <description>How do I increment date by arithmetic can you provide any syntax for that. I want to apply this on a data step.&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Dec 2022 11:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851130#M37321</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2022-12-26T11:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Increment date automatically</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851131#M37322</link>
      <description>&lt;P&gt;You add 1 to the variable. I cannot provide example code because I asked you to clarify something, but you did not do so. I said: "It is not clear if you want to do this in a data step or in a macro variable or somewhere else, so I offer no example of doing this. Please clarify."&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 11:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851131#M37322</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-26T11:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Increment date automatically</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851132#M37323</link>
      <description>&lt;P&gt;I want to do something like this but this is just normal a normal counting this code is doing. I am applying this code on a dataset I want it to update every time it reads the data.&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;DATA B; SET A (where=('DATE_OF_APPROVAL'N GE '01DEC2022'D));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have hard coded the date here but if I run this data on 02Dec2022 I don't want to specify the Date everytime I run the code.&lt;/P&gt;&lt;P&gt;I somehow want to use the below code to update '&lt;CODE class=""&gt;DATE_OF_APPROVAL&lt;/CODE&gt;' everytime&amp;nbsp; I run this code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%macro date_loop(start,end);
   %let start=%sysfunc(inputn(&amp;amp;start,anydtdte9.));
   %let end=%sysfunc(inputn(&amp;amp;end,anydtdte9.));
   %let dif=%sysfunc(intck(month,&amp;amp;start,&amp;amp;end));
     %do i=0 %to &amp;amp;dif;
      %let date=%sysfunc(intnx(month,&amp;amp;start,&amp;amp;i,b),date9.);
      %put &amp;amp;date;
     %end;
   %mend date_loop;

   %date_loop(25DEC2022,25DEC2023)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is it clear now.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 12:02:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851132#M37323</guid>
      <dc:creator>Kirito1</dc:creator>
      <dc:date>2022-12-26T12:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Increment date automatically</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851133#M37324</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437885"&gt;@Kirito1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I want to do something like this but this is just normal a normal counting this code is doing. I am applying this code on a dataset I want it to update every time it reads the data.&lt;/P&gt;
&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;DATA B; SET A (where=('DATE_OF_APPROVAL'N GE '01DEC2022'D));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have hard coded the date here but if I run this data on 02Dec2022 I don't want to specify the Date everytime I run the code.&lt;/P&gt;
&lt;P&gt;I somehow want to use the below code to update '&lt;CODE class=""&gt;DATE_OF_APPROVAL&lt;/CODE&gt;' everytime&amp;nbsp; I run this code.&lt;CODE class=""&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think what you want is the TODAY() function. The is no incrementing here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA B; 
SET A (where=(DATE_OF_APPROVAL GE today()));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Dec 2022 12:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Increment-date-automatically/m-p/851133#M37324</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-26T12:10:22Z</dc:date>
    </item>
  </channel>
</rss>

