Background: Administrative claims of United States Centers for Medicare and Medicaid Services (CMS) beneficiaries have long been used in non-experimental research. While CMS performs in-house checks of these claims, little is known of their quality for conducting pharmacoepidemiologic research. We performed exploratory analyses of the quality of Medicaid and Medicare data obtained from CMS and its contractors. Methods: Our study population consisted of Medicaid beneficiaries (with and without dual coverage by Medicare) from California, Florida, New York, Ohio, and Pennsylvania. We obtained and compiled 1999-2011 data from these state Medicaid programs (constituting about 38% of nationwide Medicaid enrollment), together with corresponding national Medicare data for dually-enrolled beneficiaries. This descriptive study examined longitudinal patterns in: dispensed prescriptions by state, by quarter; and inpatient hospitalizations by federal benefit, state, and age group. We further examined discrepancies between demographic characteristics and disease states, in particular frequencies of pregnancy complications among men and women beyond childbearing age, and prostate cancers among women. Results: Dispensed prescriptions generally increased steadily and consistently over time, suggesting that these claims may be complete. A commercially-available National Drug Code lookup database was able to identify the dispensed drug for 95.2-99.4% of these claims. Because of co-coverage by Medicare, Medicaid data appeared to miss a substantial number of hospitalizations among beneficiaries >= 45 years of age. Pregnancy complication diagnoses were rare in males and in females >= 60 years of age, and prostate cancer diagnoses were rare in females. Conclusions: CMS claims from five large states obtained directly from CMS and its contractors appeared to be of high quality. Researchers using Medicaid data to study hospital outcomes should obtain supplemental Medicare data on dual enrollees, even for non-elders.