<?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: want to add a date to my ODS HTML text in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19819#M3070</link>
    <description>Apparently more unclear Tim&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
%global datim= %sysfunc(compress(%sysfunc(datetime(),IS8601DT.), -:));&lt;BR /&gt;
%global dati = datetime();&lt;BR /&gt;
%put &amp;amp;datim;%put &amp;amp;dati;&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file="d:\temp\PrioLotReport.html" (title="Prio Lot Report") ;&lt;BR /&gt;
ods escapechar='^';&lt;BR /&gt;
/* title */&lt;BR /&gt;
*ods html text="^S={just=c font_size=15pt foreground=black} Prio Lot Report - Last Run on &amp;amp;datim   &amp;amp;dati ^S={}";&lt;BR /&gt;
ods html text="Prior Lot Report - Last Run on  %sysfunc(datetime())  &amp;amp;sysdate &lt;BR /&gt;
&amp;amp;datim   &amp;amp;dati ";&lt;BR /&gt;
proc print data=sashelp.class(obs=1);run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Is it  more specifically a problem of how the  ods clothing  is working and &lt;BR /&gt;
 WHEN is it passing the chain to the ods construct ?&lt;BR /&gt;
&lt;BR /&gt;
In my test   the direct datetime and sysdate  are resolved    but not the macros variables&lt;BR /&gt;
&lt;BR /&gt;
Andre</description>
    <pubDate>Wed, 02 Mar 2011 13:41:25 GMT</pubDate>
    <dc:creator>Andre</dc:creator>
    <dc:date>2011-03-02T13:41:25Z</dc:date>
    <item>
      <title>want to add a date to my ODS HTML text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19817#M3068</link>
      <description>%global datim = datetime();&lt;BR /&gt;
%put &amp;amp;datim;&lt;BR /&gt;
ods html file="/imec/other/imecweb/osp/fab300/test/shift_reports/PrioLotReport.html" (title="Prio Lot Report") stylesheet=(URL="http://imecwww.imec.be/~osp/fab300/test/ImecStyle.css");&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods escapechar='^';&lt;BR /&gt;
/* title */&lt;BR /&gt;
ods html text='^S={just=c font_size=15pt foreground=black} Prio Lot Report - Last Run on &amp;amp;datim ^S={}';&lt;BR /&gt;
&lt;BR /&gt;
but &amp;amp;datim shows as &amp;amp;datim, any solutions?</description>
      <pubDate>Wed, 02 Mar 2011 11:14:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19817#M3068</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2011-03-02T11:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: want to add a date to my ODS HTML text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19818#M3069</link>
      <description>Enclose the text in quotes instead of apostrophes. SAS does not resolve macro variables within apostrophes.</description>
      <pubDate>Wed, 02 Mar 2011 13:20:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19818#M3069</guid>
      <dc:creator>Tim_SAS</dc:creator>
      <dc:date>2011-03-02T13:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: want to add a date to my ODS HTML text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19819#M3070</link>
      <description>Apparently more unclear Tim&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
%global datim= %sysfunc(compress(%sysfunc(datetime(),IS8601DT.), -:));&lt;BR /&gt;
%global dati = datetime();&lt;BR /&gt;
%put &amp;amp;datim;%put &amp;amp;dati;&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file="d:\temp\PrioLotReport.html" (title="Prio Lot Report") ;&lt;BR /&gt;
ods escapechar='^';&lt;BR /&gt;
/* title */&lt;BR /&gt;
*ods html text="^S={just=c font_size=15pt foreground=black} Prio Lot Report - Last Run on &amp;amp;datim   &amp;amp;dati ^S={}";&lt;BR /&gt;
ods html text="Prior Lot Report - Last Run on  %sysfunc(datetime())  &amp;amp;sysdate &lt;BR /&gt;
&amp;amp;datim   &amp;amp;dati ";&lt;BR /&gt;
proc print data=sashelp.class(obs=1);run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Is it  more specifically a problem of how the  ods clothing  is working and &lt;BR /&gt;
 WHEN is it passing the chain to the ods construct ?&lt;BR /&gt;
