@SASdevAnneMarie wrote:
Hello Experts,
I would like to display my data as 2025100513 (yyyymmddtt). My code seems do not work and I can not find the right format here : SAS Help Center: Working with Dates and Times By Using the ISO 8601 Basic and Extended Notations.
I have this error message : ERROR: Format name B8601DT10.0 not found or the width and/or decimal specified for the format used are out of range. Thank you for your help.
This my code :
%let Ma_Date=%sysfunc(compress(%sysfunc(datetime(),B8601DT10.0),T));
It is telling you that the format you have chosen is not wide enough. B8501DT must have a width of between 15 and 26. So this works:
%let Ma_Date=%sysfunc(putn(%sysfunc(datetime()),B8601DT15.0));
%put &=ma_date;
If you don't want the minutes and seconds in the output, you can use the %substr function to chop off the last 4 unwanted digits.
... View more