BookmarkSubscribeRSS Feed
SeekYourWay
Calcite | Level 5

Hi there,

I'm trying to add a new date variable to a SAS data set.

While the code does run, the output is incorrect. I keep getting dates that are like in 1950s.

Is anybody able to assist?

code is:

A1 is another date column in the dataset.

Thanks

3 REPLIES 3
ballardw
Super User

Did you assign a date format such as mmddyy10. to the new variables? The integer values stored for dates in the third calendar quarter of 2011 (guessing from your dataset name) would be 18901 to 18993.

What results are you getting?

Haikuo
Onyx | Level 15

if the format year part of your date is in 2 digits, you may want to check out your cut off date, then adjust it accordingly.

proc options option=yearcutoff;

run;

     

Haikuo

Ksharp
Super User

I noticed you used 

.

Do you come from JAVA Forum at Oracle.com ? I also am there for a couple of days.

Now Focus on your question.

You did give us sample data and result you want.So just guess it.

your code

Start_Date=A1;

End_Date=Start_Date;

which means start_date and end_date both equal to A1, do you want it ?

Or you should change the order of these .

End_Date=Start_Date;

Start_Date=A1;

about '1950' , you can use some format or function year(A1) to get it .

Good Luck.

Ksharp

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 776 views
  • 0 likes
  • 4 in conversation