• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 604
  • Last Modified:

change chracter to yymmdd10.

i have date which is Chracter 10 in format 20101107155504 i want it to be converted to YYMMDD10.
0
sam2929
Asked:
sam2929
1 Solution
 
Aloysius LowCommented:
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

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now