We couldn't reproduce your error with the lag operator.
--begin log--
. sysuse auto,clear
(1978 Automobile Data)
. generate time = _n
. tsset for time
       panel variable:  foreign (unbalanced)
        time variable:  time, 1 to 74
                delta:  1 unit
. sort for time
. replace rep=l.rep if rep==. & l.rep != .
(5 real changes made)
--end of log--
Could you send [email protected] a dataset and do-file that reproduces this
error so that we can diagnose this problem?
-Kerry Kammire
 [email protected]
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/