Binnnnn5
Binnnnn5

Reputation: 187

How can I show the date in the format of date9 in this SQL process?

After I run this SAS SQL process. The date variable "EXVISDAT" showed in the results in a numerical way. How can I change the code to let the date variable "EXVISDAT" show in format of "date9."?

proc sql;
    create table test2 as
    select VISIT, Targetdays, Targetdays + '01JUL2019'd - 1 as EXVISDAT
    from data_in.chrono_visits_lts14424
    order by Targetdays
    ;
quit;

Upvotes: 4

Views: 6148

Answers (1)

Llex
Llex

Reputation: 1770

You can read about it in documentation.

In yours case, query will look like:

proc sql;
    create table test2 as
    select VISIT, Targetdays, Targetdays + '01JUL2019'd - 1 as EXVISDAT format=date9.
    from data_in.chrono_visits_lts14424
    order by Targetdays
    ;
quit;

Upvotes: 3

Related Questions