BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
NN
Quartz | Level 8 NN
Quartz | Level 8

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Look up the option yearcutoff

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

View solution in original post

3 REPLIES 3
Reeza
Super User

Look up the option yearcutoff

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

art297
Opal | Level 21

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?

NN
Quartz | Level 8 NN
Quartz | Level 8

Reeza,

Thanks a lot..

Art,

The 01 represented the day.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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