@Gieorgie wrote:
I have a function that should define the current date in the table for the day
%let gv_date_dly=%sysevalf(%bquote('&date_dly.'d));
%let y=%sysfunc(year(&gv_date_dly.),z4.);
%let m=%sysfunc(month(&gv_date_dly.),z2.);
%let d=%sysfunc(day(&gv_date_dly.),z2.);
%let gv_tbl_date=%eval(%str(&y&m&d));
However, the table shows me such a date.: How to change to for example to 2021-08-31 ?
And how do you expect to use that GV_TABL_Date value? If you want to use it to select or compare with date values you want an actual date value, not a string of numbers that a human might interpret as date.
The actual numeric date value for 31 August 2021 is 22523. That would be the basis for comparison or manipulating using any of the date related functions. You can't even make 2021-08-31 into a date value easily.You would have to parse the parts and stick them into the MDY function.
If your dates are numeric and formatted to look like 2021-08-31 you still want the numeric underlying value, not the formatted text for most things. About the only time to format a macro variable with date information is for use in Title, Footnote, text for people to read, or file/dataset names.
... View more