Better To Be Mocked Than Half-Cocked: Data Mocking Methods To Support Functional and Performance Testing of SAS Software

Troy Hughes
Datmesis Analytics


This text introduces the MOCKDATA macro, which creates sample data sets that can be used in load testing, stress testing, and other performance testing. Users are able to configure the MOCKDATA macro to alter the mock data set that is produced. Parameters include the number of observations, number of character variables, length of character variables, number of numeric variables, highest number saved as a numeric variable, and percentage of variables that are complete. MOCKDATA creates SAS data sets and/or text flat files, thus it is ideal for testing the relative performance of input/output (I/O) functionality of flat files as compared with SAS data sets. Used in coordination with the author’s PINCHLOG macro, MOCKDATA is able to mathematically demonstrate the performance advantages (i.e., increased runtime) of certain functionally methods over others. Data mocking is critical when data are sensitive and cannot be used, or data cannot be transferred (but must be tested among various locations), or simply to ensure statistically equivalent data for all types of load and performance testing.