BookmarkSubscribeRSS Feed
fabdu92
Obsidian | Level 7

Hi,

 

I have a table t1 with two dates d1 and d2. I need to have the year difference in decimals (2decimals).

I do:

 

format yr 15.2;
yr= INTCK('month',d1, d2)/12;

 

 

Following this, I join with another table t2 on the number of years (with two decimals).

But it can't match except when the year t1 has  decimals like

*.00

*.25

*.50

*.75

 

It doesn't want to match when it is decimals like

*.08

*.17

*.33

*.42

*.58

*.67

*.83

*.92

 

The common points of all is they are rounded to the second decimal calculations (*.33 is in fact *.33333333... whereas for table t2 it is truely *.33)

 

Do you know what I have to do in order to match them?

 

Thanks for answer.

1 REPLY 1

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1101 views
  • 2 likes
  • 2 in conversation