Iniciar Sesión

Ver la Versión Completa : [Duda] MIGRACION (De Micro Focus Cobol a GnuCobol)


jorgeamedina2020
4 de febrero de 2023, 13:16
Buenos dias a todos, estoy trabajando en la Migracion de mis fuentes y sistemas, desde una vieja version de Micro Focus Cobol V.4.50 para consola, a la nueva version de GnuCobol V3.1...., Ya pude configurar GnuCobol para re compilar mis fuentes .COB , obteniendo .EXE o .DLL.

El principa tema de esto es sus archivos, micro focus trabaja con archivos indexados .DAT .IDX, y para reconstruirlos o recuperarlos ante un problema de archivos se usaba una herramienta del propio lenguaje llamado REBUILD.EXE, esto lo dejaba al archivo en condiciones de seguir trabajando. por supuesto para compilar se usaba COMPIL.EXE y LINK.EXE.

En GnuCobol como se trabaja con este tema, que parametros se pusa para entender los archivos indexados?, porque los .EXE o .DLL funcionan bien tanto en 32bits como en 64bits. Sera que GnuCobol tiene sus propios archivos Indexados y se deben volver a generarlos????, Alguien puede comentar o ayudar sobre este tema con mas detalles precisos si es posible?.
Saludos.

jorgeamedina2020
6 de febrero de 2023, 22:05
Siguiendo con este tema:
Diferencias a comprender entre Micro Focus Cobol -vs- GnuCobol (dentro del entorno Windows)

Micro focus Cobol
* cobol.exe (Compilador, de .cob a .obj)
* link.exe (Ensamblador, de .obj a .exe)
* rebuild.exe (Recontructor de archivos, de .dat a .idx)

GnuCobol
* cobc (Compilador, ensamblador y demas funciones, de .cob a .exe, de .cob a .dll)
* cobcrun (Ejecutador de .dll)
* La pregunta mas importante aqui: Alguien SABE como trabajan los archivos de GnuCobol???
Envien respuestas sencillas y claras, para entender bien este entorno.

Saludos.

JCantero
6 de febrero de 2023, 23:03
@jorgeamedina2020, en el post 11 del siguiente link te responcio KUk al respecto de los ficheros indexados.

