The data already exist on the table. It is required to verify of Date of Birth is in correct format. Currently Date of Birth field is in $CHAR10. format. It is not required to fix wrong format cases just identify them. The required format is dd/mm/yyyy. How to retrieve output were below mentioned cases doesn't meet format = dd/mm/yyyy. Thanks in advance.
Sample of data:
1963/12/31
31/12/2007
31/12/2008
31/12/2009
31/12/2010
31/12/2011
31/12/2012
31/12/2013
31/12/2014
31/12/2015
31/12/2016
31/12/2018
?
Hi @vaidas
I suggest that you use the input function, so that SAS try to convert the character value to SAS date value:
data want;
set have;
if input(date, ddmmyy10.) ne . then valid_date = 'Y';
else valid_date = 'N';
run;
Hi @vaidas
I suggest that you use the input function, so that SAS try to convert the character value to SAS date value:
data want;
set have;
if input(date, ddmmyy10.) ne . then valid_date = 'Y';
else valid_date = 'N';
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.