<?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: Picture formats: date/datetime directives in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55832#M11892</link>
    <description>I don't think V and W directives have been implemented.  Although I see them documented in my 9.2 documentation.  There are formats in the NLS &lt;BR /&gt;
[pre]weekU weekV and weekW[/pre]&lt;BR /&gt;
that may  be helpful.</description>
    <pubDate>Sun, 24 Apr 2011 16:46:56 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2011-04-24T16:46:56Z</dc:date>
    <item>
      <title>Picture formats: date/datetime directives</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55831#M11891</link>
      <description>Hi &lt;BR /&gt;
I'm struggling to understand why date/datetime directives for picture formats don't work for me as documented (SAS 9.2 TS Level 2M3, X64_VSPRO platform).&lt;BR /&gt;
It seems that directive %V and %W don't work at all, and that %U doesn't have a leading zero. Any ideas what's going wrong here?&lt;BR /&gt;
That's what I find in the docu:&lt;BR /&gt;
/**&lt;BR /&gt;
%U &lt;BR /&gt;
week number of the year as a decimal number (0,53) with leading 0. Sunday is considered the first day of the week.&lt;BR /&gt;
&lt;BR /&gt;
%V &lt;BR /&gt;
week number (01-53) with the first Monday as the start day of the first week. Minimum days of the first week is 4.&lt;BR /&gt;
&lt;BR /&gt;
%W &lt;BR /&gt;
week number (00-53) with the first Monday as the start day of the first week.&lt;BR /&gt;
*/&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
That's the code I'm running:&lt;BR /&gt;
&lt;BR /&gt;
proc format;&lt;BR /&gt;
   picture DTyyyyU &lt;BR /&gt;
      low-high='%Y%U' (datatype=datetime );&lt;BR /&gt;
   picture DTyyyy0U &lt;BR /&gt;
      low-high='%Y%0U' (datatype=datetime );&lt;BR /&gt;
   picture DTyyyyV &lt;BR /&gt;
      low-high='%Y%V' (datatype=datetime );&lt;BR /&gt;
   picture DTyyyy0V &lt;BR /&gt;
      low-high='%Y%0W' (datatype=datetime );&lt;BR /&gt;
   picture DTyyyyW &lt;BR /&gt;
      low-high='%Y%W' (datatype=datetime );&lt;BR /&gt;
   picture DTyyyy0W &lt;BR /&gt;
      low-high='%Y%0W' (datatype=datetime );&lt;BR /&gt;
&lt;BR /&gt;
   picture DyyyyU &lt;BR /&gt;
      low-high='%Y%U' (datatype=date );&lt;BR /&gt;
   picture Dyyyy0U &lt;BR /&gt;
      low-high='%Y%0U' (datatype=date );&lt;BR /&gt;
   picture DyyyyV &lt;BR /&gt;
      low-high='%Y%V' (datatype=date );&lt;BR /&gt;
   picture Dyyyy0V &lt;BR /&gt;
      low-high='%Y%0W' (datatype=date );&lt;BR /&gt;
   picture DyyyyW &lt;BR /&gt;
      low-high='%Y%W' (datatype=date );&lt;BR /&gt;
   picture Dyyyy0W &lt;BR /&gt;
      low-high='%Y%0W' (datatype=date );&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
options ls=100;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
   put 10*'*' @12 'with datetime values' @33 60*'*';&lt;BR /&gt;
   do var='01jan2011 00:00:00'dt,'24apr2011 00:00:00'dt,'25apr2011 00:00:00'dt;&lt;BR /&gt;
      put '%Y%U: '  var DTyyyyU6.  '   ' @;&lt;BR /&gt;
      put '%Y%0U: ' var DTyyyy0U6. '   ' @;&lt;BR /&gt;
      put '%Y%V: '  var DTyyyyV6.  '   ' @;&lt;BR /&gt;
      put '%Y%0V: ' var DTyyyy0V6. '   ' @;&lt;BR /&gt;
      put '%Y%W: '  var DTyyyyW6.  '   ' @;&lt;BR /&gt;
      put '%Y%0W: ' var DTyyyy0W6. '   ' ;&lt;BR /&gt;
   end;&lt;BR /&gt;
