Hello, SAS Gurus! Could you please help me? First, I couldn’t understand what this (given, not mine) piece of code accomplishes. I got an explanation that the goal was to delete previous observations of time series until the beginning of the series for that case_nbr. Let’s say, we are talking about 2022, January to September. The variable reason can be either a character, like “P” or “22” or blank. We do not like blanks and try to find the original reason as of January 2022. If it’s not there, we’d rather start the series with the first record of non-blank reason, even if that’s August 2022. /* I am not sure what this thing does... */ data want ; do _n_= 0 by 0 until(last.case_nbr) ; set W ; by case_nbr ; if reason ne '' then _n_ = 1 ; if _n_ then output ; end; run; I have seen and used: If first.var If last.var Do while Do until Do _n_ = 1 by 1 until(eof) and so on. But never do _n_= 0 by 0 until(last.var ) ;
... View more