Cobol Products
  
Home
Download
Buy
About
Contact Us
 

Cobol Tools Index
Data Viewer Index
Introduction
Features and Trial
Buy DataViewer
DataViewer Manual
Data Conversion Service
Contact Us

 
DataAccess: Read Cobol Data Files into C++ Program

DataAccess library is used by Cobol data file readers to read and interprete Cobol data files. The notion of Cobol data record is fundamental to our DataAccess API. The Cobol record is described in class DrRecordDescr.

Before conversion record contains a binary blob of data represented by class DrBlob. This blob can be filled out by API user, or it can be read from the actual Cobol file using DrFileDescr class.

Cobol record consists of fields, each field responsible for one data item. Each field has a number of properties that describe its position and length in the source record, its usage and picture properties -- all the data that we need to extract the data value from the field and convert it to C++-compatible data value.

C++-compatible data values are represented using class DrDataValue and classes derived from it. The converted value can be: fixed-point integer/fractional number, string, floating-point number.

If you need to read Cobol data records from the actual physical Cobol data file, you can use one of the concrete classes derived from the class DrFileDescr or you can let the DataAceess library determine the file type from the FDD file.

File and record descriptors are filled with a concrete file/record data either manually, by assigning values to object members, or automatically by reading in FDD and/or RDD files that describe the file/record data. The FDD/RDD text files can be automatically generated by cbl2fdd program that parses a Cobol program and for every file declared in the program, it writes out one FDD file and one or more RDD files.

DataAccess library Reference Manual is enclosed in the DataAccess Library Evaluation Package.


How to Use Evaluation Package

The Evaluation package, once unzipped, consists of the following directories:

lbase
CobolTransformer base services library. This library contains service classes and functions used for platform neutralization.

data-access
DataAccess files: header files *.h, library file access.lib.

data-access/mf
Specific data file reader. In this distribution we enclose file reader for Micro Focus Cobol data files.

smp-readrec
Example that reads and converts a user-supplied Cobol data record.

data2flat
The actual source for the Cobol Data File to Flat (CSV) Converter. Uses both physical reading of records and individual record conversion capabilities of DataAccess library.

Running the Sample DataAccess application

Start with compiling the samples.
Type nmake (make for UNIX) in the access-demo directory.

smp-readrec

This sample program takes a sigle record from the file specified by user at the offset specified by user and interpretes it according to the specified RDD file.

Convert a record from the Cobol data file file.dat using RDD file file.rdd:
smp-readrec file.rdd <file.dat
The converted record is displayed.

data2flat

This is the actual Cobol Data File to Flat (CSV) file converter.

Convert the enclosed file-mf.dat using the enclosed FDD and RDD files:
mfdata2flat file-mf.fdd
The converted record is displayed.

Buy It

Please proceed to Licensing & Pricing Page.

Siber Systems
Copyright © 1997-2010 by Siber Systems Inc.