<?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 Automation of Dates in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Automation-of-Dates/m-p/806211#M33534</link>
    <description>&lt;P&gt;Good morning everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am very new to automating of codes/dates - Please help me with automating dates in my piece of code. I currently have the following coded up:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;data test;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;set testing;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;if '05Apr2019'd &amp;lt; csa_inv_dte &amp;lt; '06May2019'd&amp;nbsp; then trademonth = '01:APR 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05May2019'd &amp;lt; csa_inv_dte &amp;lt; '06Jun2019'd&amp;nbsp; then trademonth = '02:MAY 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05jun2019'd &amp;lt; csa_inv_dte &amp;lt; '06Jul2019'd&amp;nbsp; &amp;nbsp; &amp;nbsp;then trademonth = '03:JUN 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05jul2019'd &amp;lt; csa_inv_dte &amp;lt; '06Aug2019'd&amp;nbsp; &amp;nbsp; &amp;nbsp;then trademonth = '04:JUL 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05aug2019'd &amp;lt; csa_inv_dte &amp;lt; '06Sep2019'd&amp;nbsp; then trademonth = '05:AUG 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05sep2019'd &amp;lt; csa_inv_dte &amp;lt; '06Oct2019'd&amp;nbsp; &amp;nbsp;then trademonth = '06:SEP 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Oct2019'd &amp;lt; csa_inv_dte &amp;lt; '06Nov2019'd&amp;nbsp; &amp;nbsp;then trademonth = '07:OCT 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Nov2019'd &amp;lt; csa_inv_dte &amp;lt; '02Dec2019'd&amp;nbsp; then trademonth = '08:NOV 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '01Dec2019'd &amp;lt; csa_inv_dte &amp;lt; '06Jan2020'd&amp;nbsp; then trademonth = '09:DEC 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Jan2020'd &amp;lt; csa_inv_dte &amp;lt; '06Feb2020'd&amp;nbsp; then trademonth = '10:JAN 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Feb2020'd &amp;lt; csa_inv_dte &amp;lt; '06Mar2020'd&amp;nbsp; then trademonth = '11:FEB 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Mar2020'd &amp;lt; csa_inv_dte &amp;lt; '06Apr2020'd&amp;nbsp; then trademonth = '12:MAR 2020'; else&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;if '05Apr2020'd &amp;lt; csa_inv_dte &amp;lt; '06May2020'd&amp;nbsp; then trademonth = '13:APR 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05May2020'd &amp;lt; csa_inv_dte &amp;lt; '06Jun2020'd&amp;nbsp; then trademonth = '14:MAY 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05jun2020'd &amp;lt; csa_inv_dte &amp;lt; '06Jul2020'd&amp;nbsp; &amp;nbsp; &amp;nbsp;then trademonth = '15:JUN 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05jul2020'd &amp;lt; csa_inv_dte &amp;lt; '06Aug2020'd&amp;nbsp; &amp;nbsp; then trademonth = '16:JUL 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05aug2020'd &amp;lt; csa_inv_dte &amp;lt; '06Sep2020'd&amp;nbsp; then trademonth = '17:AUG 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05sep2020'd &amp;lt; csa_inv_dte &amp;lt; '06Oct2020'd&amp;nbsp; &amp;nbsp;then trademonth = '18:SEP 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05oct2020'd &amp;lt; csa_inv_dte &amp;lt; '06Nov2020'd&amp;nbsp; &amp;nbsp;then trademonth = '19:OCT 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05nov2020'd &amp;lt; csa_inv_dte &amp;lt; '02Dec2020'd&amp;nbsp; then trademonth = '10:NOV 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '01Dec2020'd &amp;lt; csa_inv_dte &amp;lt; '06Jan2021'd&amp;nbsp; then trademonth = '21:DEC 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Jan2021'd &amp;lt; csa_inv_dte &amp;lt; '06Feb2021'd&amp;nbsp; then trademonth = '22:JAN 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Feb2021'd &amp;lt; csa_inv_dte &amp;lt; '06Mar2021'd&amp;nbsp; then trademonth = '23:FEB 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Mar2021'd &amp;lt; csa_inv_dte &amp;lt; '01Apr2021'd&amp;nbsp; then trademonth = '24:MAR 2021'; else&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;if '31Mar2021'd &amp;lt; csa_inv_dte &amp;lt; '01May2021'd then trademonth = '25:APR 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '30Apr2021'd &amp;lt; csa_inv_dte &amp;lt; '01Jun2021'd&amp;nbsp; &amp;nbsp;then trademonth = '26:MAY 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31May2021'd &amp;lt; csa_inv_dte &amp;lt; '01Jul2021'd&amp;nbsp; &amp;nbsp;then trademonth = '27:JUN 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '30Jun2021'd &amp;lt; csa_inv_dte &amp;lt; '01Aug2021'd&amp;nbsp; then trademonth = '28:JUL 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31Jul2021'd &amp;lt; csa_inv_dte &amp;lt; '01Sep2021'd&amp;nbsp; &amp;nbsp;then trademonth = '29:AUG 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31Aug2021'd &amp;lt; csa_inv_dte &amp;lt; '01Oct2021'd&amp;nbsp; then trademonth = '30:SEP 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '30Sep2021'd &amp;lt; csa_inv_dte &amp;lt; '01Nov2021'd&amp;nbsp; then trademonth = '31:OCT 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31Oct2021'd &amp;lt; csa_inv_dte &amp;lt; '01Dec2021'd&amp;nbsp; then trademonth = '32:NOV 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '30Nov2021'd &amp;lt; csa_inv_dte &amp;lt; '01Jan2022'd&amp;nbsp; then trademonth = '33:DEC 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31Dec2021'd &amp;lt; csa_inv_dte &amp;lt; '01Feb2022'd&amp;nbsp; then trademonth = '34:JAN 2022'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31Jan2022'd &amp;lt; csa_inv_dte &amp;lt; '01Mar2022'd&amp;nbsp; then trademonth = '35:FEB 2022'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '28Feb2022'd &amp;lt; csa_inv_dte &amp;lt; '01Apr2022'd&amp;nbsp; then trademonth = '36:MAR 2022'; else&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;if csa_inv_dte = .&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; then trademonth = '99: No Inv'; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;format trademonth $30.;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;I need to add more dates every month to create the trademonth variable but I want to automate this process to automatically add new month's dates. Please assist me with this process.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Apr 2022 08:43:12 GMT</pubDate>
    <dc:creator>MagD</dc:creator>
    <dc:date>2022-04-06T08:43:12Z</dc:date>
    <item>
      <title>Automation of Dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Automation-of-Dates/m-p/806211#M33534</link>
      <description>&lt;P&gt;Good morning everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am very new to automating of codes/dates - Please help me with automating dates in my piece of code. I currently have the following coded up:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;data test;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;set testing;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;if '05Apr2019'd &amp;lt; csa_inv_dte &amp;lt; '06May2019'd&amp;nbsp; then trademonth = '01:APR 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05May2019'd &amp;lt; csa_inv_dte &amp;lt; '06Jun2019'd&amp;nbsp; then trademonth = '02:MAY 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05jun2019'd &amp;lt; csa_inv_dte &amp;lt; '06Jul2019'd&amp;nbsp; &amp;nbsp; &amp;nbsp;then trademonth = '03:JUN 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05jul2019'd &amp;lt; csa_inv_dte &amp;lt; '06Aug2019'd&amp;nbsp; &amp;nbsp; &amp;nbsp;then trademonth = '04:JUL 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05aug2019'd &amp;lt; csa_inv_dte &amp;lt; '06Sep2019'd&amp;nbsp; then trademonth = '05:AUG 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05sep2019'd &amp;lt; csa_inv_dte &amp;lt; '06Oct2019'd&amp;nbsp; &amp;nbsp;then trademonth = '06:SEP 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Oct2019'd &amp;lt; csa_inv_dte &amp;lt; '06Nov2019'd&amp;nbsp; &amp;nbsp;then trademonth = '07:OCT 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Nov2019'd &amp;lt; csa_inv_dte &amp;lt; '02Dec2019'd&amp;nbsp; then trademonth = '08:NOV 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '01Dec2019'd &amp;lt; csa_inv_dte &amp;lt; '06Jan2020'd&amp;nbsp; then trademonth = '09:DEC 2019'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Jan2020'd &amp;lt; csa_inv_dte &amp;lt; '06Feb2020'd&amp;nbsp; then trademonth = '10:JAN 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Feb2020'd &amp;lt; csa_inv_dte &amp;lt; '06Mar2020'd&amp;nbsp; then trademonth = '11:FEB 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Mar2020'd &amp;lt; csa_inv_dte &amp;lt; '06Apr2020'd&amp;nbsp; then trademonth = '12:MAR 2020'; else&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;if '05Apr2020'd &amp;lt; csa_inv_dte &amp;lt; '06May2020'd&amp;nbsp; then trademonth = '13:APR 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05May2020'd &amp;lt; csa_inv_dte &amp;lt; '06Jun2020'd&amp;nbsp; then trademonth = '14:MAY 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05jun2020'd &amp;lt; csa_inv_dte &amp;lt; '06Jul2020'd&amp;nbsp; &amp;nbsp; &amp;nbsp;then trademonth = '15:JUN 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05jul2020'd &amp;lt; csa_inv_dte &amp;lt; '06Aug2020'd&amp;nbsp; &amp;nbsp; then trademonth = '16:JUL 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05aug2020'd &amp;lt; csa_inv_dte &amp;lt; '06Sep2020'd&amp;nbsp; then trademonth = '17:AUG 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05sep2020'd &amp;lt; csa_inv_dte &amp;lt; '06Oct2020'd&amp;nbsp; &amp;nbsp;then trademonth = '18:SEP 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05oct2020'd &amp;lt; csa_inv_dte &amp;lt; '06Nov2020'd&amp;nbsp; &amp;nbsp;then trademonth = '19:OCT 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05nov2020'd &amp;lt; csa_inv_dte &amp;lt; '02Dec2020'd&amp;nbsp; then trademonth = '10:NOV 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '01Dec2020'd &amp;lt; csa_inv_dte &amp;lt; '06Jan2021'd&amp;nbsp; then trademonth = '21:DEC 2020'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Jan2021'd &amp;lt; csa_inv_dte &amp;lt; '06Feb2021'd&amp;nbsp; then trademonth = '22:JAN 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Feb2021'd &amp;lt; csa_inv_dte &amp;lt; '06Mar2021'd&amp;nbsp; then trademonth = '23:FEB 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '05Mar2021'd &amp;lt; csa_inv_dte &amp;lt; '01Apr2021'd&amp;nbsp; then trademonth = '24:MAR 2021'; else&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;if '31Mar2021'd &amp;lt; csa_inv_dte &amp;lt; '01May2021'd then trademonth = '25:APR 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '30Apr2021'd &amp;lt; csa_inv_dte &amp;lt; '01Jun2021'd&amp;nbsp; &amp;nbsp;then trademonth = '26:MAY 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31May2021'd &amp;lt; csa_inv_dte &amp;lt; '01Jul2021'd&amp;nbsp; &amp;nbsp;then trademonth = '27:JUN 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '30Jun2021'd &amp;lt; csa_inv_dte &amp;lt; '01Aug2021'd&amp;nbsp; then trademonth = '28:JUL 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31Jul2021'd &amp;lt; csa_inv_dte &amp;lt; '01Sep2021'd&amp;nbsp; &amp;nbsp;then trademonth = '29:AUG 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31Aug2021'd &amp;lt; csa_inv_dte &amp;lt; '01Oct2021'd&amp;nbsp; then trademonth = '30:SEP 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '30Sep2021'd &amp;lt; csa_inv_dte &amp;lt; '01Nov2021'd&amp;nbsp; then trademonth = '31:OCT 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31Oct2021'd &amp;lt; csa_inv_dte &amp;lt; '01Dec2021'd&amp;nbsp; then trademonth = '32:NOV 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '30Nov2021'd &amp;lt; csa_inv_dte &amp;lt; '01Jan2022'd&amp;nbsp; then trademonth = '33:DEC 2021'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31Dec2021'd &amp;lt; csa_inv_dte &amp;lt; '01Feb2022'd&amp;nbsp; then trademonth = '34:JAN 2022'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '31Jan2022'd &amp;lt; csa_inv_dte &amp;lt; '01Mar2022'd&amp;nbsp; then trademonth = '35:FEB 2022'; else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;if '28Feb2022'd &amp;lt; csa_inv_dte &amp;lt; '01Apr2022'd&amp;nbsp; then trademonth = '36:MAR 2022'; else&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;if csa_inv_dte = .&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; then trademonth = '99: No Inv'; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="andale mono,times"&gt;format trademonth $30.;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="andale mono,times"&gt;I need to add more dates every month to create the trademonth variable but I want to automate this process to automatically add new month's dates. Please assist me with this process.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 08:43:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Automation-of-Dates/m-p/806211#M33534</guid>
      <dc:creator>MagD</dc:creator>
      <dc:date>2022-04-06T08:43:12Z</dc:date>
    </item>
    <item>
      <title>Re: Automation of Dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Automation-of-Dates/m-p/806222#M33540</link>
      <description>&lt;P&gt;This can be done for sure but you need to explain to us the rule that needs to apply.&lt;/P&gt;
