xpli - PL/I compiler script

Top  Previous  Next

The compiling of an xframe-targeted PL/I source (TP or batch) follows normally the same steps like on the original mainframe environment, in dependence with the program's typology and language. It comprehends :

source normalization
SQL coding conversion
SQL precompiling
XCICS precompiling
PL/I compiling

In order to give an user-friendly interface to all compiling processes, the “xpli” script is supplied.

Note: xpli is not available on Windows systems.

Synopsis

xpli [options] <source>

Use

xpli is used to compile both TP and batch PL/I programs. The filename specified as source has to be suffixed with “.pre”, and all files generated have the base name of the source.

Options

-b

precompiles for batch use

-n

disables preliminary include processing

-s

precompiles SQL

-c

generates object file (.o)

-l

generates shared library (.so|sl) <default>

-C

syntax check only: no output is generated

-r<dbtype>

sets the database type:

oracle (default)
db2

-o<name>

specifes an output name

-d

compiles for debug

-L

generates listing

-I<path>

specifies an alternate include path

-f

removes target option before generation

 

xpli produces the following files:

   <sourcename>.errors List of errors caught during (pre)compiling phases

   <sourcename>.lst List file if required (-L)

Return codes

A return code of 0 (zero) is returned if compiling succeeded. Non zero if something went wrong.

Configuration

xpli may be configured both using environment variables and a configuration file.

The environment

Some environment variables should be previously set to let xpli work properly:

XPLI_OBJECT_PATH

default directory for generated objects

XPLI_OUTPUT_PATH

default directory for generated executables/libraries

XPLI_STB_PATH

default directory for generated stb files (for debugging)

XPLI_PROPLI_CONF

path to pccpli.conf (Liant precompiler conf.)

XPLI_RDBMS_TYPE

database type: db2 or oracle

XPLI_INCLUDES_PATH

path for PLI includes

XPLI_PREPROCESSOR_OPTIONS

options to be passed to the Liant PLI preprocessor

XPLI_COMPILER_OPTIONS

options to be passed to the Liant PLI compiler

The configuration file

The environment variable listed above may be contained in a file named xpli.conf which is loaded at xpli startup. In this phase, xpli looks for the its configuration in present working directory and then in $HOME/etc. An alternative file may be specified setting the XPLICONF environment with the full path to the desired configuration file.

Example configuration file

#
# configuration file for xpli
#
XPLI_INCLUDES_PATH="$HOME/inc:$XFRAMEHOME/xcics/pl1cpy"
XPLI_OUTPUT_PATH=$HOME/lib
XPLI_PROPLI_CONF=$HOME/etc/propli.conf
XPLI_PREPROCESSOR_OPTIONS="-margins 2,72"
XPLI_COMPILER_OPTIONS="-noopt -setstack"
XPLI_STB_PATH=$HOME/objs/stb

Example

# xpli -d PL02.plx
xpli: loading configuration from /home/fabrizio/regtest/src/mixed/xpli.conf
xpli: include PL02.plx PL02.pp
xpli: precompiling CICS calls
xpli: compiling PL/I source PL02.pli
xpli: compiler output is /home/fabrizio/regtest/src/mixed/PL02.o
pli: linking library /home/fabrizio/lib/PL02.so

The compiling was successful and a shared library has been generated and located in the correct path.

Notes Compiling

xpli generates only shared libraries and link-editable objects. To built an executable file, you must use the OpenPLI  linker(ldpl1). This means that, while shared libraries produced by xpli are immediately available to be used by XCICS/TS, for batch programs you must link executable files using the linker, remembering to provide all the objects that compose the program. Additionally, if you want to access XVSAM data, though the OpenPLI ISAM interface you must invoke ldpl1 with option -cisam and export the following environment variable before to invoke the linker:

export LIB_ISAM=$(XFRAMEHOME)/xvsam6/isam/libisam.a

Example

export LIB_ISAM=$(XFRAMEHOME)/xvsam6/isam/libisam.a
ldpl1 -cisam -o myexe pgm1.o pgm2.o

Notes

1.xpli is not available on Windows systems