[Compilador] Como configurar GnuCOBOL para compilar fuentes MF - Página 2 (https://www.cobolforo.es/showthread.php?1598-Como-configurar-GnuCOBOL-para-compilar-fuentes-MF&p=8700&viewfull=1#post8700)

Parece que no tenemos mucha información sobre los fichero indexados en GNUCobol.

A ver si algun forero te puede ampliar información al respecto.

jorgeamedina2020
10 de febrero de 2023, 00:58
NUEVOS DESCRIBRIMIENTOS - Atento a esto...

GNU Cobol
GnuCOBOL download | SourceForge.net (http://sourceforge.net/projects/open-cobol/)

GnuCOBOL FAQ and How To (http://opencobol.add1tocobol.com/gnucobol)
GnuCOBOL download | SourceForge.net (http://www.opencobol.org/)

GNU Cobol is a free COBOL compiler, which translates COBOL
programs to C code and compiles it using a native C compiler.

Although many have participated, most development thanks go to

Roger While
Keisuke Nishida

This kit is the first official GNU Cobol 1.1 FTP upload.

This package contains the following subdirectories:

cobc COBOL compiler
libcob COBOL run-time library
bin COBOL driver program
lib Helper routines for missing OS functionality
config Configuration files
po International messages
texi Texinfo files
tests Test suite
extras useful COBOL programs

All programs except those in lib and libcob are distributed under
the GNU General Public License. See COPYING for details.

Programs in lib and libcob are distributed under the GNU Lesser
General Public License. See COPYING.LIB for details.

See AUTHORS for the author of each file.

============
Requirements
============

***
NOTE
For all the following packages (required or optional),
BOTH runtime AND development components are necessary.
***
***
NOTE
All the following packages are normally part of a Linux
distribution. Cygwin also has these as installable packages
ALWAYS install the distro packages when available !!
***

GNU Cobol requires the following external libraries to be installed:

o GNU MP (libgmp) 4.1.2 or later
The GNU MP Bignum Library (http://gmplib.org)

BOTH runtime AND development components required.

libgmp is used to implement decimal arithmetic.

GNU MP is distributed under GNU Lesser General Public License.


o GNU Libtool (libltdl)
Libtool- GNU Project - Free Software Foundation (http://www.gnu.org/software/libtool/libtool.html)

***
NOTE - libltdl is NOT needed when installing on Linux
or Windows (including Cygwin and MingW).
***

libltdl is used to implement dynamic CALL statements.

GNU Libtool is distributed under GNU Lesser General Public License.

**

The following libraries ARE required WHEN :

1) Indexed-Sequential file I/O is used

o Berkeley DB (libdb) 1.85 or later
Oracle | Cloud Applications and Cloud Platform (http://www.oracle.com/)

BOTH runtime AND development components required.

Recommended is version 4.x as 1.85 is known to have problems.

* NOTE *

The following NOTE(S) ONLY apply to DB <= 4.1

* NOTE *
The BDB version 4.0 was never officially supported from
sleepycat but, unfortunately, found it's way into Linux
releases. Install a newer version.

* NOTE *
If you are generating BDB yourself and the BDB
version is <= 4 (and version < 1), you need to specify
--enable-compat185 as a minimum to the BDB configure.
BDB does NOT have the usual install path of either
/usr or /usr/local. Therefore, it is recommended to
specify --prefix=/usr/local to the configure.

libdb is used to implement indexed file I/O and SORT/MERGE.

Berkeley DB is distributed under the original BSD License (1.85)
or their own license (2.x or later). Note that, as
of 2.x, if you linked your software with Berkeley DB, you must
distribute the source code of your software along with your
software, or you have to pay royalty to Oracle.

2) SCREEN I/O is used or extended ACCEPT/DISPLAY is used

BOTH runtime AND development components required.

o Ncurses (ncurses) 5.2 or later
Announcing ncurses 6.1 (http://www.gnu.org/software/ncurses/ncurses.html)

libncurses is used to implement SCREEN SECTION and extended
ACCEPT/DISPLAY.

Ncurses is distributed under a BSD style license.

o Unix curses

o PDCurses (pdcurses) for MinGW ports
PDCurses (http://pdcurses.sourceforge.net)

============

============
Installation
============

**
NOTE
Due to deficiencies in the tools used to prepare
GNU Cobol (autoconf/automake/libtool), it is
NOT generally possible to use path names with
spaces embedded within them (Mainly Cygwin/MingW/Windows ports).
**

To generate/install GNU Cobol :

**************************************

./configure
make

Here you may run
make check
to run a series of GNU Cobol test programs (must do!)
This MUST succeed - If not, please report.

make install

** NOTE **
On Linux systems, if you are installing for the
-first- time, you may need to run "ldconfig" (as root).
In fact, it does not hurt if you always do this.

** NOTE **
On some Red Hat (Fedora) installations and
possibly other Linux distros, /usr/local/lib
is NOT automatically searched at runtime.
Edit /etc/ld.so.conf (or the equivalent file) and add
/usr/local/lib to the file.
Rerun "ldconfig".

You may optionally perform a series of COBOL85 tests.
See tests/cobol85/README
It is recommended that you perform this test.

**************************************

If you think you have a problem or just want to
record the make output, just redirect the output thus :
make 1>mymake.log 2>&1
make install 1>myinstall.log 2>&1

**************************************

You can get back to a clean installation status by running :
make distclean

**************************************

The "make install" will default to "/usr/local" as
the install path. You may override this by specifying
"--prefix=<your install path>" to the "./configure"
command.

************************************************** *********

============

The following is only interesting for advanced use.
A normal user should not have recourse to use these
options.

There are the following configure options:

--with-cc=<cc> Specify C compiler command used by cobc
Do not specify this unless you know what
you are doing!

--with-db1 Use Berkeley DB 1.85 (libdb1/libdb-1.85)
This overrides --with-db/--without-db

--with-db Use Berkeley DB 3.0 or later (libdb)
This is the default

--without-db Do not use Berkeley DB / any other ISAM handler
You will not be able to use SORT/indexed I/O

--with-dl Use the system dynamic linker instead of ltdl
This is the default
(Note on Windows, native loading is used)

--without-dl Use ltdl for dynamic program loading

--with-patch-level=<n> Set internal patch level to n (default 0)

--with-varseq=<n> Define the format for variable length sequential
files.

For values of 0, 1 and 2, four bytes are
written preceding each record. The format of
these four bytes for values of 0, 1, 2 is
as follows :
n = 0 (default)
The first 2 bytes are the record length
in big-endian order. This is compatible
with mainframe. Bytes 3 and 4 are set
to binary 0.
n = 1
The 4 bytes are the record length in
big-endian order.
n = 2
The 4 bytes are the record length in
native machine order (int).
(This was previously the default)

For the value of 3, two bytes are written
preceding each record :
n = 3
The first 2 bytes are the record length
in big-endian order. The record follows
immediately after beginning at byte 3.

--enable-debug Add '-g' debug option to make

luisbago
10 de febrero de 2023, 18:24
Gnucobol no soporta archivos indexados, necesita un FILE HANDLER o manejador de archivos indexados como VBISAM ISAM File handler download | SourceForge.net (https://sourceforge.net/projects/vbisam/) o migrar a motor sql (sqlite ejemplo)

los indexados tipo rmcobol ni usando VBISAM son soportados

una alternativa es usar DISAM filehandler DISAM FileHandler | Fast ISAM for New and Legacy data development (https://www.isam.ca), pero hay que compilar gnucobol para "saber" si funciona, yo no lo he probado

lo ideal seria convertir Micro focus: index file ----> secuential file -----> gnucobol index file