DATA Step, Macro, Functions and more

SAS DATE CONVERSION QUERY

Accepted Solution Solved
Reply
Contributor scb
Contributor
Posts: 50
Accepted Solution

SAS DATE CONVERSION QUERY

May I know how to convert the data to date9. format? Thanks.

Attachment

Accepted Solutions
Solution
‎03-15-2017 06:55 AM
Super User
Super User
Posts: 7,411

Re: SAS DATE CONVERSION QUERY

Post data, in the form of a datastep, in a code window ({i} above your post).  I will not download files.

If your data is character which is probable, then you input() the data with the approriate format:

e.g. if you have 01-04-2016

datevar=input(chardate,ddmmyy10.);
format datevar date9.;

 

View solution in original post


All Replies
Solution
‎03-15-2017 06:55 AM
Super User
Super User
Posts: 7,411

Re: SAS DATE CONVERSION QUERY

Post data, in the form of a datastep, in a code window ({i} above your post).  I will not download files.

If your data is character which is probable, then you input() the data with the approriate format:

e.g. if you have 01-04-2016

datevar=input(chardate,ddmmyy10.);
format datevar date9.;

 

☑ This topic is SOLVED.

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

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