SASĀ® code is utilized for research projects of the Health Maintenance Organization Research Network (HMORN). The HMORN is a consortium of 18 health care delivery organizations with integrated research divisions with over 15 million patients. Multi-site research is conducted by utilizing the HMORN Virtual Data Warehouse (HMORN VDW), a distributed data network where each site locally stores their data in standardized data structures, in this case as SAS datasets. HMORN VDW is an excellent source of data for surveillance and observational studies of chronic conditions such as diabetes and cardiovascular disease. SAS programs are shared among HMORN project sites in order to extract site-specific data from each site which is then combined to represent the overall HMORN patient population and results. This paper focuses on the various programming techniques, including some borrowed from previous SAS conference papers, and lessons learned from an ongoing HMORN multi-site project involving 11 HMORN research centers. These methods were applied to produce a clean analytic dataset with extensive use of PROC SQL, arrays, and macros. The paper clearly demonstrates the advantages of utilizing distributed SAS code for extracting data, the benefits from an HMORN VDW for multi-site research, and the required organization of the SAS datasets and programs. The paper also discusses the challenges presented with data volumes and storage. SAS 9.2 was used on both Windows and UNIX environments. The paper is intended for beginner to intermediate level SAS programmers, preferably with minimal knowledge in EHR and claims data.