WRDS now provides an efficient sample program that allows users to effectively derive NBBO from quote tapes. It is available under "Using TAQ Data Efficiently" under the Research table (Research applications page) on the WRDS website.
The sample program, NBBO Derivation Using SAS Data Views, allows users to efficiently calculate the best bid and offer prices and depths at those prices (the “inside quote”) from TAQ Quote data, whenever research requires the use of inside quotes at a particular point in time. This macro illustrates the efficiency of using SAS DATA VIEWs to compute the National Best Bid and Offer (NBBO) for NYSE’s Trade and Quote (TAQ) data. We encourage users to build on the concepts in this program, mainly the employment of SAS data views, as they will save you some programming effort and your programs will run faster by using fewer system resources.
In addition, WRDS provides nbbo files in the following location.
Monthly, generated by WRDS: /wrds/nyse/sasdata/wrds_taqs_nbbo
Daily, provided by NYSE: /wrds/nyse/sasdata/taqms/nbbo