How do I migrate indexed files to a format that is supported by isCOBOL?
Question ID : 8
Created on 2009-08-28 at 12:51 PM
Author : Veryant Support [email@example.com]
Online URL : http://support.veryant.com/support/phpkb/question.php?ID=8
I have indexed files from my legacy application and want to migrate them to either isCOBOL JISAM or c-treeRTG. What are my options for doing this?
There are two basic ways to migrate files to an isCOBOL ISAM file format such as isCOBOL JISAM or c-treeRTG.
- Use a utility provided with the original ISAM file system to dump all of the records into a binary sequential file, and then use the corresponding utility from the target ISAM file system to load those records into an empty file. This method is known as "Unload/Load".
- Use the isCOBOL ISMIGRATE utility or run a COBOL program that reads records from the original ISAM file and writes them out to the target ISAM file.
First Method - Unload/Load
Here are the instructions for using the unload/load method to migrate for example a Vision file to isCOBOL JISAM:
- Run a program that creates an empty file in JISAM format. Just set iscobol.file.index=jisam and then OPEN OUTPUT and CLOSE the file.
- Unload the records from the Vision file into a binary sequential file
- Load the records from the binary sequential file into JISAM file
java JUTIL -load
- Run a program to create the empty JISAM file:Run
select jisamfile assign to "jisamfile"
record key jisamfile-key.
03 jisamfile-key pic 9(5).
03 jisamfile-data pic x(100).
set environment "file.index" to "jisam".
open output jisamfile.
vutil32 -unload visionfile seqfile
java JUTIL -load jisamfile seqfile
When you run vutil and JUTIL specify the ISAM file name without the extensions added by the file system (e.g. visionfile instead of visionfile.vix).
For further information see the documentation for vutil in the Acucorp docs and for JUTIL in the isCOBOL docs (User Guide : Utilities : JUTIL).
Second Method - ISMIGRATE
The ISMIGRATE utility can migrate files from and to any of the following file systems: isCOBOL JISAM, c-treeRTG, Acucorp's Vision and others.
The steps to run ISMIGRATE in background mode to migrate a Vision file to isCOBOL JISAM are as follows:
- Create an ismigrate.properties text file and copy/paste the following in it:
java -Discobol.conf=ismigrate.properties ISMIGRATE visionfile outputdirectory
- If you prefer, you can run ISMIGRATE without parameters, so the wizard interface appears and you need to set the correct input file index type:
"ACUCOBOL Vision (com.iscobol.io.ScanVision)" for Vision
"RM/COBOL (com.iscobol.io.ScanRMKF)" for RM files
"Micro Focus (com.iscobol.io.ScanMF)" from MF files
For further information on ISMIGRATE please review the documentation in the isCOBOL SDK User Guide.
Migrating to c-treeRTG
If you need to migrate to c-tree, the same instructions apply except for the following:
- Set iscobol.file.index to ctreej
In the COBOL program that creates the empty file
set environment "file.index" to "ctreej".
- Instead of JUTIL, use ctutil as follows:
ctutil -load /datadirectory/ctreefile seqfile -b
Note: Unless configured otherwise, ctreeRTG uses the directory where the server (ctreesql) was started as the data directory. Paths are relative to that directory. If you get errors running ctutil, then try specifying the c-tree filename using an absolute path, but still without the file extension.
- Set the iscobol.ismigrate_output_file_index to ctree in the ismigrate.properties file
If running ISMIGRATE with the wizard interface, choose "c-tree RTG - Java Interface (ctreej)" in the destination indexed file type.
Back to Original Question