Invocation and Precompiler Options (Unix - COBOL)

The general format of the call to the COBOL precompiler is:

 

ACEPCCOB [<precompiler options>] <source file>

 

The COBOL source file can have any extension. If no extension is supplied the default extension 'pccob' will be used. If the source file cannot be located, an error is returned.

Options

Every option begins with a minus sign (-). The names of the options are not case-sensitive.

The following COBOL precompiler options are available:

 

Option and Option Name

Description

Default

-a catalog name

If a table name exists multiple times in the CDD and is not fully qualified with CATALOG.SCHEMA.TABLE, an  'ambiguous table reference' error will occur.

The default catalog name can be supplied with '-a <catalog_name>'.

The catalog name must exist in the CDD.

 

-b suppress trailing blanks

Suppress character string trailing blanks.

Character string Host-Variables used for input or output are padded with trailing blanks as required.

Trailing blanks can be suppressed with '-b'.

This is especially useful for applications written in C/C++. where it is normal practice for character strings to be NULL terminated without trailing blanks padding.

no

-c compatibility mode

The Precompiler executes in extended ACE mode.

ANSI mode can be enabled with '-c ANSI'.

This option affects messages only. In ANSI mode, SQL syntax which does not adhere to ANSI standards will be flagged as a warning.

Code generation is not affected.

Values  : ACE / ANSI

ace

-d string delimiter (quotes)

The COBOL Precompiler by default uses QUOTE (") as string delimiters.

 Apostrophe (') string delimiters can be enabled with '-d APOST'

 Values :QUOTE / APOST

quote

-e error listing file

Error, Warning and Statistics messages are written to STDOUT. These messages can be routed to an output file with '-e <error listing file>'.

The <error listing file> name must consist of at least a basename and optionally an extension. If no extension is supplied, the default extension 'pcl' will be used.

On z/OS platforms, a DDNAME must be used instead of a filename, using the format :

  -e //ddn:ddname

The DDNAME assignment must be made to a physical file. It must not be assigned to // DD SYSOUT=

<basename>.plc (Windows and Open Systems)

DD=SYSTERM (z/OS)

-f code output file

The <code output file> name must consist of at least a basename and optionally an extension. If no extension is supplied, the default extension 'cbl' will be used.

<base of source file>.cbl

-h host language type

The COBOL Precompiler generates either independent (-h IND) or Microfocus (-h MF) code.

When invoking the COBOL Precompiler with the '-h MF' option, an additional statement is generated for the first EXEC SQL CONNECT statement encountered in each program source and is a requirement of the Microfocus COBOL runtime on Windows and Open Systems platforms.

  SET SAGDLLPTR TO ENTRY "rciclnt"

If you do not intend using Microfocus Cobol, the '-h IND' option should be defined (This is the default option on non Windows and Open Systems platforms).

Values  : IND / MF

Default : MF  (Windows/Open Systems) or  IND (Mainframe)

Default : MF  (Windows/Open Systems)

 IND (Mainframe)

-l tab character width

The COBOL Precompiler expands all tab characters by one or more spaces as defined in <tab character width>.

Values  : >= 1

1

-k keep the generated output file in case of compilation errors

The <code output file> is deleted after compilation errors.

The <code output file> can be kept with '-k'.

no

-m migration check of SQL statements  only

The Precompiler executes in code generation mode. When migrating or checking existing C/C++ or COBOL programs, it can be useful to have a listing of the SQL statements only. These are output to STDOUT. No output file is generated.

The migration check can be enabled with '-m'.

no

-n Adabas SQL Gateway server name

This option is REQUIRED

Server <server_name> to which the session is to connect.

<server_name> need not be enclosed in quotes.

no default

-q no SQL validation

The Precompiler performs SQL syntax validation at precompile time.

SQL validation can be disabled with '-q'.

no

-r length of output line

The Precompiler generates code output files with a line length of 80.

The output line length can be increased to the length defined in <output line length>.

The output line length cannot be defined shorter than the default length for the appropriate Host Language. If this is attempted, the output line length will be reset to the appropriate Host Language default and a warning message issued.

Values  : >= 80

80

-s schema name

The SCHEMA name used by the Precompiler is derived from <user_name> as supplied with the '-u' option.

The default schema name can be overridden with '-s <schema_name>'.

The schema name must exist in the CDD.

user_name

-t cobol standard

The COBOL Precompiler processes all COBOL words and Host Variable definitions as case insensitive (-t 74).

Case sensitivity can be enabled with '-t 85'.

Values  : 74 / 85

74

-u user name [, password]

This option is REQUIRED

User <user_name> and Password <password> to be connected to the Server defined with '-n'.

The <password> parameter is optional, however, this must be supplied if the user being connected requires a password.

no default

-w working directory

Input and output files are searched for or stored in the current directory. This can be overridden with '-w <working directory>'.

If no filename is given for a file to be generated, the basename of the precompiler source file will be taken, with the appropriate extension.

current directory

-z suppress warnings

Warning messages are generated by the Precompiler.

Warning messages can be suppressed with '-z'.

This option affects WARNING messages only. ERROR messages cannot be suppressed.

no

-@ file containing command line options and parameters

Command line options and parameters saved in a file can be optionally input to the Precompiler with '-@ <command line options and parameters file>'.

The options and parameters in the <command line options and parameters file> can be combined with other command line options when invoking the Precompiler.

On z/OS platforms, a DDNAME must be used instead of a filename, using the format :

  -@ //ddn:ddname

The DDNAME assignment must be made to a physical file. It must not be assigned to // DD *

no default

 

Note :

The minimum required options are server name (-n) and user name (-u). All other options are optional.

Filename Conventions

  • The COBOL precompiler source file name must consist of at least a basename and optionally an extension. If no extension is supplied the default extension 'pccob' will be used. If the source file cannot be located, an error will be returned..

  • The COBOL precompiler generated output file name must consist of at least a basename and optionally an extension. If no extension is supplied the default extension 'cbl' will be used.

  • The (optional) COBOL precompiler listing file name must consist of at least a basename and optionally an extension. If no extension is supplied the default extension 'pcl' will be used.

  • If no directory is given, then the file will be searched or stored in the current directory. If a working directory is set (w option), then all generated files will be stored there. This setting can be overridden by a directory indication within a certain filename. If no filename is given for a file to be generated, then the basename of the precompiler source file will be taken, with the appropriate extension.

Examples:

ACEPCCOB -nDD=MYDSN -uMYUSER prebapp.pccob

All generated files will be stored in the current directory. The code output file (COBOL source) is assigned the name prebapp.cbl.

 

ACEPCCOB -nDD=MYDSN,GATEWAY=REMOTEHOST,PORT=7500 -uMYUSER prebapp.pccob

All generated files will be stored in the current directory. The code output file (COBOL source) is assigned the name prebapp.cbl.

A remote connection will be made to the CONNX JDBC Server, listening on PORT 7500.

 

ACEPCCOB -nDD=MYDSN -uMYUSER -w/TEMP -f/COBSRC/MYSRC.CBL prebapp.cob

This precompiler call stores all generated files in /TEMP except the generated COBOL source. This will be stored in /COBSRC with the name mysrc.cbl. The name of the source file of the precompiler is prebapp.cob.

 

Libraries

To build an executable program (or a dynamic link library), only the shared library rciclnt.so must be linked to the objects which are the result of preceding executions of a COBOL compiler.

 

Example:

ld prebapp.o -lrciclnt