2
 options date/nodate;

This option has no effect on my html output but it works fine on listing output. Also explain how to print date time on html output same like listing output?

    /*----prints date in the upper right side of the output------*/
    options dtreset date;
    ods listing;
    Title; /*I dont want to print any title*/
    proc print data=sashelp.class;
    run;
    ods listing close;

    /*----for html ods, date is not printed----------------------*/
    options dtreset date;
    ods html;
    Title; /*I dont want to print any title*/
    proc print data=sashelp.class; 
    run;
    ods html close;
2
  • Can you post an example program that causes the issue? Perhaps using SASHELP.CLASS or some other dataset that everyone should have?
    – Tom
    Nov 30, 2015 at 13:19
  • @Tom added code as you have requested
    – mac_21
    Dec 2, 2015 at 7:38

1 Answer 1

2

Working as designed; according to the documentation:

Note: In an interactive SAS session, the date and time are noted only in the output window.

Output window means the listing destination, by the way (separate from the Results Window which is where modern ODS destinations, including HTML, go).

If you want it in HTML, you'll need to add it to the title:

title "(other things) &sysdate.";

Or &Sysdate9. if you prefer that format.

Some other ways to do this are discussed in Art Carpenter's Placing Dates in Your Titles.

3
  • Is there any way to print the date same as printed in listing output to html output with no use of title statements?
    – mac_21
    Dec 2, 2015 at 7:41
  • Perhaps you can add an ODS TEXT statement to write the data/time?
    – Tom
    Dec 2, 2015 at 18:11
  • If you mean as a page header - no, because ODS HTML doesn't have pages. Other destinations (PDF, RTF) do have page header capabilities. Or, yes, ODS TEXT statements or similar if you want to just place it on the page without using the TITLE statement, but I don't see them as being sufficiently different to matter, unless you're repeating something across multiple pages (which again isn't possible on HTML).
    – Joe
    Dec 2, 2015 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.