We analyze a general search model with on-the-job search (OJS) and sorting of heterogeneous workers into heterogeneous jobs. For given values of nonmarket time, the relative efficiency of OJS, and the amount of search frictions, we derive a simple relationship between the unemployment rate, mismatch, and wage dispersion. We estimate the latter two from standard micro data. Our methodology accounts for measurement error, which is crucial to distinguish true from spurious mismatch and wage dispersion. We find that without frictions, output would be about 9.5% higher if firms can commit to pay wages as a function of match quality and 15.5% higher if they cannot. Noncommitment leads to a business-stealing externality which causes a 5.5% drop in output.