Help using Base SAS procedures

Format date to date format

Accepted Solution Solved
Reply
Regular Contributor
Posts: 240
Accepted Solution

Format date to date format

I'm need to convert a col that should be date..

Date

0929

1014

1015

I would need to convert the date. to format

Date

09/29/14

10/14/14

10/15/14

Thank You


Accepted Solutions
Solution
‎10-28-2014 04:48 PM
Trusted Advisor
Posts: 1,204

Re: Format date to date format

data have;

input date $;

new_date=mdy(substr(date,1,2),substr(date,3,4),2014);

format new_date MMDDYY.;

datalines;

0929

1014

1015

;

View solution in original post


All Replies
Solution
‎10-28-2014 04:48 PM
Trusted Advisor
Posts: 1,204

Re: Format date to date format

data have;

input date $;

new_date=mdy(substr(date,1,2),substr(date,3,4),2014);

format new_date MMDDYY.;

datalines;

0929

1014

1015

;

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 194 views
  • 0 likes
  • 2 in conversation