How can I split these dates into mm , yy and dd for full dates and yy, and mm for partial dates? These dates are character values.
feb2010 05mar2010 05jan2010 25jul2010
aug2010
Use SUBSTR() to extract parts of strings, and LENGTH() to determine if a day is present or not.
I tried with ' substr ' funcation , it worked but if we have to change mm, yy and dd into numeric form and create a date format for partial date ,how can we do that?
Please show which values you want to get for each of your example strings.
data want;
date = '05jan2010';
date_num = input(date,date9.);
format date_num ddmmyy10.;
run;
@u52766097 wrote:
jan2010 05mar2010 05jan2010 25jul2010
feb2010 05mar2010 05jan2010 25jul2010
And which separate numeric day, month and year values do you want to get for each of these strings?
And which day of the month needs to be set from an incomplete string?
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!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.