change chracter to yymmdd10.

i have date which is Chracter 10 in format 20101107155504 i want it to be converted to YYMMDD10.
sam2929Asked:
Who is Participating?
 
Aloysius LowConnect With a Mentor Commented:
you could do something like:

data x;
org_value = '20101107155504';
date_only = input(substr(org_value, 1, 8), yymmdd8.);
format date_only yymmdd10.;
run;
0
 
DiaphanosomaCommented:
Do you have a datetime as a character?

data new; set old;
date_time  = input(char_date_time, datetime18.);
date= datepart(date_time);
format date  yymmdd10.;
run;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.