DATA Step, Macro, Functions and more

Formatting dates

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Formatting dates

I have partial date values in the format yyyy-mm in a variable and I have to change it to mmmyyyy format.

Kindly suggest your solutions


Accepted Solutions
Solution
‎03-21-2018 07:57 AM
Super User
Posts: 10,555

Re: Formatting dates

Posted in reply to jayaprakash

Add a -01 to the short strings, so you get a complete date, and then do a put(input)) with the proper formats.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code

View solution in original post


All Replies
Solution
‎03-21-2018 07:57 AM
Super User
Posts: 10,555

Re: Formatting dates

Posted in reply to jayaprakash

Add a -01 to the short strings, so you get a complete date, and then do a put(input)) with the proper formats.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
☑ This topic is solved.

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

Discussion stats
  • 1 reply
  • 100 views
  • 2 likes
  • 2 in conversation