use bhav_data in 0 alias bhav use bhav_data in 0 alias bhav_data again select bhav_data set order to tag dau max_rec = 0 scan max_rec = max_rec+1 endscan * the next 3 lines of code is run only once while the application starts not always when processing to the fll set order to scan endscan set order to tag pk1 asce select bhav set order to tag dau scan rec2 = 0 oldexact = set('exact') set exact off select bhav_data seek m.symbol set exact &oldexact dimension adate[m.max_rec],thisform.open[m.max_rec],; thisform.high[m.max_rec],thisform.low[m.max_rec],; thisform.close[m.max_rec],thisform.volume[m.max_rec] scan rest while symbol==m.symbol rec2 = rec2+1 adate[rec2] = bhav_data.date thisform.open[rec2] = mton(bhav_data.open) thisform.high[rec2] = mton(bhav_data.high) thisform.low[rec2] = mton(bhav_data.low) thisform.close[rec2] = mton(bhav_data.close) thisform.volume[rec2] = bhav_data.tottrdqty endscan dimension adate[rec2],thisform.open[rec2],; thisform.high[rec2],thisform.low[rec2],; thisform.close[rec2],thisform.volume[rec2] * process the fll endscanAny idea on how I can speed this up.