Hi @qoit
It works, finally. Just one more cocern.
So based on this code
%if &&bdate_type&i.=C %then
%do;
if length(&var2del)=5 and upcase(&var2del) ne 'NA' then
SASDATE = input(&var2del,32.)+'30DEC1899'd;
else SASDATE= input(&var2del,anydtdte32.);
%end;
it means that if &&bdate_type&i.=C and upcase(&var2del) = 'NA', the code
SASDATE= input(&var2del,anydtdte32.)
will generate a missing observation and the log will perform
Missing values were generated as a result of performing an operation on missing values.
when you process
format SASDATE yymmdd10.;
if not missing(sasdate) and year(SASDATE) ne 2021 then
fir_age = log(1+(2020-year(SASDATE)));
Am I correct?
I just want to make sure that such a log is not an error in this situation.
Hi @qoit
Thank you for your prompt reply.
I did change as you suggest, but it still exit the note "Missing values were generated as a result of performing an operation on missing values."
I mean, the character variable BDATE does not have missing values, it is just because the code
SASDATE= input(&var2del,anydtdte32.)
will force the BDATE which has value "NA" will receive the "."
And then, the code
format SASDATE yymmdd10.;
if not missing(sasdate) and year(SASDATE) ne 2021 then
fir_age = log(1+(2020-year(SASDATE)));
will cause the note" Missing values were generated as a result of performing an operation on missing values."
It is my explanation, does it make sense or I am in another fallacy?
Warmest regards.
Hi @qoit
Thank you for such an interesting discussion! I get it now.
Many thanks and have a good day.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.