Leonid,

Very useful information. I presented similar concepts of INTNX a my last PROC FORMAT presentation, "Using User Defined FORMATS and the INTNX Date Function to Extract LAGS and LEADS" at the Philadelphia SAS Users Group (PhilaSUG) Spring 2019 meeting. I got to learn more about PROC FCMP that you mentioned in this useful post.

My presentation can be found at these 2 links:
https://jonasbilenascom.wpcomstaging.com/wp-content/uploads/2019/06/Format_Leads_Lags.pdf
http://philasug.org/Presentations/201906/Jonas_Format_Leads_Lags.pdf

Thanks,

Jonas V. Bilenas