If you start QMF using the callable interface, you can retrieve the message numbers and text from the communications area (DSQCOMM).