Desktop productivity for business analysts and programmers

Informat anydtdte - issue

Accepted Solution Solved
Reply
Regular Contributor
Regular Contributor
Posts: 166
Accepted Solution

Informat anydtdte - issue

Hi,

We are working on a 9.2  - EG installation. i was trying the following code.

data a;

format a date9. b date9.;

a=input('01-Apr-19',anydtdte9.);

b=input('01-Apr-20',anydtdte9.);

run;

the output that i get is

a=01apr2019

b=01apr1920

Why is it that for the first date the year comes as 2019 but for the second date the year comes as 1920. Any suggestions would be helpful.


Accepted Solutions
Solution
‎08-02-2011 03:30 PM
Super User
Posts: 19,157

Informat anydtdte - issue

Look up the option yearcutoff

The default is 1920 which you need to change for your dates.

View solution in original post


All Replies
Solution
‎08-02-2011 03:30 PM
Super User
Posts: 19,157

Informat anydtdte - issue

Look up the option yearcutoff

The default is 1920 which you need to change for your dates.

PROC Star
Posts: 7,434

Informat anydtdte - issue

Reeza already told you about the yearcytoff option for 2-digit years.  Date9. expects DDMMMYY(YY) characters.  In your example was 01 at the beginning representing day or year?

Regular Contributor
Regular Contributor
Posts: 166

Informat anydtdte - issue

Reeza,

Thanks a lot..

Art,

The 01 represented the day.

🔒 This topic is solved and locked.

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

Discussion stats
  • 3 replies
  • 182 views
  • 0 likes
  • 3 in conversation