CONNX Data Integration Suite 14.8.0 | CONNX Embedded SQL for Adabas | Programming Guide - C | Invocation and Precompiler Options - C | On z/OS - C
 
On z/OS - C
The general format of the call to the C precompiler is:
EXEC ACEPCC [,PARM='<precompiler options>']
The C source file is input from DD=PCIN. If the source file cannot be located, an error is returned.
The C precompiler generated file is output to DD=PCOUT. Additionally, 3 temporary work files should be assigned : DD=PCWRK1, DD=PCWRK2 and DD=PCWRK3.
Options
Every option begins with a minus sign (-). The names of the options are not case-sensitive.
The following C precompiler options are available:
Option, 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
-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.
<basename>.c
-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
-l, generate line information
Line information in the form:
/* line nn "<source file name>" */
is generated into the <code output file> with '-l'.
This can be useful when you want to know the line number of the associated SQL Statement in the original C/C++ source file.
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 only the SQL statements. 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 has to connect.
<server_name> does not need to be enclosed in quotes.
no default
-o, output code mode
Output code mode is either 32 or 64-Bit.
The C/C++ Precompiler generates 32-Bit code when invoked on 32-Bit systems (-o 32) and 64-Bit code when invoked on 64-Bit systems (-o 64).
Generation of code suitable for a different environment can be enabled with '-o 32' or '-o 64'.
Values : 32 / 64
32 (when invoked on 32-Bit systems)
64 (when invoked on 64-Bit systems)
-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 72.
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 : >= 72
72
-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
-u user name [, password]
This option is REQUIRED
User <user_name> and Password <password> for the connection 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 examples:
//MY$ACE JOB
CLASS=G,MSGCLASS=X
/*JOBPARM
LINES=9999
//*
//* Precompile
a C program using ACEPCC
//*
//* Error
Listing output to DD=PCERROR using the -e option
//*
// SET
ACELOD=CONNX.LOAD
// SET
USRLOD=WORK.LOAD
// SET
USROBJ=WORK.OBJ
//*
//ACEPCC EXEC
PGM=ACEPCC,
// PARM='-e//DDN:PCERROR
-nDD=MYDSN,GATEWAY=1.2.3.4 -uMYUSER',
// REGION=0M
//STEPLIB
DD DISP=SHR,DSN=&ACELOD
//PCIN DD
DISP=SHR,DSN=WORK.IN(PRECAPP) <-- Input
//PCOUT DD
DISP=SHR,DSN=WORK.OUT(PRECAPP) <-- 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(PRECAPP) <-- 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 C compiler and prelinker.
JCL Example:
//MY$ACE JOB CLASS=G,MSGCLASS=X
/*JOBPARM LINES=9999
//*
//* Linkedit
a precompiled C 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(PRECAPP),
//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(PRECAPP)
INCLUDE
USROBJ(ACE3GL)
ENTRY
MAIN
NAME
PRECAPP(R)
//