Invocation and Precompiler Options (z/OS- COBOL)

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

 

EXEC ACEPCCOB [,PARM='<precompiler options>']

 

The COBOL source file is DD=PCIN. If the source file cannot be located, an error is returned.

The COBOL precompiler generated file is output to DD=PCOUT. Additionally, 1 temporary work file should be assigned : DD=PCWRK1.

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.

 

JCL Example:

//MY$ACE JOB CLASS=G,MSGCLASS=X

/*JOBPARM LINES=9999

//*

//* Precompile a COBOL program using ACEPCCOB

//*

//* Error Listing output to DD=PCERROR using the -e option

//*

// SET ACELOD=CONNX.LOAD

// SET USRLOD=WORK.LOAD

// SET USROBJ=WORK.OBJ

//*

//ACEPCCOB EXEC PGM=ACEPCCOB

// PARM='-e//DDN:PCERROR -nDD=MYDSN,GATEWAY=1.2.3.4 -uMYUSER',

// REGION=0M

//STEPLIB DD DISP=SHR,DSN=&ACELOD

//PCINCL DD DISP=SHR,DSN=WORK.INCL <-- Include Directory

//PCIN DD DISP=SHR,DSN=WORK.IN(PREBAPP) <-- Input

//PCOUT DD DISP=SHR,DSN=WORK.OUT(PREBAPP) <-- Output

//PCWRK1 DD DSN=&&PCWRK1,

// DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000),

// SPACE=(4096,(500,500),,,ROUND),

// UNIT=VIO

//PCWRK2 DD DSN=&&PCWRK2,

// DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000),

// SPACE=(4096,(500,500),,,ROUND),

// UNIT=VIO

//PCWRK3 DD DSN=&&PCWRK3,

// DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000),

// SPACE=(4096,(500,500),,,ROUND),

// UNIT=VIO

//SYSIN DD DUMMY

//SYSTERM DD SYSOUT=*

//SYSUDUMP DD SYSOUT=*

//PCERROR DD DISP=SHR,DSN=WORK.ERROR(PREBAPP) <-- Error Listing

//

Libraries

To build an executable program, the object file ACE3GL must be linked to the objects which are the result of preceding executions of a COBOL compiler.

 

JCL Example:

//MY$ACE   JOB  CLASS=G,MSGCLASS=X

/*JOBPARM  LINES=9999

//*

//* Linkedit a precompiled COBOL program with ACE3GL

//*

//  SET USRLOD=WORK.LOAD

//  SET USROBJ=WORK.OBJ

//*

//LKED     EXEC PGM=IEWL,PARM='AMODE=31,LIST,MAP'

//SYSLIB   DD   DISP=SHR,DSN=&USRLOD

//SYSLIN   DD   DDNAME=SYSIN

//SYSLMOD  DD   DISP=SHR,DSN=&USRLOD(PREBAPP),

//SYSPRINT DD   SYSOUT=*,                        

//         DCB=(RECFM=FBA,LRECL=133,BLKSIZE=1330)

//SYSTERM  DD   SYSOUT=*                         

//SYSUT1   DD   DSN=&&SYSUT1,

//         DCB=BLKSIZE=1024,

//         SPACE=(1024,(200,50)),

//         UNIT=VIO

//SYSUT2   DD   DSN=&&SYSUT2,

//         DCB=BLKSIZE=1024,

//         SPACE=(1024,(200,50)),

//         UNIT=VIO

//USROBJ   DD   DISP=SHR,DSN=&USROBJ

//SYSIN    DD   *

 INCLUDE   SYSLIB(PREBAPP)

 INCLUDE   USROBJ(ACE3GL)

 ENTRY     PREBAPP

 NAME      PREBAPP(R)

//