DATA Step, Macro, Functions and more

Date Problems in SAS 9.3

Accepted Solution Solved
Reply
Super Contributor
Posts: 358
Accepted Solution

Date Problems in SAS 9.3

Hi All:

We are testing our code in SAS 9.3 and I have run across something odd.

We read a date and time field from an external pipe-delimited file using ANYDTDTM and the behaviour has changed since version 9.1. with:

            attrib  OpenDT    length=8.     format=datetime18.  informat=anydtdtm17.;

In 9.1 - using ANYDTDTM17.  and reading "02/04/09 08:48:11"  returns 04FEB09 08:48:11,

in 9.3 - you get 02APR09 08:48:11

so the 9.1 version reads the date part of the data as MM/DD/YY and the 9.3 version reads it as DD/MM/YY.

1) Is there an alternative date-time format that I can use to read my data (without significant program changes)?

2) Can I modify the behaviour of the ANYDTDTM in any wat to tell it how to read the data?

3) Am I just going to have to read the field in as TEST and parse it?

4) Should I just ignore it and hope it changes back in the next version?

Thanks in advance.


Accepted Solutions
Solution
‎04-03-2012 01:29 PM
Super Contributor
Posts: 358

Date Problems in SAS 9.3


Here I go answering my own question -

SAS (in their infinite wisdom) added an option to control the format of the date when used this way as of version 9.2

OPTION DATESTYLE=MDY;

refer to: http://support.sas.com/kb/35/412.html

View solution in original post


All Replies
Solution
‎04-03-2012 01:29 PM
Super Contributor
Posts: 358

Date Problems in SAS 9.3


Here I go answering my own question -

SAS (in their infinite wisdom) added an option to control the format of the date when used this way as of version 9.2

OPTION DATESTYLE=MDY;

refer to: http://support.sas.com/kb/35/412.html

🔒 This topic is solved and locked.

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

Discussion stats
  • 1 reply
  • 193 views
  • 0 likes
  • 1 in conversation