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

My data is imported from a csv file.  In the csv file, I have a date field showing dates in the format, 22/05/39.  When I click on the cell I can see that the date is in reference to the year 2039 but when I import it to SAS, it shows as 1939.  

 

Can anyone help me with a way around this please? 

 

Thanks. 

1 ACCEPTED SOLUTION
6 REPLIES 6
N_C
Calcite | Level 5 N_C
Calcite | Level 5

Thanks, I agree!  I can get around it like that but was hoping there was an alternative solution so that I didn't have to reformat the data every month. 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

On your import program (which you haven't shown us so I can only guess), in the datastep have a line:

date=intnx('year',date,100);

This will move the date's year on 100.  You will have to fix yourself or alter system options as the data is "bad".

N_C
Calcite | Level 5 N_C
Calcite | Level 5

Thanks but I can't do this as my data spans more than 100 years.  I think the only option is to format the data in Excel to show 4 digits as per KurtBremser response. 

 

ballardw
Super User

I hope that you have the correct values. If the file is csv and then opened in Excel and formatting applied sometimes values get "interpretted" by Excel in ways that may not quite be as desired.

 

Note that Excel is likely using a similar approach to the YEARCUTOFF so be careful about saving over your original file.

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
  • 6 replies
  • 2126 views
  • 1 like
  • 4 in conversation