Skip to content
Related Articles

Related Articles

SAS : How to Display Current Date?
  • Last Updated : 30 Jul, 2019

The today() function of SAS programming is basically used to generate current date. The format() function is used to display the format of the date in the specified format.

  1. In DD-MMM-YYYY format:

    Example:

    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    data _null_;
        dt=today();
        format dt yymmdd10.;
        put dt ;
    run;

    chevron_right

    
    

    Output:

  2. In DDMMMYYYY format:

    Example:

    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    data _null_;
        dt=today();
        format dt date9.;
        put dt ;
    run;

    chevron_right

    
    

    Output:

    20JUL2019
  3. In MONTH DD, YYYY format:

    Example:



    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    data _null_;
        dt=today();
        format dt WORDDATE.;
        put dt ;
    run;

    chevron_right

    
    

    Output:

    JULY 20, 2019
  4. In WEEKDAY, MONTH DD, YYYY format:

    Example:

    filter_none

    edit
    close

    play_arrow

    link
    brightness_4
    code

    data _null_;
        dt=today();
        format dt date9.;
        put dt ;
    run;

    chevron_right

    
    

    Output:

    Saturday, July 20, 2019
My Personal Notes arrow_drop_up
Recommended Articles
Page :