问题
There are several messages from DFSORT, which is internally used by the COBOL program that has several sort operations. I would like to remove those DFSORT messages and retain only those from the COBOL program.
回答1:
You have three options.
Use the OUTDD(ddname) Enterprise COBOL compiler option to change the DDName used for DISPLAY output.
Use the DFSPARM as you have discovered, to change the DDName SORT uses for its messages when it is invoked (called) from a program (as when using the SORT or MERGE verbs in COBOL).
Use the SORT-MESSAGE special-register.
If your SORT was stand-alone, you could also change the SORT messages file with using the OPTION Control Statement, OPTION MSGDDN=ddname
. DFSPARM is the way to allow OPTION to be provided for an invoked SORT/MERGE.
You also have Language Environment which can use SYSOUT during the run-unit, for messages from Language Environment (run-time errors, abends, requested information). There is a MSGFILE(ddname) run-time option to get LE to use a different ddname.
The easiest resolution to your problem is to use the OUTDD(ddname) compiler option. Then you don't have to worry about DFSORT (or SyncSORT at a different site) or Language Environment.
You can suppress all DFSORT messages with the MSGPRT option. You can treat multiple invocations of DFSORT differently by specifying a DFSPARM DD with FREE=CLOSE for each invocation.
回答2:
DFSORT messages of COBOL progrom (using internal sort) can be redirected by specifying ddname MSGDDN in exec step of program in JCL. e.g.
//DFSOUTDD DD DISP=SHR,DSN=XXX.DFSOUT //DFSPARM DD * MSGDDN=DFSOUTDD /*
来源:https://stackoverflow.com/questions/29500913/how-to-remove-dfsort-messages-from-sysout