<?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 count days in the first week in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/count-days-in-the-first-week/m-p/751396#M29672</link>
    <description>&lt;P&gt;I'm new to sas and would like learn to calculate:&lt;/P&gt;&lt;P&gt;How many days in the first week of the year?&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;Year = 2016, Week = 1&lt;/P&gt;&lt;P&gt;num_days: 2 days&lt;/P&gt;&lt;P&gt;Year = 2020, week = 1&lt;/P&gt;&lt;P&gt;num_days: 4 days&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jul 2021 04:14:06 GMT</pubDate>
    <dc:creator>alo_moon</dc:creator>
    <dc:date>2021-07-01T04:14:06Z</dc:date>
    <item>
      <title>count days in the first week</title>
      <link>https://communities.sas.com/t5/New-SAS-User/count-days-in-the-first-week/m-p/751396#M29672</link>
      <description>&lt;P&gt;I'm new to sas and would like learn to calculate:&lt;/P&gt;&lt;P&gt;How many days in the first week of the year?&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;Year = 2016, Week = 1&lt;/P&gt;&lt;P&gt;num_days: 2 days&lt;/P&gt;&lt;P&gt;Year = 2020, week = 1&lt;/P&gt;&lt;P&gt;num_days: 4 days&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jul 2021 04:14:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/count-days-in-the-first-week/m-p/751396#M29672</guid>
      <dc:creator>alo_moon</dc:creator>
      <dc:date>2021-07-01T04:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: count days in the first week</title>
      <link>https://communities.sas.com/t5/New-SAS-User/count-days-in-the-first-week/m-p/751411#M29676</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/387927"&gt;@alo_moon&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p0ahi8tk3trkv5n173sil9hd7c62.htm" target="_blank" rel="noopener"&gt;WEEKDAY function&lt;/A&gt; (together with the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p0bo5thbfrcab1n1menkqxq2suiv.htm" target="_blank" rel="noopener"&gt;MDY function&lt;/A&gt; and a simple calculation) to get the desired result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
input year;
num_days=8-weekday(mdy(1,1,year));
cards;
2016
2020
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Jul 2021 08:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/count-days-in-the-first-week/m-p/751411#M29676</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-07-01T08:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: count days in the first week</title>
      <link>https://communities.sas.com/t5/New-SAS-User/count-days-in-the-first-week/m-p/751436#M29677</link>
      <description>data want;&lt;BR /&gt;input year;&lt;BR /&gt;date=mdy(1,1,year);&lt;BR /&gt;num_days=intnx('week',date,1)-date;&lt;BR /&gt;cards;&lt;BR /&gt;2016&lt;BR /&gt;2020&lt;BR /&gt;;</description>
      <pubDate>Thu, 01 Jul 2021 12:37:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/count-days-in-the-first-week/m-p/751436#M29677</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-07-01T12:37:25Z</dc:date>
    </item>
  </channel>
</rss>

