Sounds like you want use the value of macro variable to construct a filename?
So if your macro variable has the value 21074 and you want to interpret that as a date and generate a human readable string that you could include as part of the filename you need to use a FORMAT. I would recommend either YYMMDDD10. (2017-09-12) or YYMMDDN8. (20170912) so that your resulting filenames will sort in chronological order.
Perhaps you can apply the format earlier so that the macro variable already looks like the string you want. Or else use the %SYSFUNC() to call the PUTN() function to apply the format to the value.
%let date=21074;
%let filename=filename_%sysfunc(putn(&date,yymmddn8.)).xlsx;
proc export file="&filename" ....