DATA Step, Macro, Functions and more

Formatting date values

Accepted Solution Solved
Reply
Contributor
Posts: 65
Accepted Solution

Formatting date values

[ Edited ]

Hi I have the following data

 

dates

20170101

20160101

20150101

 

  I need the out as

 

17-01-01

16-01-01

15-01-01

 

 

 


Accepted Solutions
Solution
‎03-13-2017 05:28 AM
Super User
Posts: 7,809

Re: Formatting date values

Please post the code you already have, and I'll help you in correcting that code if it contains errors.


molla wrote:

can u pls provide with complete code

 


 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers

View solution in original post


All Replies
Super User
Posts: 7,809

Re: Formatting date values

[ Edited ]

Format the date variable with yymmddd8.

If you do not yet have a SAS date variable, but a character variable, convert first with numdate=input(chardate,yymmdd8.);

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 65

Re: Formatting date values

Posted in reply to KurtBremser

can u pls provide with complete code

 

Solution
‎03-13-2017 05:28 AM
Super User
Posts: 7,809

Re: Formatting date values

Please post the code you already have, and I'll help you in correcting that code if it contains errors.


molla wrote:

can u pls provide with complete code

 


 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
☑ This topic is solved.

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

Discussion stats
  • 3 replies
  • 194 views
  • 0 likes
  • 2 in conversation