Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

sas

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;
like image 937
Binnnnn5 Avatar asked Oct 18 '25 01:10

Binnnnn5


1 Answers

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;
like image 181
Alexey Sigida Avatar answered Oct 21 '25 23:10

Alexey Sigida



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!