Question

quick question here.

How could I adapt this code so that it would work with %let DTD=2012-12-31;

%let DTD=31-DEC-2013;

DATA _Null_;
dd="&DTD"d;
put dd;
RUN;

Then dd has a value of 19723. Thanks in advance !

Was it helpful?

Solution

You would have to use INPUT instead of "&var"d;

dd = input("&DTD",yymmdd10.);

Now, hopefully you wouldn't use 2012-12-32, since that's not a real date. :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top