<?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 PRINTING &amp;quot;1&amp;quot; OR &amp;quot;0&amp;quot; WHEN DATE MATCHES in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PRINTING-quot-1-quot-OR-quot-0-quot-WHEN-DATE-MATCHES/m-p/751521#M236591</link>
    <description>&lt;P&gt;Hello everyone, I am new to SAS and I am experiencing a lot of troubles these days, hope you guys can help me out please!! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So I have two tables;&lt;/P&gt;&lt;P&gt;1. Employees' vacations info and&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WhatsApp Image 2021-07-01 at 12.32.06 PM.jpeg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60883i25C73102E7213BB9/image-size/large?v=v2&amp;amp;px=999" role="button" title="WhatsApp Image 2021-07-01 at 12.32.06 PM.jpeg" alt="WhatsApp Image 2021-07-01 at 12.32.06 PM.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Contains the headers for each day of the month.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WhatsApp Image 2021-07-01 at 12.32.42 PM.jpeg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60884i964AA514EECB6142/image-size/large?v=v2&amp;amp;px=999" role="button" title="WhatsApp Image 2021-07-01 at 12.32.42 PM.jpeg" alt="WhatsApp Image 2021-07-01 at 12.32.42 PM.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;First I need to merge both tables so that I have the info of employees and right next to that I have the headers of every single day of the month, then I need to fill each column of the days with "0" or "1" depending if that exact date matches the range of the vacation.&lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KatiaBravo_0-1625162232073.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60882iC7F577FB5A0F9551/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KatiaBravo_0-1625162232073.png" alt="KatiaBravo_0-1625162232073.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried with arrays but for some reason I keep getting errors, so I tried creating a variable that contains all days of the month and iterate it somehow, I just can´t find how to do that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*VARIABLE THAT CONTAINS ALL DAYS OF THE MONTH*/&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%let fromDate = 01JUN2021; %let toDate = 30JUN2021; data want; length key 8;&lt;BR /&gt;do date = "&amp;amp;fromDate"d to "&amp;amp;toDate"d; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;key + 1; workday = ( 2 &amp;lt;= weekday(date) &amp;lt;= 6);&amp;nbsp;&lt;BR /&gt;output; end; format date date9. ; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANKS A TON!!&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jul 2021 18:05:58 GMT</pubDate>
    <dc:creator>KatiaBravo</dc:creator>
    <dc:date>2021-07-01T18:05:58Z</dc:date>
    <item>
      <title>PRINTING "1" OR "0" WHEN DATE MATCHES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PRINTING-quot-1-quot-OR-quot-0-quot-WHEN-DATE-MATCHES/m-p/751521#M236591</link>
      <description>&lt;P&gt;Hello everyone, I am new to SAS and I am experiencing a lot of troubles these days, hope you guys can help me out please!! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So I have two tables;&lt;/P&gt;&lt;P&gt;1. Employees' vacations info and&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WhatsApp Image 2021-07-01 at 12.32.06 PM.jpeg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60883i25C73102E7213BB9/image-size/large?v=v2&amp;amp;px=999" role="button" title="WhatsApp Image 2021-07-01 at 12.32.06 PM.jpeg" alt="WhatsApp Image 2021-07-01 at 12.32.06 PM.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Contains the headers for each day of the month.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WhatsApp Image 2021-07-01 at 12.32.42 PM.jpeg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60884i964AA514EECB6142/image-size/large?v=v2&amp;amp;px=999" role="button" title="WhatsApp Image 2021-07-01 at 12.32.42 PM.jpeg" alt="WhatsApp Image 2021-07-01 at 12.32.42 PM.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;First I need to merge both tables so that I have the info of employees and right next to that I have the headers of every single day of the month, then I need to fill each column of the days with "0" or "1" depending if that exact date matches the range of the vacation.&lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KatiaBravo_0-1625162232073.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60882iC7F577FB5A0F9551/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KatiaBravo_0-1625162232073.png" alt="KatiaBravo_0-1625162232073.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried with arrays but for some reason I keep getting errors, so I tried creating a variable that contains all days of the month and iterate it somehow, I just can´t find how to do that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*VARIABLE THAT CONTAINS ALL DAYS OF THE MONTH*/&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%let fromDate = 01JUN2021; %let toDate = 30JUN2021; data want; length key 8;&lt;BR /&gt;do date = "&amp;amp;fromDate"d to "&amp;amp;toDate"d; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;key + 1; workday = ( 2 &amp;lt;= weekday(date) &amp;lt;= 6);&amp;nbsp;&lt;BR /&gt;output; end; format date date9. ; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THANKS A TON!!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 18:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PRINTING-quot-1-quot-OR-quot-0-quot-WHEN-DATE-MATCHES/m-p/751521#M236591</guid>
      <dc:creator>KatiaBravo</dc:creator>
      <dc:date>2021-07-01T18:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: PRINTING "1" OR "0" WHEN DATE MATCHES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PRINTING-quot-1-quot-OR-quot-0-quot-WHEN-DATE-MATCHES/m-p/751578#M236604</link>
      <description>&lt;P&gt;Can you post the errors in the log you got when trying arrays and maybe post the code as well?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 21:54:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PRINTING-quot-1-quot-OR-quot-0-quot-WHEN-DATE-MATCHES/m-p/751578#M236604</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-07-01T21:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: PRINTING "1" OR "0" WHEN DATE MATCHES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PRINTING-quot-1-quot-OR-quot-0-quot-WHEN-DATE-MATCHES/m-p/751595#M236616</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WANT; 
  START_DTE='05JUN2021'd;
  END_DTE  ='07JUN2021'd;
  array D[%sysevalf("&amp;amp;fromdate"d):%sysevalf("&amp;amp;todate"d)]
     %macro loop; %local i; %do i=%sysevalf("&amp;amp;fromdate"d) %to %sysevalf("&amp;amp;todate"d); 
       V_%sysfunc(putn(&amp;amp;i.,date9.))      
     %end;; %mend; %loop 
  do DATE="&amp;amp;fromdate"d to "&amp;amp;todate"d;
    D[DATE]=(START_DTE&amp;lt;=DATE&amp;lt;=END_DTE);
 end;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV align="left"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.WANT" width="720px" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_01JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_02JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_03JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_04JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_05JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_06JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_07JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_08JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_09JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_10JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_11JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_12JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_13JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_14JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_15JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_16JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_17JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;TH class="r header" scope="col" width="40px"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;V_18JUN2021&lt;/FONT&gt;&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="40px" class="r data"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;0&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 00:08:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PRINTING-quot-1-quot-OR-quot-0-quot-WHEN-DATE-MATCHES/m-p/751595#M236616</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-02T00:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: PRINTING "1" OR "0" WHEN DATE MATCHES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PRINTING-quot-1-quot-OR-quot-0-quot-WHEN-DATE-MATCHES/m-p/751768#M236701</link>
      <description>&lt;P&gt;OMG I am in shock!!!!!! This code works exactly the way I needed it to work!!!!&lt;/P&gt;&lt;P&gt;WOOOOOW... :') you did in 1 day what I was trying to do for 1 week!!! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;THANKS A LOOOOT FOR REAL!!!!! &lt;span class="lia-unicode-emoji" title=":red_heart:"&gt;❤️&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 15:52:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PRINTING-quot-1-quot-OR-quot-0-quot-WHEN-DATE-MATCHES/m-p/751768#M236701</guid>
      <dc:creator>KatiaBravo</dc:creator>
      <dc:date>2021-07-02T15:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: PRINTING "1" OR "0" WHEN DATE MATCHES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PRINTING-quot-1-quot-OR-quot-0-quot-WHEN-DATE-MATCHES/m-p/751844#M236741</link>
      <description>&lt;P&gt;Glad you find this useful. Thankfully it didn't take me a day lol.&lt;/P&gt;
&lt;P&gt;Keep practicing and reading and you'll be able to easily do this too. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 02:14:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PRINTING-quot-1-quot-OR-quot-0-quot-WHEN-DATE-MATCHES/m-p/751844#M236741</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-03T02:14:33Z</dc:date>
    </item>
  </channel>
</rss>

