Hi, I am new to sas array and loops. I was wondering if someone can help me with my query. Please find below sample of my dataset. Basically I want to output only those rows where the difference betweeen reportdate of 2 records is more than 8. so for example fromw below records - i would want to output row1, row4, row5,.....so on i was looking at writing something like below - but its not working. I want a way to tell that reportdate of observation _n_ is.... data chk; set test; array reportarray {1}ReportDate ; do until (EndofFile); Daysdiff = reportarray[i+1] - reportarray; if Daysdiff > 8 then output; end; run; Record ReportDate AcctNumber 1 07/06/09 ABC123456 2 13/06/09 ABC123456 3 21/06/09 ABC123456 4 28/06/09 ABC123456 5 02/03/10 ABC123456 6 07/03/10 ABC123456 7 30/04/10 ABC123456 8 02/05/10 ABC123456 9 30/06/10 ABC123456 10 04/07/10 ABC123456 11 11/07/10 ABC123456 12 18/07/10 ABC123456 13 30/09/10 ABC123456 14 03/10/10 ABC123456 15 30/04/11 ABC123456 16 01/05/11 ABC123456 17 30/07/11 ABC123456 18 31/07/11 ABC123456 19 13/06/09 DEF567890 20 21/06/09 DEF567890 21 28/06/09 DEF567890 22 05/07/09 DEF567890 23 02/02/10 DEF567890 24 09/02/10 DEF567890 25 16/02/10 DEF567890
... View more