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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.