&lt;BR /&gt;
   put 10*'*' @12 'with date values' @29 64*'*';&lt;BR /&gt;
   do var='01jan2011'd,'24apr2011'd,'25apr2011'd;&lt;BR /&gt;
      put '%Y%U: '  var DyyyyU6.  '   ' @;&lt;BR /&gt;
      put '%Y%0U: ' var Dyyyy0U6. '   ' @;&lt;BR /&gt;
      put '%Y%V: '  var DyyyyV6.  '   ' @;&lt;BR /&gt;
      put '%Y%0V: ' var Dyyyy0V6. '   ' @;&lt;BR /&gt;
      put '%Y%W: '  var DyyyyW6.  '   ' @;&lt;BR /&gt;
      put '%Y%0W: ' var Dyyyy0W6. '   ' ;&lt;BR /&gt;
   end;&lt;BR /&gt;
   put 92*'*';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
And that's the result I'm getting:&lt;BR /&gt;
********** with datetime values ************************************************************&lt;BR /&gt;
%Y%U:  20110   %Y%0U: 201100   %Y%V:   2011   %Y%0V:   2011   %Y%W:   2011   %Y%0W:   2011   &lt;BR /&gt;
%Y%U: 201117   %Y%0U: 201117   %Y%V:   2011   %Y%0V:   2011   %Y%W:   2011   %Y%0W:   2011   &lt;BR /&gt;
%Y%U: 201117   %Y%0U: 201117   %Y%V:   2011   %Y%0V:   2011   %Y%W:   2011   %Y%0W:   2011   &lt;BR /&gt;
********** with date values ****************************************************************&lt;BR /&gt;
%Y%U:  20110   %Y%0U: 201100   %Y%V:   2011   %Y%0V:   2011   %Y%W:   2011   %Y%0W:   2011   &lt;BR /&gt;
%Y%U: 201117   %Y%0U: 201117   %Y%V:   2011   %Y%0V:   2011   %Y%W:   2011   %Y%0W:   2011   &lt;BR /&gt;
%Y%U: 201117   %Y%0U: 201117   %Y%V:   2011   %Y%0V:   2011   %Y%W:   2011   %Y%0W:   2011   &lt;BR /&gt;
********************************************************************************************&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Patrick</description>
      <pubDate>Sun, 24 Apr 2011 02:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55831#M11891</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-04-24T02:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Picture formats: date/datetime directives</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55832#M11892</link>
      <description>I don't think V and W directives have been implemented.  Although I see them documented in my 9.2 documentation.  There are formats in the NLS &lt;BR /&gt;
[pre]weekU weekV and weekW[/pre]&lt;BR /&gt;
that may  be helpful.</description>
      <pubDate>Sun, 24 Apr 2011 16:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55832#M11892</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-04-24T16:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: Picture formats: date/datetime directives</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55833#M11893</link>
      <description>Thanks data _null_&lt;BR /&gt;
Really rare that the SAS docu gets it so wrong.</description>
      <pubDate>Thu, 28 Apr 2011 12:29:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55833#M11893</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-04-28T12:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Picture formats: date/datetime directives</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55834#M11894</link>
      <description>Hi.Patrick&lt;BR /&gt;
Today I check something in SAS documentation.I found some interesting thing.&lt;BR /&gt;
Maybe just as _null_ said, %V %W directives is only suitable for some local value and&lt;BR /&gt;
local function.&lt;BR /&gt;
[pre]&lt;BR /&gt;
data temp;&lt;BR /&gt;
 date=19802; format date yymmdd10.;&lt;BR /&gt;
 a=nldate(date,'%Y%0V'); b=nldate(date,'%Y%0W');&lt;BR /&gt;
 put date= a= b=;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
76   data temp;&lt;BR /&gt;
77    date=19802; format date yymmdd10.;&lt;BR /&gt;
78    a=nldate(date,'%Y%0V'); b=nldate(date,'%Y%0W');&lt;BR /&gt;
79    put date= a= b=;&lt;BR /&gt;
80   run;&lt;BR /&gt;
&lt;BR /&gt;
date=2014-03-20 a=201412 b=201411&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Mon, 16 May 2011 06:20:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55834#M11894</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-05-16T06:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Picture formats: date/datetime directives</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55835#M11895</link>
      <description>Hi Ksharp&lt;BR /&gt;
Weird! &lt;BR /&gt;
So these directives are implemented somehow but work different than the other ones. &lt;BR /&gt;
Good to know though.&lt;BR /&gt;
Thanks&lt;BR /&gt;
Patrick</description>
      <pubDate>Mon, 16 May 2011 08:32:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55835#M11895</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2011-05-16T08:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Picture formats: date/datetime directives</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55836#M11896</link>
      <description>looks like a "feature" to be dealt with or removed</description>
      <pubDate>Mon, 16 May 2011 17:58:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Picture-formats-date-datetime-directives/m-p/55836#M11896</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-05-16T17:58:49Z</dc:date>
    </item>
  </channel>
</rss>

