dadllxch2
DLL Usage description
Library: dadllxch2
This library contains functionality regarding:
- ASCII files
- ASCII file fields
- creating and processing definition files
- Relations
- Conversions
- Ranges
- Textconstants
Thus for tables daxch002, daxch003, daxch005, daxch006, daxch012, and daxch010.
General remarks about parameters:
- If an optional parameter company is specified it can be used to specify in which company the action or search should be executed. If, during the actual call, the parameter is not passed the current company will be taken.
- For most of the clear sessions almost all parameters are optional. The following rules hold:
- if cxch.t is not passed, it will be set equal to cxch.f;
- other from and to fields should always come together, if not passed they are given their values using set.min() resp. set.max();
- if the do.commit parameter is not provided true is taken
- THUS (following from the above): the last parameter is used as do commit if the number of arguments is odd OR it equals 2 and the 2nd parameter is of type bool (if type is string: 2nd argument is cxch.t).
- In this DLL authorisation for companies is not tested. Authorisation is assumed (for currently known usage it will have been tested when entering the company number on the form by executing switch to.company).
DLL Prototypes
function extern long ASCII.field.is.used(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file,
const domain daxch.fdnm field.name )
pre : true return: whether the provided ASCII field is used somewhere in
import
or export post : ret => at least one of the 2 records daxch022 or
daxch032 is
filled with the record pointing to the given ASCIIfield
function extern long ASCII.field.is.used.in.export(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file,
const domain daxch.fdnm field.name,
[ domain daxch.cbat batch ],
[ domain daxch.batl batl ] )
pre : true return: whether the provided ASCII field is used in an export
field
relation post : ret => record of daxch032 is filled with a record
pointing
to the given ASCII field
function extern long ASCII.field.is.used.in.import(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file,
const domain daxch.fdnm field.name,
[ domain daxch.cbat batch ],
[ domain daxch.batl batl ] )
pre : true return: whether the provided ASCII field is used in an import
field
relation of the given exchange scheme. If the optional
parameters are specified the ASCII field should be used in
the given batchline. post : ret => record of daxch022 is filled with a
record pointing
to the given ASCII field
function extern long ASCII.fieldname.exists(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file,
const domain daxch.fdnm ASCII.fdnm )
pre : true return: whether the given ASCII file fieldname exists post :
fields of daxch003 have been filled
function extern long ASCII.fieldnumber.exists(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file,
domain daxch.intg field.no )
pre : true return: whether the given ASCII file fieldnumber exists post :
fields of daxch003 have been filled
function extern long ASCII.file.exists(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file,
[ long company ] )
pre : true return: whether the given ASCII file exists post : fields of
daxch002 have been filled
function extern clear.ASCII.fields(
domain daxch.cxch cxch.f,
[ domain daxch.cxch cxch.t ],
[ domain daxch.casf casf.f ],
[ domain daxch.casf casf.t ],
[ domain daxch.pint fdno.f ],
[ domain daxch.pint fdno.t ],
[ long do.commit ] )
pre : true post : ASCIIfile fields are deleted with an inrange on the from
and
to fields.state : do.commit <=> a new retry point will be set
and commits will be given
function extern clear.ASCII.files(
domain daxch.cxch cxch.f,
[ domain daxch.cxch cxch.t ],
[ domain daxch.casf casf.f ],
[ domain daxch.casf casf.t ],
[ long do.commit ] )
pre : true post : ASCIIi files are deleted with an inrange on the from and
to
fields. state : do.commit <=> a new retry point and a commit will be
set/given
function extern clear.conversions(
domain daxch.cxch cxch.f,
[ domain daxch.cxch cxch.t ],
[ domain daxch.ttbl ttbl.f ],
[ domain daxch.ttbl ttbl.t ],
[ domain daxch.tfld tfld.f ],
[ domain daxch.tfld tfld.t ],
[ long do.commit ] )
pre : true post : conversion per fields are deleted with an inrange on the
from and to fields. state : a new retry point will be set and commits
will be given
function extern clear.ranges(
domain daxch.cxch cxch.f,
[ domain daxch.cxch cxch.t ],
[ domain daxch.cbat cbat.f ],
[ domain daxch.cbat cbat.t ],
[ domain daxch.ttbl ttbl.f ],
[ domain daxch.ttbl ttbl.t ],
[ long do.commit ] )
pre : true post : conversion per fields are deleted with an inrange on the
from and to fields. state : a new retry point will be set and commits
will be given
function extern clear.relations(
domain daxch.cxch cxch.f,
[ domain daxch.cxch cxch.t ],
[ domain daxch.crel crel.f ],
[ domain daxch.crel crel.t ],
[ long do.commit ] )
pre : true post : relations are deleted with an inrange on the from and to
fields. state : a new retry point will be set and commits will be given
function extern long conversion.exists(
const domain daxch.cxch xch.scheme,
const domain daxch.ttbl triton.table,
const domain daxch.tfld triton.field )
pre : true return: whether a conversion exists for the given table field in
the
given exchange scheme post : fields of daxch006 are filled
function extern long create.definition.file(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file,
const string def.file() )
return: whether the definition file could be created for the given
ASCII file. post : ret ==> def.file will be filled with the definition
of the
given ASCII file. desc : For the lay-out of the definition file see the
dllusage of
function load.definition.file (this library)
function extern long determine.record.length(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file,
const string separator() )
pre : true return: - if isspace(separator):
record length as can be computed from daxch003
(ASCII file formats):
* MAX(starting position + length - 1) for the given
ASCII.file;
* MaxLineLen if the ASCII file has no fields.
- if not isspace(separator): MaxLineLen
function extern long exists.one.ASCII.field(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file )
pre : true return: whether there exists at least one ASCII field for the
given
ASCII file
function extern long get.last.fieldnumber(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file )
pre : true return: maximum field number of xch.scheme/ASCII.file;
0 if no field number found or error
function extern long get.max.srno(
const domain daxch.cxch xch.scheme,
const domain daxch.cbat batch,
const domain daxch.ttbl tble )
pre : true return: maximum srno for the range of the given table
(0 if no range exists)
function extern long get.number.of.fields(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file )
pre : true return: the number of ASCII file fields (= ASCII file formats) of
the
given ASCII.file
function extern long get.text.constant(
[ long processing.company ],
[ long startup.company ] )
pre : true return: the textconstant belonging to processing.company as found
in
the table of company startup.company.
function extern long is.multiline.text.field(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file,
const domain daxch.fdnm ASCII.fdnm )
pre : true return: whether the given ASCII file fieldname exists
and is of type multiline post : fields of daxch003 have been filled
function extern long load.definition.file(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file,
const string def.file() )
pre : xch.scheme <> "" and ASCII.file <> "" and both should exist in
their tables (daxch001 and daxch002) return: whether the ASCII ifle
layout could be created using the
contents of file def.file post : ret = true ==> daxch003 has been
filled with the asci file
layout for the given ASCII file
ret = false => table daxch003 should be unchanged
(provided that the abort mechanism works properly for the used
database) desc : lines in def.file should have the following format:
position 1- 2 field number (number)
position 5-12 field name
position 13-42 description
position 43-46 field position (number)
position 47-50 field length (number)
position 51 field type (positive integer)
position 52-53 date format (positive integer)
position 54 floating decimal (yes/no)
position 55-56 digits after decimal (positive integer)
function extern long range.exists(
const domain daxch.cxch xch.scheme,
const domain daxch.cbat batch,
const domain daxch.ttbl tble )
pre : true return: whether a range exists for the given
table/batch/xch-scheme
combination
function extern recalculate.start.positions(
const domain daxch.cxch xch.scheme,
const domain daxch.casf ASCII.file )
pre : true post : start position of ASCII file fields are renumbered. desc
: This function recalculates the start positions for the
ASCII file, based on the field lengths. The first field will
get start position 1, the other fields one will get a start
position equal to:
start position of previous field + length of previous field.
Note: the start position of multiline fields (0) is not changed.
function extern long relation.exists(
const domain daxch.cxch xch.scheme,
const domain daxch.crel daxch.base.rel.code )
pre : true return: whether the given relation exists post : fields of
daxch005 have been filled (with a random conversion
within the given relation)
function extern update.conversion(
const domain daxch.cxch xch.scheme,
const domain daxch.ttbl triton.table,
const domain daxch.tfld triton.field,
const domain daxch.crel conv.relation )
pre : true post : if combination xch.scheme/triton table/triton field
already
exists in table daxch006 then daxch006.crel will be set to
conv.relation,
else a new record will be inserted into table daxch006 having
xch.scheme, triton table, triton field and conv.relation
function extern long update.text.constant(
[ long processing.company ],
[ long startup.company ] )
pre : the current batchline should process tttxt001 return: the textconstant
for the processing.company (the highest
currently available textnumber) post : the return value will also be
stored in the text constant table
(daxch010) of company startup.company, so subsequent application
batchlines may use it. state: a retry.point is set and a commit is
given