Check the meanings of the codes. The easiest way to do this is to log on to TSO/ISPF and access the Main Menu of the Program Development facility. Choose option T for Tutorial. Then access the table of contents. From the table of contents menu choose A for Appendix A. This will display the dynamic allocation codes on the two first pages. Documentation of the reason codes can also be found in the IBM documentation.
In addition to the above, you should find additional messages in your batch output or JES message logs for XCOM that will provide details as to why you received message XCOMM0239E. A lot of times the message can be security or SMS related, hence why you need to check the complete output.