Help using Base SAS procedures

Convert string date to a different string date

Reply
Contributor
Posts: 22

Convert string date to a different string date

Hi ~,

Could someone help me to convert "August 15, 2010" into "08/15/10"?

Thanks for your help.

Lani
Super Contributor
Posts: 394

Re: Convert string date to a different string date

[pre]
data _null_;
indate = "August 15, 2010";
outdate = PUT(INPUT(indate, ANYDTDTE15.), MMDDYY8.) ;
put indate= outdate=;
run;
[/pre]

Yields:
[pre]
indate=August 15, 2010 outdate=08/15/10
[/pre]
Contributor
Posts: 22

Re: Convert string date to a different string date

Tim,

Thanks a lot!

Lani
Ask a Question
Discussion stats
  • 2 replies
  • 337 views
  • 0 likes
  • 2 in conversation