The complete framework for standard imports is predetermined. The structure of the import file and the mapping of the fields to be imported to the DOKA fields is done via a rule 'DoxxxMap' on level 5 and is individually customizable. The fields of the import file have to be read with the function “GetNextField()”.
The import file has to be available in a text format and the fields have to be available in full length. Text-delimited format are not supported by DOKA.
If the field mappings for a customer are used in several transactions, the actual mapping rule is outsourced into a module and will be called from 'DoxxxMap'.
The module IMPMOD provides all standard functions. The parts designed just for the current import are located in the main transaction.
The standard functions are:
Furthermore, IMPMOD provides the subpanel for releasing the import file.
Log file:
At the end of the process a list with the numbers of processed records is displayed:
The Batch Importer is a standard module that executes the generic parts of an import.
The organizational frame of the DOKA-NG MyModelbank is:
IMPMOD is a vital module for the generic functions of all importers.
The module uses the following interfaces:
StartOfFile
ImportLine
EndOfFile
The field mapping of the individual fields is done in the routine 'ImportLine'. The mapping should be supported by the module in this respect, that, depending on the structure, whether the respective positions per target field are cut out via MID or that the res. next field content can easily be called in CSV structures.
'StartOfFile' is merely used for initializing control or group changing routines.
Subsequently, 'EndOfFile' can end “delayedWrite” operations.
All three routines can report errors to IMPMOD, in order that IMPMOD can abort the import in that case.
Fixed file names, prefixes or the like can easily be implemented into the importer transaction, if a customers requests these features.
In DOKA 4 the file formats of the import files were based on fixed record length (COBOL-FD). In DOKA-NG the file formats are based on text files (i.e. with CR/LF or LF delimiters) in order that TradeDesign can process the files correctly (in TradeDesign Streamload and line-by-line processing).
Currently, the problem is that in the fixed record structures are embedded compressed fields to some extent. If the compressed value is “0”, these fields contain a “0C = Formfeed”. Furthermore, the zeros are displayed as “Hex-00” in values with several digits, which is also a problem for TradeDesign. In order to solve these problems, the module SYSTDT can be used to convert files into line with a fixed record length. Compressed numbers that are also included in the text can be transferred to another processable format. Subsequently, the file is directly accessible in TradeDesign line-by-line as a stream.
On the Client/Server level the import file can be subdivided into text lines via the 'dd' tool, if required. In doing so, however, the possibly embedded Hex-00 will not be converted.
Procedure:
“dd if=P991001.DAT of=P991001.TXT cbs=120 conv=unblock”
'if' represents 'InputFile'
'of' represents 'OutputFile'
'cbs' represents 'ConversionBlockSize'
'conv=block / unblock' represents the direction of the conversion
Specific areas of the input file can be cut out with s“eek=RecordNumber”, “skip=SkipInputBlocks”, and “count=InputBlocks”. After converting the fixed format into a text format, this format can be processed in TradeDesign line by line. Additionally, the import file can also be read via normal methods (e.g. it can be displayed with SYSIXF).
Like in the whole application, the central decoding module SYSTDT (see 'SYSTDT - External File Conversion Routines') is used in the import procedures, in order to use all available decodings.
Note:
An already decoded line is passed to an import transaction. In case the original data are required (i.e. the data, that have not been decoded via SYSTDT), “GetOriginalLine” needs to be called. This can be necessary, if the compressed fields have to be read out and handled. The compressed fields may NOT be decoded.
Under the following link details about the Implementation can be found.