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 PackageThe Evaluation package, once unzipped, consists of the following directories:
Running the Sample DataAccess application
Start with compiling the samples.
smp-readrecThis 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:
data2flatThis is the actual Cobol Data File to Flat (CSV) file converter.
Convert the enclosed file-mf.dat using the enclosed FDD and RDD files:
Buy ItPlease proceed to Licensing & Pricing Page. |