05-10-2018 09:52 AM
I have a SAS data set which contains 3 variables and 300 obs. Name of variables are Tarih, K1 and K2. Tarih variable is actually dates of data on weekly basis. Well, I wanna create a new SAS data set which includes last 13 weeks when I run the code every times. How can I do that?
05-10-2018 10:15 AM - edited 05-10-2018 10:31 AM
data want; set have; if tarih>=intnx('week',today(),-13,'s'); /* ALTERNATIVE: if tarih >= today()-13*7; */ run;
05-18-2018 08:02 AM
05-18-2018 08:15 AM
Thank you but it did not work. "Tarih" variable is stored as numeric variable. For example; 20180511(yyyymmdd). Should I convert it date format or something else?
Show us the SASLOG. Show us other evidence that it did not work.
The code I wrote expects TARIH to be numeric.