&lt;P&gt;Normally we can derive the rule from code shared but.... it looks to me that there are some issues with your logic.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1649235380304.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70151i7F1452A6EE8F3090/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1649235380304.png" alt="Patrick_0-1649235380304.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Below dates are overlapping. Because you don' have an ELSE statement the 2nd IF statement will come into effect. Is that what's required?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Most of the time the beginning of a date boundary appears to be the 5th calendar day of a month. But then there are cases which are different.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_1-1649235517847.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70152iBB7D7A26705CAE3F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_1-1649235517847.png" alt="Patrick_1-1649235517847.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to explain to us the logic for how the boundaries get defined as else it's not possible to express such logic in code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 08:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Automation-of-Dates/m-p/806222#M33540</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-04-06T08:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Automation of Dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Automation-of-Dates/m-p/806231#M33543</link>
      <description>Hi Patrick,&lt;BR /&gt;&lt;BR /&gt;Thank you for responding to my query.&lt;BR /&gt;&lt;BR /&gt;Yes, Because I don't have an ELSE statement the 2nd IF statement will come into effect - that's what is required.&lt;BR /&gt;&lt;BR /&gt;I think we can focus on this part of the code for now just to keep consistency:&lt;BR /&gt;&lt;BR /&gt;if '31Mar2021'd &amp;lt; csa_inv_dte &amp;lt; '01May2021'd then trademonth = '25:APR 2021'; else&lt;BR /&gt;if '30Apr2021'd &amp;lt; csa_inv_dte &amp;lt; '01Jun2021'd then trademonth = '26:MAY 2021'; else&lt;BR /&gt;if '31May2021'd &amp;lt; csa_inv_dte &amp;lt; '01Jul2021'd then trademonth = '27:JUN 2021'; else&lt;BR /&gt;if '30Jun2021'd &amp;lt; csa_inv_dte &amp;lt; '01Aug2021'd then trademonth = '28:JUL 2021'; else&lt;BR /&gt;if '31Jul2021'd &amp;lt; csa_inv_dte &amp;lt; '01Sep2021'd then trademonth = '29:AUG 2021'; else&lt;BR /&gt;if '31Aug2021'd &amp;lt; csa_inv_dte &amp;lt; '01Oct2021'd then trademonth = '30:SEP 2021'; else&lt;BR /&gt;if '30Sep2021'd &amp;lt; csa_inv_dte &amp;lt; '01Nov2021'd then trademonth = '31:OCT 2021'; else&lt;BR /&gt;if '31Oct2021'd &amp;lt; csa_inv_dte &amp;lt; '01Dec2021'd then trademonth = '32:NOV 2021'; else&lt;BR /&gt;if '30Nov2021'd &amp;lt; csa_inv_dte &amp;lt; '01Jan2022'd then trademonth = '33:DEC 2021'; else&lt;BR /&gt;if '31Dec2021'd &amp;lt; csa_inv_dte &amp;lt; '01Feb2022'd then trademonth = '34:JAN 2022'; else&lt;BR /&gt;if '31Jan2022'd &amp;lt; csa_inv_dte &amp;lt; '01Mar2022'd then trademonth = '35:FEB 2022'; else&lt;BR /&gt;if '28Feb2022'd &amp;lt; csa_inv_dte &amp;lt; '01Apr2022'd then trademonth = '36:MAR 2022'; else&lt;BR /&gt;&lt;BR /&gt;if 			    csa_inv_dte = .			 then trademonth = '99:  No Inv';&lt;BR /&gt;&lt;BR /&gt;So next month's code will include: if '31Mar2022'd &amp;lt; csa_inv_dte &amp;lt; '01May2022'd then trademonth = '37:APR 2022'; else&lt;BR /&gt;but I want to automate these dates.&lt;BR /&gt;&lt;BR /&gt;Please let me know if I am being clear or not.</description>
      <pubDate>Wed, 06 Apr 2022 09:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Automation-of-Dates/m-p/806231#M33543</guid>
      <dc:creator>MagD</dc:creator>
      <dc:date>2022-04-06T09:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Automation of Dates</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Automation-of-Dates/m-p/806249#M33546</link>
      <description>&lt;P&gt;Your code screams for using a formula.&lt;/P&gt;
&lt;P&gt;You want a string consisting of a running count of months (starting at a given point in time), followed by a colon and the monthname+year, separated by a blank.&lt;/P&gt;
&lt;P&gt;See this formula:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let start = %sysevalf("31mar2019"d);


trademonth = 
  put(intck("month",&amp;amp;start.,csa_inv_dte),2.) !! 
  ":" !!
  upcase(put(csa_inv_dte,monname3.)) !!
  " " !! 
  put(csa_inv_dte,year4.)
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Applied to some fake data:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let start = %sysevalf("31mar2019"d);

data want;
input csa_inv_dte :yymmdd10.;
format csa_inv_dte yymmdd10.;
trademonth = 
  put(intck("month",&amp;amp;start.,csa_inv_dte),2.) !! 
  ":" !!
  upcase(put(csa_inv_dte,monname3.)) !!
  " " !! 
  put(csa_inv_dte,year4.)
;
datalines;
2020-03-05
2022-04-06
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 10:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Automation-of-Dates/m-p/806249#M33546</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-04-06T10:59:32Z</dc:date>
    </item>
  </channel>
</rss>

