Techniques to Perform the Lead Function Through Data Manipulation

2009 
There are numerous amounts of functions available in SAS® which makes data imputations, data comparison and data manipulation easier for a programmer. Though there are some tasks for which SAS does not have functions readily available for use. One such task is to read next record while working on the current record and at the first thought one can imagine an exact opposite processing of data to LAG function, which can be named as LEAD function. Unfortunately SAS does not offer any such function. But fortunately there are some tricks and techniques which can simulate opposite processing of LAG function and can read next couple of records while still processing current record in the dataset. By little addition of extra piece of code, some of these techniques can also handle cases where processing has to be done by grouping variables. This paper is an effort to list such techniques with examples which are proved to work successfully and can be utilized easily by SAS programmers based on various requirements of their day to day work.
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    0
    References
    0
    Citations
    NaN
    KQI
    []