Help using Base SAS procedures

Character Year-Mon to Number Mon-Year

Accepted Solution Solved
Reply
Contributor
Posts: 34
Accepted Solution

Character Year-Mon to Number Mon-Year

Hi all,

Could you please let me know how to convert character year-month to number MonYear.  The sample data below.

Pt No.          date_have(character)          Date_need(numberic)

1001               2001-10                              OCT2001

1002               2010-08                              AUG2010

1003               2009-01                              JAN2009

Thanks in advance


Accepted Solutions
Solution
‎07-14-2014 11:55 AM
Super Contributor
Posts: 275

Re: Character Year-Mon to Number Mon-Year

data want;
  set have;
  date_need=input(date_have,anydtdte7.);
  format date_need monyy7.;
  run;

View solution in original post


All Replies
Solution
‎07-14-2014 11:55 AM
Super Contributor
Posts: 275

Re: Character Year-Mon to Number Mon-Year

data want;
  set have;
  date_need=input(date_have,anydtdte7.);
  format date_need monyy7.;
  run;

🔒 This topic is solved and locked.

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

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