You should locate, freely available from IBM on the internet, the Interactive System Productivity Facility (ISPF) Services Guide for your release of z/OS. There you will find the full documentation of LMMSTATS and all the other ISPF Services available.
It will probably be best to use the ISPF Service LMMSTATS.
I have pasted the JCL and the code together from here, http://ibmmainframeforum.com/viewtopic.php?f=18&t=1772, contributed by user ehrocha.
You should locate, freely available from IBM on the internet, the Interactive System Productivity Facility (ISPF) Services Guide for your release of z/OS. There you will find the full documentation of LMMSTATS and all the other ISPF Services available.