Help using Base SAS procedures

convert ddmonyy:hh:mm:ss.ss to mmyyyy

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 16
Accepted Solution

convert ddmonyy:hh:mm:ss.ss to mmyyyy

Hello,

on my dataset I have a column in date format such as "12Sep07:0:0:0" and I want to convert this in to "Sep07" I tried put(mmyyyyp8.) and another variations but without success.

Do you have any idea how to convert this variable?

Many thanks!

Daniela


Accepted Solutions
Solution
‎01-24-2013 12:02 PM
Super Contributor
Posts: 543

Re: convert ddmonyy:hh:mm:ss.ss to mmyyyy

How about this,Daniela?

data temp;

    date = '12Sep07:00:00:00'dt;*your date;

    date_1 = put(datepart(date),monyy.);*your desired date;

run;

Good luck.

Anca.

View solution in original post


All Replies
Solution
‎01-24-2013 12:02 PM
Super Contributor
Posts: 543

Re: convert ddmonyy:hh:mm:ss.ss to mmyyyy

How about this,Daniela?

data temp;

    date = '12Sep07:00:00:00'dt;*your date;

    date_1 = put(datepart(date),monyy.);*your desired date;

run;

Good luck.

Anca.

Occasional Contributor
Posts: 16

Re: convert ddmonyy:hh:mm:ss.ss to mmyyyy

Hello Anca,

it worked! Tahnk you very much. Smiley Wink

Kind regards,

Daniela

Super Contributor
Posts: 543

Re: convert ddmonyy:hh:mm:ss.ss to mmyyyy

Great,Daniela.

Would you mark it as answered Smiley Happy

☑ This topic is solved.

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

Discussion stats
  • 3 replies
  • 214 views
  • 2 likes
  • 2 in conversation