Problem:
Customer gets syntax error 1238-S "Conflict with REENTRANT Directive" when using Oracle makefiles to compile .pco source code.
Adding "-P -C settings" to COBFLAGS in the makefile creates a .lst file. REENTRANT"1" is indeed specified in the settings.
Resolution:
Experimentation shows that REENTRANT"1" gets turned on when the "-t" cob flag is specified. The -t flag should be specified when compiling for database access -- and Oracle's makefiles do specify it.
Regarding conflict with REENTRANT, the Server Express Documentation in the area of "Multi-threaded Programming", "Considerations When Creating Reentrant Programs", says:
> > Use of some COBOL features will preclude reentrant
> > compilation; most of these COBOL features are obsolete or
> > archaic in ANSI Standard COBOL and their use should be
> > discontinued. Programs that use the following features
> > cannot be compiled with the REENTRANT directive:
> > The ALTER statement
> > The ON statement
> > The COBOL DEBUG facility
> > Procedure Division overlays - note this can be overcome by
> > using either the NOSEG or NOOVL directives
> > The IS INITIAL clause of the PROGRAM-ID statement
> > The STICKY-LINKAGE Compiler directive
> > The STICKY-PERFORM Compiler directive
In this case, the DEBUG feature was specified in the customer's source code:
> > ENVIRONMENT DIVISION.
> > CONFIGURATION SECTION.
> > OBJECT-COMPUTER. HP/UX.
> > SOURCE-COMPUTER. HP/UX WITH DEBUGGING MODE.
Commenting out the SOURCE-COMPUTER clause fixed the problem and made the 1238 syntax error go away.
The 1238 error might also have been triggered, had the ALTER or ON or IS INITIAL features been specified.