&lt;BR /&gt;
In my test   the direct datetime and sysdate  are resolved    but not the macros variables&lt;BR /&gt;
&lt;BR /&gt;
Andre</description>
      <pubDate>Wed, 02 Mar 2011 13:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19819#M3070</guid>
      <dc:creator>Andre</dc:creator>
      <dc:date>2011-03-02T13:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: want to add a date to my ODS HTML text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19820#M3071</link>
      <description>The ODS statement is no different than any other statement. The macro processor runs before the ODS statement is executed. The ODS statement gets the text that the macro processor produced. I ran your test:&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
%global datim;&lt;BR /&gt;
%let datim = %sysfunc(compress(%sysfunc(datetime(),IS8601DT.), -:));&lt;BR /&gt;
%global dati;&lt;BR /&gt;
%let dati = datetime();&lt;BR /&gt;
%put &amp;amp;datim;%put &amp;amp;dati;&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
ods html file="PrioLotReport.html" (title="Prio Lot Report") ;&lt;BR /&gt;
ods escapechar='^';&lt;BR /&gt;
/* title */&lt;BR /&gt;
*ods html text="^S={just=c font_size=15pt foreground=black} Prio Lot Report - Last Run on &amp;amp;datim   &amp;amp;dati ^S={}";&lt;BR /&gt;
ods html text="Prior Lot Report - Last Run on  %sysfunc(datetime())  &amp;amp;sysdate &amp;amp;datim   &amp;amp;dati ";&lt;BR /&gt;
proc print data=sashelp.class(obs=1);run;&lt;BR /&gt;
ods html close;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
The text in the HTML file is:&lt;BR /&gt;
Prior Lot Report - Last Run on 1614686110.021 02MAR11 20110302T115509 datetime()</description>
      <pubDate>Wed, 02 Mar 2011 17:01:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19820#M3071</guid>
      <dc:creator>Tim_SAS</dc:creator>
      <dc:date>2011-03-02T17:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: want to add a date to my ODS HTML text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19821#M3072</link>
      <description>You are right, Tim&lt;BR /&gt;
I think i was perhaps opening the wrong html file on my pc without reading carefully the log.&lt;BR /&gt;
In fact rereading the code&lt;BR /&gt;
i reproduce  the problem i have encounter&lt;BR /&gt;
when based too quickly upon the initial %global statement&lt;BR /&gt;
i did not apply the correct syntax&lt;BR /&gt;
%global datim; for defining the status of a macro variable&lt;BR /&gt;
and then only after &lt;BR /&gt;
%let datim= &lt;BR /&gt;
with the definition of the content.&lt;BR /&gt;
%global datim=  genders errors in the log &lt;BR /&gt;
Sorry &lt;BR /&gt;
Andre

Message was edited by: Andre</description>
      <pubDate>Wed, 02 Mar 2011 17:20:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19821#M3072</guid>
      <dc:creator>Andre</dc:creator>
      <dc:date>2011-03-02T17:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: want to add a date to my ODS HTML text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19822#M3073</link>
      <description>thanks, it is working</description>
      <pubDate>Fri, 04 Mar 2011 07:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19822#M3073</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2011-03-04T07:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: want to add a date to my ODS HTML text</title>
      <link>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19823#M3074</link>
      <description>&amp;gt; %global datim = datetime();&lt;BR /&gt;
 &lt;BR /&gt;
is this expecting %global to assign a value?&lt;BR /&gt;
sorry, it doesn't work that way.&lt;BR /&gt;
the above syntax generates an ERROR: pointing to the '=' in my SAS9.2&lt;BR /&gt;
 &lt;BR /&gt;
you need %LET datim = something ;</description>
      <pubDate>Sat, 05 Mar 2011 16:39:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/want-to-add-a-date-to-my-ODS-HTML-text/m-p/19823#M3074</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-03-05T16:39:31Z</dc:date>
    </item>
  </channel>
</rss>

