Skip to main content

I've been searching and getting confused about getting my COBOL expanded before I call the procob precompiler.  I've looked through the scripts that I could find from Micro Focus for our Server Express on Solaris, but found no references in them.  I'm looking for the equivalent of p(CP) precompiler directive.  I'm totally lost.


#ServerExpress
#Compiling
#unix
#COBOL
#Oracle
#64bitcompilationissue

I've been searching and getting confused about getting my COBOL expanded before I call the procob precompiler.  I've looked through the scripts that I could find from Micro Focus for our Server Express on Solaris, but found no references in them.  I'm looking for the equivalent of p(CP) precompiler directive.  I'm totally lost.


#ServerExpress
#Compiling
#unix
#COBOL
#Oracle
#64bitcompilationissue

Right now, the DBA has set up the following script:

#!/bin/ksh
cp $1 $1.pco
make -f procob.mk build SHAREDLIBPATH= EXE=x$1 COBS=$1.cob

The procob.mk looks like it is the standard makefile supplied by Oracle.  Where and how do I put in precompiler directives like CP?


I've been searching and getting confused about getting my COBOL expanded before I call the procob precompiler.  I've looked through the scripts that I could find from Micro Focus for our Server Express on Solaris, but found no references in them.  I'm looking for the equivalent of p(CP) precompiler directive.  I'm totally lost.


#ServerExpress
#Compiling
#unix
#COBOL
#Oracle
#64bitcompilationissue

You must use the cobsql precompiler interface to pro*cobol in  order to be able to expand the copybooks using cp prior to the programs being precompiled by pro*cobol.

If you are precompiling by executing procob directly then you cannot do this.

The command that must be executed would look something like the following:

cobol example1.pco preprocess(cobsql) cstop csp cobsqltype=oracle preprocess(cp) endp;

Thanks.


I've been searching and getting confused about getting my COBOL expanded before I call the procob precompiler.  I've looked through the scripts that I could find from Micro Focus for our Server Express on Solaris, but found no references in them.  I'm looking for the equivalent of p(CP) precompiler directive.  I'm totally lost.


#ServerExpress
#Compiling
#unix
#COBOL
#Oracle
#64bitcompilationissue

Chris the syntax of what you suggested will not work in the Unix (Solaris) environment.  I tried this in bash, ksh, etc.  It does not like the preprocess() statements in the line saying "syntax error near unexpected token `('.   Since I had not heard an answer relatively quickly on the forum, I've opened a support incident.  Dennis is researching it and has not gotten back to me yet.


I've been searching and getting confused about getting my COBOL expanded before I call the procob precompiler.  I've looked through the scripts that I could find from Micro Focus for our Server Express on Solaris, but found no references in them.  I'm looking for the equivalent of p(CP) precompiler directive.  I'm totally lost.


#ServerExpress
#Compiling
#unix
#COBOL
#Oracle
#64bitcompilationissue

You have to escape or quote the parentheses characters in any shell that treats them as operators - just as with any other UNIX command line. It's also a good idea to escape or quote terms containing the equals sign, in case you're using an sh-derived shell with the "keyword" option set.

For example:

  cobol example1.pco 'preprocess(cobsql)' cstop csp 'cobsqltype=oracle' 'preprocess(cp)' endp;

or

  cobol example1.pco preprocess\\(cobsql\\) cstop csp cobsqltype\\=oracle preprocess\\(cp\\) endp;

This is standard UNIX shell use. See the man page for your shell of choice for more information.