DATA Step, Macro, Functions and more

date in numeric to char

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 115
Accepted Solution

date in numeric to char

in my dataset i have dates which are like 

2005-09-16T13:30

2005-09-23

2005-09-30

 

in these i want to remove iso date and keep as yymmdd10. format.

i used the below code but

exstdtc1= input(exstdtc,yymmdd10.);

format exstdtc1 yymmdd10.;

I get the correct format but it is numeric. how to make it in character


Accepted Solutions
Solution
‎11-10-2016 07:49 AM
Super User
Posts: 5,080

Re: date in numeric to char

You are probably better off leaving it numeric.  But you can make it character:

 

exstdtc1= put( input(exstdtc,yymmdd10.), yymmdd10.);

View solution in original post


All Replies
Solution
‎11-10-2016 07:49 AM
Super User
Posts: 5,080

Re: date in numeric to char

You are probably better off leaving it numeric.  But you can make it character:

 

exstdtc1= put( input(exstdtc,yymmdd10.), yymmdd10.);

☑ This topic is SOLVED.

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

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