Hi Barry, This is the full data set code.. " DATA BQDATA.VBELTQUOTES(DROP=ERROR) BQDATA.VBELTERRORS; LENGTH ERROR $ 25; SET BQDATA.VBELTQUOTES; BY PRODNO CPNP PLANT PARTNO COST_YEAR; DROP T COST_YEAR CREATE_DATE UPDATE_DATE CLASS_EFFECTIVE_DATE QUOTE_EFFECTIVE_DATE; IF NOT FIRST.CPNP AND LAST.CPNP AND PLANT='USM' THEN DELETE; ...... ...... .... RUN; " I thought this might help you to understand... All I understood is that "BY PRODNO CPNP PLANT PARTNO COST_YEAR;" these 5 columns in By clause so for group of these 5 columns will have two set of values with same CPNP then it will delete second records.. In most cases I have CPNP value NULL.. If possible then can you reply me with example with random values that which records it will delete and which records will not.. Please... Thanks Again in advance...
... View more