Problem:
LEAVEKB and FREEKB fails during a compile in Mainframe Express (MFE) with error message 'COBEC1210E LEAVEKB is not a valid option for RECEIVE MAP'.
On the host these parameters are ignored for EXEC CICS SEND and EXEC CICS RECEIVE statements. If /CICSECM(OPT=NO) is used, it's fine, but both online and batch programs will not compile in the same project with this set. How can this be done on a project level?
When set project wide, the result is a get a RTS114 error because CICS is not there for batch.
Resolution:
In order to set project wide Build Settings so MFE checks each program for CICS or non-CICS, do the following:
- go to Project, Build Settings for Project
- go to COBOL tab at the top
- go to Preproc tab along the right side
- the top entry under 'Preprocessors required to handle', says 'EXEC CICS' and it is unchecked
- check it on, then select 'More'
- under 'Additional Directives' add the '/CICSECM(OPT=NO)' string and then click 'Close'
- AND HERE IS THE KEY: uncheck the 'EXEC CICS' option and then click 'OK' at the bottom of the Build Settings
MFE should now only pass your desired CICSECM option for those programs that are CICS, otherwise, it should not call the CICS preprocessor.
But there is more to this since we are dealing with an unsupported CICS API.
- MFCICS documents the CICSECM options in the Help and says:
'you should not try to set these explicitly'
- IBM no longer lists the option LEAVEKB as something one can even code on an EXEC CICS RECEIVE, but their host preprocessor takes it, so we need to use this string:
/CICSECM(OPT=IGNORE FUN=NO UNDEF=ALLOW)
Or we can set the options in the GUI. The UNDEF=ALLOW option is not documented. The MFE Compiler will still issue an error message, but it will be a W-Level error, not an E-Level. Our MFE default is to only show E-Level and above errors.
#EnterpriseDeveloper
#MFDS