I have a dataset and want it to show where the prior end of period becomes the current beginning of period. An example is indicated below: Date BOP EOP 1/31/2022 1000 1500 2/28/2022 1500 2000 3/31/2022 2000 2300 4/30/222 2300 2100 I want to avoid creating two different tables of data. I want the data to show say EOP 1/31/2022 $1500 and the same $1500 begins for end of period 2/28/2022 and in that order as shown above. Is there a way to go about it? Here is the SAS code I am currently working with Libname ***
Libname MYLIB Base ***
%let end_date_beg = %str(%')%sysfunc(intnx(year,%sysfunc(date( )),-1,E),mmddyy10.)%str(%');
%let end_date_ending = %str(%')%sysfunc(intnx(month,%sysfunc(date( )),-1,E),mmddyy10.)%str(%');
%PUT NOTE: end_date_begin is &end_date_beg;
%PUT NOTE: end_date_ending is &end_date_end;
proc sql;
create table MYLIB.Data as
select * from ***
(
SELECT DISTINCT
table1.client_id,
table2.contract_id,
table3.plan_type,
WHERE
table4.status_cd='I'
AND table5.change_dt <= &end_date_beg.
AND table5.next_change_dt > &end_date_beg.
;
);
quit; How do I modify the date to reflect the point-in-time as explained above?
... View more