<?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: Can we use changing dates in proc format? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147376#M262179</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a million!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Feb 2015 15:18:41 GMT</pubDate>
    <dc:creator>wg</dc:creator>
    <dc:date>2015-02-05T15:18:41Z</dc:date>
    <item>
      <title>Can we use changing dates in proc format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147370#M262173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I just want to create a format like below, but always failed . Please let me know if it is feasible&lt;/P&gt;&lt;P&gt;Proc Format;&lt;/P&gt;&lt;P&gt;value week&amp;nbsp; today()-weekday(today())-7)&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp; today()-weekday(today())=week1&lt;/P&gt;&lt;P&gt;&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; today()-weekday(today())-14&amp;nbsp; -&amp;lt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (today()-weekday(today())-7=week2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 21:36:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147370#M262173</guid>
      <dc:creator>wg</dc:creator>
      <dc:date>2015-01-30T21:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use changing dates in proc format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147371#M262174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is something I did a while back that seems similiar to what you are trying to do (see attached).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jan 2015 22:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147371#M262174</guid>
      <dc:creator>Orsini</dc:creator>
      <dc:date>2015-01-30T22:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use changing dates in proc format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147372#M262175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Jan 2015 00:33:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147372#M262175</guid>
      <dc:creator>wg</dc:creator>
      <dc:date>2015-01-31T00:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use changing dates in proc format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147373#M262176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you don't want to have to (re)define the format on the same day that it is used, then you could use a function based format:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc fcmp outlib=sasuser.fcmp.test;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;function weekNo(d) $8;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; t = today();&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if t &amp;gt;= d&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; then return(cats("Week",1+intck("WEEK",d,t,"CONTINUOUS")));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else return("******");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endsub;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;STRONG&gt;options cmplib=sasuser.fcmp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc format;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;value weekNo (min=5 max=8 default=5) other = [weekNo()];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;format d yymmdd10.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;do d = '15JAN2015'd to '05FEB2015'd;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; str = put(d, weekNo5.);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put (d str) (=);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-15 str=Week3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-16 str=Week3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-17 str=Week2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-18 str=Week2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-19 str=Week2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-20 str=Week2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-21 str=Week2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-22 str=Week2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-23 str=Week2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-24 str=Week1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-25 str=Week1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-26 str=Week1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-27 str=Week1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-28 str=Week1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-29 str=Week1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-30 str=Week1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-01-31 str=******&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-02-01 str=******&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-02-02 str=******&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-02-03 str=******&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-02-04 str=******&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-02-05 str=******&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-02-06 str=******&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-02-07 str=******&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-02-08 str=******&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-02-09 str=******&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;d=2015-02-10 str=******&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Jan 2015 02:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147373#M262176</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-01-31T02:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use changing dates in proc format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147374#M262177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 20:51:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147374#M262177</guid>
      <dc:creator>wg</dc:creator>
      <dc:date>2015-02-02T20:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use changing dates in proc format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147375#M262178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The original difficulty arises because the VALUE statement requires literals (not expressions).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the specs change only from one launch of the program to the next (not on the fly within the program). So %sysfunc and %eval offer a workaround. Try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #000080;"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;Format&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;%let&lt;/SPAN&gt; td = &lt;SPAN style="color: #0000ff;"&gt;%sysfunc&lt;/SPAN&gt;( today() ) ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;%let&lt;/SPAN&gt; wd = &lt;SPAN style="color: #0000ff;"&gt;%sysfunc&lt;/SPAN&gt;( weekday(&amp;amp;td.)) ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;value&lt;/SPAN&gt; week &lt;SPAN style="color: #0000ff;"&gt;%eval&lt;/SPAN&gt;(&amp;amp;&lt;SPAN style="color: #008080;"&gt;td.&lt;/SPAN&gt;-&amp;amp;&lt;SPAN style="color: #008080;"&gt;wd.&lt;/SPAN&gt;- &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;7&lt;/STRONG&gt;&lt;/SPAN&gt;) -&amp;lt; &lt;SPAN style="color: #0000ff;"&gt;%eval&lt;/SPAN&gt;(&amp;amp;&lt;SPAN style="color: #008080;"&gt;td.&lt;/SPAN&gt;-&amp;amp;&lt;SPAN style="color: #008080;"&gt;wd.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; ) = week1&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;%eval&lt;/SPAN&gt;(&amp;amp;&lt;SPAN style="color: #008080;"&gt;td.&lt;/SPAN&gt;-&amp;amp;&lt;SPAN style="color: #008080;"&gt;wd.&lt;/SPAN&gt;-&lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;14&lt;/STRONG&gt;&lt;/SPAN&gt;) -&amp;lt; &lt;SPAN style="color: #0000ff;"&gt;%eval&lt;/SPAN&gt;(&amp;amp;&lt;SPAN style="color: #008080;"&gt;td.&lt;/SPAN&gt;-&amp;amp;&lt;SPAN style="color: #008080;"&gt;wd.&lt;/SPAN&gt;- &lt;SPAN style="color: #008080;"&gt;&lt;STRONG&gt;7&lt;/STRONG&gt;&lt;/SPAN&gt;) = week2 ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;%symdel&lt;/SPAN&gt; td wd ;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px; color: #000080;"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Feb 2015 22:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147375#M262178</guid>
      <dc:creator>Howles</dc:creator>
      <dc:date>2015-02-04T22:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can we use changing dates in proc format?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147376#M262179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a million!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Feb 2015 15:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-we-use-changing-dates-in-proc-format/m-p/147376#M262179</guid>
      <dc:creator>wg</dc:creator>
      <dc:date>2015-02-05T15:18:41Z</dc:date>
    </item>
  </channel>
</rss>

