<?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: Output week ending Tuesday from a Date colum in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Output-week-ending-Tuesday-from-a-Date-colum/m-p/934570#M367507</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/432394"&gt;@aazzarello&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Shift the start of the week to Wednesday by using &lt;FONT face="courier new,courier"&gt;'week&lt;STRONG&gt;.4&lt;/STRONG&gt;'&lt;/FONT&gt; instead of &lt;FONT face="courier new,courier"&gt;'week'&lt;/FONT&gt; in the first argument of the INTNX function, then the weeks will end on Tuesday as desired (see &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p10v3sa3i4kfxfn1sovhi5xzxh8n.htm#p0h7vr6sc5337dn138qe3o5kl8bj" target="_blank" rel="noopener"&gt;documentation of the shift index&lt;/A&gt;).&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2024 15:22:15 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2024-07-03T15:22:15Z</dc:date>
    <item>
      <title>Output week ending Tuesday from a Date colum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-week-ending-Tuesday-from-a-Date-colum/m-p/934541#M367500</link>
      <description>&lt;P&gt;I'm trying to get the last day of the week ending Tuesday for a Date column in my dataset. I've been using the intnx function with the optional 'e' identifier at the end, but I get the week ending Saturday. Just subtracting days from the output doesn't quite work either due to some days falling on different weeks. Code below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql;
create table erewq as 
select 
intnx('week',t1.'Period Dt'n , 0, 'e') as DTM2 format=date9.,
t1.'period dt'n
from WORK.EDJEC t1
;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Is there another function that would perform this better, or a different way to use the intnx function? Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 13:58:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-week-ending-Tuesday-from-a-Date-colum/m-p/934541#M367500</guid>
      <dc:creator>aazzarello</dc:creator>
      <dc:date>2024-07-03T13:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Output week ending Tuesday from a Date colum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-week-ending-Tuesday-from-a-Date-colum/m-p/934570#M367507</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/432394"&gt;@aazzarello&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Shift the start of the week to Wednesday by using &lt;FONT face="courier new,courier"&gt;'week&lt;STRONG&gt;.4&lt;/STRONG&gt;'&lt;/FONT&gt; instead of &lt;FONT face="courier new,courier"&gt;'week'&lt;/FONT&gt; in the first argument of the INTNX function, then the weeks will end on Tuesday as desired (see &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/p10v3sa3i4kfxfn1sovhi5xzxh8n.htm#p0h7vr6sc5337dn138qe3o5kl8bj" target="_blank" rel="noopener"&gt;documentation of the shift index&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 15:22:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-week-ending-Tuesday-from-a-Date-colum/m-p/934570#M367507</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-07-03T15:22:15Z</dc:date>
    </item>
  </channel>
</rss>

