While @Reeza 's answer is the right first step, there are pitfalls galore here. You should have an experienced macros programmer available if the results are not satisfactory. Here are some issues to consider.
First (a minor issue that you could ignore), why is there any need to create a data set S? Why not use data _NULL_ and forget about the OUTPUT statement?
Second, the value being fed to the macro is not a date literal. It is the integer equivalent on SAS's date scale. That may turn out fine, or it may not. For example, if the value of the date is being printed in a title, the results may be need tweaking.
Third, executing a macro with CALL EXECUTE has its own set of pitfalls. If %SMART contains any macro programming statements such as %LET or %DO, the results will be less than smart. The usual fix is to modify the CALL EXECUTE statement, adding %NRSTR. But first, see if the problem is solved. It might be.
... View more