<!-- m --><a class="postlink" href="http://support.sas.com/documentation/cdl/en/lrdict/59540/HTML/default/a000212547.htm">http://support.sas.com/documentation/cd ... 212547.htm</a><!-- m -->
<!-- m --><a class="postlink" href="http://support.sas.com/documentation/cdl/en/etsug/60372/HTML/default/etsug_tsdata_sect048.htm">http://support.sas.com/documentation/cd ... ect048.htm</a><!-- m -->
<!-- m --><a class="postlink" href="http://support.sas.com/forums/thread.jspa?messageID=11673&#11673">http://support.sas.com/forums/thread.js ... 673&#11673</a><!-- m -->
Example:
[code:9r9ctlh0]
data test ;
input x @@;
y1=lag(x);
y2=1;
y3+1;
if y1>0 then z1=y1;
if y1>0 then z2=lag(x);
if y2>0 then z3=lag(x);
if lag(x)>0 then z4=y1;
if lag(x)>0 then z5=lag(x);
if y3 in(1,2,5,6) then z6=lag(x);