COBOL & Mysql
cobol and MYSQL easy to use.
Exporting file
To make easier the work to transfer all data from MF files to Mysql tables, EXT2SQL does practically everything for you.
Once defined and created the tables, according prerequisites described above, you will be able to transfer MF files to MySQL tables.
Depending on MYSQL table fields, EXT2SQL will create the correponding FD structure, with their fields, and will tranfer all data from ISAM file to MYSQL table.
Probably developing a simple program for each file to be tranfered, will result in less processing time than using EXT2SQL.
This can happend because the
EXT2SQL is a generic routine, that meets any MF ISAM COBOL file, once having defined its respective table in MYSQL.

SSyntax:

EXT2SQL
- return the command syntax.
EXT2SQL ARQISAM+@IP@PORTA@USER@PASW@DB@TABEL+999999999

Where:
Parameter Description
ARQISAM Name of Microfocus file
+ Separator signal
@IP Inform the IP where the MySQL server Ex.: 127.0.0.1 if the server installed in the same machine.
@PORTA Depending on how the MYSQLserver was configured, you should inform the port according to this configuration, MYSQL servers usually use standard port "3306"
@USER Inform the user name to log into the MySQL server
@PASW Inform the password for the User informed above.
@DB Inform database where the table will be found.
@TABEL/td> IInform the table name.
+ Separator signal
999999999 If necessary inform the first record to start the conversion.
Do not inform
if conversion of all records.

Before converting the file, make sure that the source file is in perfect condition, otherwise unpredictable errors may occur later, compromising the quality of results.
We recommended to check the integrity of your file, using the REBUILD ccommand from MicroFocus COBOL, before starting the transfer.


Ex.:br />
EEXT2SQL ARQMYS+@127.0.0.1@3306@franco@12345@francodb@arqmys

Will convert all records from Microfocus file named ARQMYS to arqmys table defined in dabase francodb, using franco as user name, 12345 as password  in Mysql server running at IP 127.0.0.1.

EXT2SQL ARQMYS+@127.0.0.1@3306@franco@12345@francodb@arqmys+000000012

Willl convert as defined above starting at the 12 record.
Important:

You need to pay attention if Mysql server is configured to be Case sensitive, in this case is essential to be careful to inform table name, dbase, username and password correctly, giving special attention to match exactly the same way they were registered.

The conversion treats the data source as read-only.

To run EXT2SQL, you will need to configure your PATH and COBDIR to find LIBMYSQL.DLL and all RUNTIME files needed to run a COBOL program.
The MySQL server must be properly installed, configured and running.

Franco Stringari Pudler, email franco@imediata.com.br