Subject: New website
I have reconstructed the OpenCOBOL website at http://www.opencobol.org/. As you can see, most pages are still under development. Please let me know if you can help maintaining this site.
----------------------------------------------------------------
yes, I am interesting for it. :-o
----------------------------------------------------------------
Subject: write/print controls
I have been using opencobol on my gentoo machine to do my school work for a file structures class. In my school projects, we are required to print an underline record to a report file by printing the text line then on the same line printing the '_' char so when printed it appears that the text is underline. This is done by printing the underline line with the 'AFTER ADVANCING 0 LINES' clause. Using shed, I inspected the resulting file after running the program and there does not appear to be a control character at the end of the first line that would cause the second line to be overprinted on the first. Does opencobol correctly implement the 'AFTER ADVANCING 0 LINES' clause? What character is used as the overpunch char? How would I print this so the printer properly outputs the underline chars?
-solid
----------------------------------------------------------------
CR+LF is usually appended to line print contents (CR = carriage return (char 13), LF = line feed (char(10).
when used AFTER ADVANCING 0 LINES clause only the CR must exist. This is the expected behaviour (and observed under others implementations). there is no overpunch char.
usually the out file is a select xxx assign print or assign line sequential.
----------------------------------------------------------------
Subject: Rationale behind the C code being generated?
Hi,
When I run OpenCOBOL on the COBOL program:
IDENTIFICATION DIVISION.
PROGRAM-ID. hello.
PROCEDURE DIVISION.
DISPLAY "Hello World!".
STOP RUN.
I get about 40 lines of nasty C code having to do with stack frame trickyness. I don't get:
main(int argc, char *argv[]) {
printf("Hello, World!\n");
}
What is the rationale for that?
I am familiar with the whole issue in general: I make a C-to-Java translator (jazillian.com), and I'm very familiar with a C-to-Java tool (Ephedra) that does the same kind of thing that you're doing here. The rationale there had to do with C constructs (pointers) for which there is no Java equivalent, and the ability to access arbitrary memory locations in C, which can't be done in Java. Is there a similar thing going on here? Is the OpenCOBOL design documented anywhere?
Thanks,
Andy
----------------------------------------------------------------
Hi Andy,
COBOL allows complex control flow like this:
MAIN.
PERFORM A.
PERFORM A THRU B.
GO TO B.
A.
DISPLAY "A".
B.
DISPLAY "B".
C.
DISPLAY "C".
STOP RUN.
This will print "A" "A" "B" "B" "C".
As far as I can imagine, it is hard to handle this flow without the tricky stack frame handling.
Keisuke
----------------------------------------------------------------
Subject: La Sentencia Accept/Display WITH BACKGROUND-COLOR
Accept Char30 Line Lx Column Cy With Update
Accept Tec-Funcion From Escape Key
*>-
If Tecla-Enter Then
If Is-Obligatorio And Char30 = Space Then
Perform MsgErrorAccept
Else
Set Salir-On To True
End-If
End-If
Al Compilar me tira este Error
C:\MINGW\bin>CobC Helper.cob
Helper.cob: In paragraph 'Aceptar-Buscador':
Helper.cob:256: PERFORM statement not terminated by END-PERFORM
Helper.cob:258: syntax error, unexpected WITH
Helper.cob: In paragraph 'MessageOut':
Helper.cob:495: syntax error, unexpected '('
Helper.cob: In paragraph 'BlankLin23':
Helper.cob:499: syntax error, unexpected '('
:-o
----------------------------------------------------------------
Subject: open cobol for windows platform
why dont u make a copy for windows platform.i'm sure it will be more interesting and hopefully more contribution from others cobol programmer.
tq
----------------------------------------------------------------
You're free to make a copy for windows platform yourself, and to publish the result on the web to help other windows users. The author was so kind to publish the source code of open-cobol and allow redistribution with the coolest license on the planet. :-)
----------------------------------------------------------------
Using Cygwin, the port is trivial.
Cygwin has all the necessary prerequisite packages.
Using MingW/MSys, you need to build the prequisite
packages yourself.
Under both of the above follow the README.
If you are talking native Win port based on VC
then Sergey Kashyrin has a prepared package based
on the pre-release 0.33 at :
http://kiska.net/opencobol
NOTE - For Cygwin/MingW, please use the 0.33 prerelease
tarball at :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
Roger While
(OC developer)
----------------------------------------------------------------
Since I do my best not to use windows, I don't know much about cygwin. If someone takes the time to build this in cygwin, would someone need to have cygwin installed to run it?
----------------------------------------------------------------
Yes.
If you build under Cygwin, you need the
Cygwin environment to run it.
Same for MinGW/MSYS.
Roger
----------------------------------------------------------------
I don't agree with the premise it will be more interesting in windows, but in case I want to use this in windows with a different compiler. I forgot the name but I use a free C compiler in windows. Should this work for that? I mean if I use opencobol to convert the cobol to c and then compile that with the C compiler it should work, right?
----------------------------------------------------------------
jasorn wrote:"Since I do my best not to use windows,..."
Hi there!
That's the attitude - I like that! Now I do not feel that much alone anymore!
Unfortunately, I was locked into the Windows-World for almost 3 years - makes me the more feel like jasorn.
However I have to be realistic also. I have written a Commercial System un WinXP (because of the market requirement using ACUCOBOL GT with AcuBench. I chose ACU mainly for two reasons - it's GUI development features (which I consider to be supreme) and also the fact that it runs on Linux.
I am looking to change compilers and I have 3 questions:
1) How do I develop a GUI interface with OpenCobol?
2) What index file system(s) are available?
3) Lastly - and because I have to provide the system on WinXP as well - could someone please explain to me in plain language how do I go about getting a WinXP-version going?
Regards
Tom
----------------------------------------------------------------
Subject: Compile errors
Not sure what's going wrong here, but I ran ./configure and it went through and did it's thing. From there, I ran make and it blew up. I'm doing this under Mac OS X 10.4.4.
Creating defaults.h...
make all-recursive
Making all in lib
rm -f libsupport.a
ar cru libsupport.a
ar: no archive members specified
usage: ar -d [-TLsv] archive file ...
ar -m [-TLsv] archive file ...
ar -m [-abiTLsv] position archive file ...
ar -p [-TLsv] archive [file ...]
ar -q [-cTLsv] archive file ...
ar -r [-cuTLsv] archive file ...
ar -r [-abciuTLsv] position archive file ...
ar -t [-TLsv] archive [file ...]
ar -x [-ouTLsv] archive [file ...]
make[2]: *** [libsupport.a] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
----------------------------------------------------------------
What's your version of "ar" ?
$ ar V
GNU ar 2.16.91 20060118 Debian GNU/Linux
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License. This program has absolutely no warranty.
----------------------------------------------------------------
I'm not sure -- running ar V returns nothing but the usage stuff. How can I check or update it?
$ ar V
usage: ar -d [-TLsv] archive file ...
ar -m [-TLsv] archive file ...
ar -m [-abiTLsv] position archive file ...
ar -p [-TLsv] archive [file ...]
ar -q [-cTLsv] archive file ...
ar -r [-cuTLsv] archive file ...
ar -r [-abciuTLsv] position archive file ...
ar -t [-TLsv] archive [file ...]
ar -x [-ouTLsv] archive [file ...]
----------------------------------------------------------------
I guess there must be some way to query that on Mac OS X. Anyway, the problem is the version of "ar". Try upgrading it to something newer, and then things should work.
----------------------------------------------------------------
Use the 0.33 prerelease here :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
Problem is that the Mac "ar" does not like
creating empty archives.
Fixed in 0.33.
Roger While
(Main OC developer)
----------------------------------------------------------------
Subject: Compile-time segmentation fault
When compiling a program without any syntax errors the compiler issues a SEGMENTATION FAULT message and terminates. This program compiles and runs with ACUCOBOL in the WinXP environment. Any clues as to what could cause this problem will be appreciated.
Thanks!
----------------------------------------------------------------
Not without your program.
----------------------------------------------------------------
My employer forbids me to post the original program code. However, I have constructed a small test program that acts exactly like the original program. I isolated the problem to the FILE SECTION. If the program contains a single (or any number of) SELECT statement then the segmentation fault occurs. If I remove the SELECT (and corresponding FD) the problem does not occur. I've tried every legal construction of the SELECT of which I'm aware all to no effect. The original program exhibits the same behavior: i.e., remove all SELECTs, FDs, and Procedure Division references to the files and the program (what's left) compiles and executes as expected.
Here is the sample test program:
IDENTIFICATION DIVISION.
PROGRAM-ID. TESTPGM.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT PFILE
ASSIGN TO "pfile.dat".
DATA DIVISION.
FILE SECTION.
FD PFILE.
01 PREC PIC X(10).
PROCEDURE DIVISION.
0000-DUMMY.
DISPLAY "STARTING TESTPGM".
DISPLAY "NORMAL PROGRAM TERMINATION".
STOP RUN.
PROGRAM-EXIT.
EXIT.
----------------------------------------------------------------
I have the same problem. I tried to compile a simple example cobol program which reads a sequence file and write it to a relative file. I use open-cobol on debian linux. I also installed OpenCobol under cygwin (binary files) and it worked fine!
Here is the compilation output:
$ cobs Seq2Rel.CBL
Segmentation fault
$
Here is the source:
000000 IDENTIFICATION DIVISION.
000100 PROGRAM-ID. Seq2Rel.
100000 ENVIRONMENT DIVISION.
100100 INPUT-OUTPUT SECTION.
100200 FILE-CONTROL.
100300 SELECT SupplierFile ASSIGN TO "RELSUPP.DAT"
100400 ORGANIZATION IS RELATIVE
100500 ACCESS MODE IS RANDOM
100600 RELATIVE KEY IS SupplierKey
100700 FILE STATUS IS Supplierstatus.
100800 SELECT SupplierFileSeq ASSIGN TO "SEQSUPP.DAT"
100900 ORGANIZATION IS LINE SEQUENTIAL.
200000 DATA DIVISION.
200100 FILE SECTION.
200200 FD SupplierFile.
200300 01 SupplierRecord.
200400 02 SupplierCode PIC 99.
200500 02 SupplierName PIC X(20).
200600 02 SupplierAddress PIC X(50).
200700 FD SupplierFileSeq.
200800 01 SupplierRecordSeq.
200900 88 EndOfFile VALUE HIGH-VALUES.
201000 02 SupplierCodeSeq PIC 99.
201100 02 SupplierNameSeq PIC X(20).
201200 02 SupplierAddressSeq PIC X(50).
202000 WORKING-STORAGE SECTION.
202100 01 SupplierStatus PIC X(2).
202200 01 SupplierKey PIC 99.
500000 PROCEDURE DIVISION.
500100 Begin.
500200 OPEN OUTPUT SupplierFile.
500300 OPEN INPUT SupplierFileSeq.
500400 READ SupplierFileSeq
500500 AT END SET EndOfFile TO TRUE
500600 END-READ
500700 PERFORM UNTIL EndOfFile
500800 MOVE SupplierCodeSeq TO SupplierKey
500900 MOVE SupplierRecordSeq TO SupplierRecord
501000 WRITE SupplierRecord
501100 INVALID KEY DISPLAY "Supplier status = " SupplierStatus
501200 END-WRITE
501300 READ SupplierFileSeq
501400 AT END SET EndOfFile TO TRUE
501500 END-READ
501600 END-PERFORM.
501700 CLOSE SupplierFile, SupplierFileSeq.
501800 STOP RUN.
----------------------------------------------------------------
I assume you are trying on Linux, Please specify you OS and OS version.
----------------------------------------------------------------
I'm running kernel 2.6.13-15 SUSE 10.0.
----------------------------------------------------------------
I had the same problem too. I was using linux debian 3.1 (x86) and using opencobol 0.32 (open-cobol_0.32-1_i386.deb). I downloaded open-cobol-0.32.tar.gz from opencobol site, compiled and installed it and the problem "segmentation fault" disappeared . :-D
----------------------------------------------------------------
Would OpenCOBOL be sensitive to the version of GCC being used? My system has version 4.0.2 20050901.
----------------------------------------------------------------
I think that you are right. I'm using gcc version 3.3.6 and, after your post, I tried to use gcc 4.0.3 and got "seg fault".
----------------------------------------------------------------
Thanks for your feedback on the gcc issue. I think that I will pursue that as a possible solution. Will need to see what's involved in going backwards to a prior version or else look into having two versions of gcc.
Thanks again!
----------------------------------------------------------------
Use the CVS snapshot tarball (AKA prerelease) here :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
Whenever I update CVS, I create a prerelease tarball.
(See OC mailing list on SourceForge)
This has a whole bunch of fixes and changes.
Roger While
(Main OC developer)
----------------------------------------------------------------
I downloaded 0.33 and that seemed to resolve the segmentation fault issue. All of the test programs that I've compiled and run (so far) pass with flying colors.
Thanks for the great work, Roger!
Alec
----------------------------------------------------------------
I was attemping to compile and run a cobol program that involves an indexed file and was getting the segmentation fault error. After reading this thread, I installed the 0.33 prerelease as Roger mentioned in his post, but now I'm getting seg faults for all of my programs, including the more simple ones that do not involve indexed files. I will likely uninstall this newer version as it apparently is causing some problems. Any idea how I can get the seg faults to go away for my programs that involve index files? My environment is:
SLES9
GCC 4.03
openCOBOL 0.32
----------------------------------------------------------------
Redownload and install 0.33.
If problems still persist, post one of
the simpler programs that is segfaulting.
(Also what Cobol compile options you are using)
Roger
----------------------------------------------------------------
Is this still the correct url for 0.33?
http://www.sim-basis.de/open-cobol-0.33.tar.gz
I am not currently using any compile options. I'm simply compiling "cobc PROG1.cob" and running "./PROG1".
----------------------------------------------------------------
Yes, URL is correct.
And here is your problem (with 0.33) -
"I'm simply compiling "cobc PROG1.cob" and running "./PROG1"."
The default when using no options is to create
a module (sub-program) eg. Under Linux, PROG1.so
So, either do
cobc -x PROG1.cob
./PROG1
or
cobc -m PROG1.cob
cobcrun PROG1
Note that in 0.33, the "-m" is default and may be
left out.
The above was done to make usage very like MicroFocus.
----------------------------------------------------------------
The -x extension was my problem, so that fixed it. Thanks! Just to clarify-- openCOBOL 0.33 does not default to -x if you just type "cobc programName.cob"? I thought it did in previous versions. Again, thanks for the help
----------------------------------------------------------------
Indded, 0.33 does not default to "-x", it defaults
to "-m".
This was done to be more like MicroFocus/ACU.
Always check "cobc --help" for defaults/options.
----------------------------------------------------------------
please update documentation
User Manual
http://www.opencobol.org/modules/bwiki/index.php?cmd=read&page=UserManual%2F1#content_1_1
does not show the -x option
-pete
----------------------------------------------------------------
The Wiki specifically states that it applies
to version 0.30.
Options do occasionally change from release to release.
Firstly, these are documented in the compiler
change log (cobc/ChangeLog).
Secondly, the info files are updated on each release
(texi/open-cobol.info). This is the the user manual.
("man info" will give you (sic) info on using the
info command)
Note also that compiler defaults are noted
in the help text (cobc --help).
Snip from 0.33 cobc --help
-x Build an executable program
-m Build a dynamically loadable module (default)
Finally, as it's a Wiki, you can change it yourself :-)
Roger
----------------------------------------------------------------
Subject: differ in signedness
Dear All,
I tried to compile open-cobol 0.32 on debian Linux. I compiled the stuff and I got a lot of warnings like this:
odegen.c:1450: warning: pointer targets in passing argument 1 of 'cb_encode_program_id' differ in signedness
I found the same problem on a homepage at http://people.debian.org/~tbm/logs/gcc-4.1/open-cobol_0.32-1_20060320-1227
After running cobc I got a similar warning:
$ cobc test.cob
In file included from /tmp/cob80fRnm.c:9:
/tmp/cob80fRnm.c.h:6: warning pointer targets in initialisation differ in signedness
Could anyone help me to make these warning disappear?
THX!
----------------------------------------------------------------
Hi,
That warnings were caused by gcc version 4.0.x. Try to use gcc 3.x. To install it, use the command:
apt-get install gcc-3.3
Instruct make to use gcc-3.3 and configure opencobol to use gcc-3.3 also:
cd open-cobol-0.32
export CC=gcc-3.3
./configure --enable--debug --with-cc=gcc-3.3
make
make install
I think it will work without that warnings.
regards.
----------------------------------------------------------------
Use the 0.33 prerelease here :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
Roger While
(Main OC developer)
----------------------------------------------------------------
Subject: configure: error: GMP 3 or later is required
I have GMP 4.x installed and I'm getting this error message when I do the configure
----------------------------------------------------------------
I assume you are referring to 0.32.
Pick up the CVS snapshot tarball (AKA prerelease) at :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
This has a whole load of fixes.
Whenever I update CVS, this trball is also updated
and notification is posted to the OC list over on SourceForge.
Roger While
(OC developer)
----------------------------------------------------------------
Hi Roger,
I am still getting the GMP 3 configure error on my system with the the open-cobol-0.33.tar.gz. My system is SUSE 10.1 with the latest GMP 4.X built from source code.
I did manage to create a workaround for my issue. I commented out the requirement in the configure.ac file and then rebuild the configure script. It passes all of the "make check" tests so I think I have a working version.
Just a FYI....
James Robinson
----------------------------------------------------------------
Hmmm. Actually we should not be relying upon certain internal entry points at all.
Better is this in configure.ac -
# Checks for gmp.
AC_CHECK_HEADERS([gmp.h], , AC_MSG_ERROR(gmp.h is required))
MYOLDLDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -lgmp"
AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include ]], [[
mpz_t myvar;
mpz_init (myvar);
]])],
[],
[AC_MSG_ERROR(GMP 3 or later is required)],
[])
LDFLAGS="$MYOLDLDFLAGS"
LIBCOB_LIBS="$LIBCOB_LIBS -lgmp"
I'll get this fixed up and upload the tarball later today.
Should be there (May 24) at latest 17:00 Central European Time.
Roger
----------------------------------------------------------------
Well, the tarball is there but I am going to
have to rethink this. It does not work under Cygwin
because of the vagueries of AC_TRY_RUN on
Winbloze systems.
Reverted to entry point check.
Check for entry point __gmp_randinit which is
in all versions of GMP from 3 upwards upto and
including current 4.2.1
Tarball updated.
Roger
----------------------------------------------------------------
Hi,
I'm using macosx 10.4.6 and encountered the gmp 3 or later is reguired message.
So i downloaded opencobol 0.33 and tried to configurel that version but then i got:
configure: error: libdb is required
So i installed libdb 4.4.20 but still got the same error
any help would be apreciated
the error:
checking db.h usability... yes
checking db.h presence... yes
checking for db.h... yes
checking db_185.h usability... no
checking db_185.h presence... no
checking for db_185.h... no
checking db3/db_185.h usability... no
checking db3/db_185.h presence... no
checking for db3/db_185.h... no
checking db4/db_185.h usability... no
checking db4/db_185.h presence... no
checking for db4/db_185.h... no
checking db4.1/db_185.h usability... no
checking db4.1/db_185.h presence... no
checking for db4.1/db_185.h... no
checking db4.2/db_185.h usability... no
checking db4.2/db_185.h presence... no
checking for db4.2/db_185.h... no
checking db4.3/db_185.h usability... no
checking db4.3/db_185.h presence... no
checking for db4.3/db_185.h... no
checking db4.4/db_185.h usability... no
checking db4.4/db_185.h presence... no
checking for db4.4/db_185.h... no
checking db4.5/db_185.h usability... no
checking db4.5/db_185.h presence... no
checking for db4.5/db_185.h... no
checking for __db_open in -ldb-4.5... no
checking for dbopen in -ldb-4.5... no
checking for __db_open in -ldb-4.4... no
checking for dbopen in -ldb-4.4... no
checking for __db_open in -ldb-4.3... no
checking for dbopen in -ldb-4.3... no
checking for __db_open in -ldb-4.2... no
checking for dbopen in -ldb-4.2... no
checking for __db_open in -ldb-4.1... no
checking for dbopen in -ldb-4.1... no
checking for __db_open in -ldb-4... no
checking for dbopen in -ldb-4... no
checking for __db_open in -ldb... no
checking for dbopen in -ldb... no
configure: error: libdb is required
----------------------------------------------------------------
Did you specify --enable-compat185 to BDB configure ?
Did you specify --prefix=/usr to BDB configure ?
The default install paths for BDB are peculiar,
therefore you either need the BDB --prefix or you
have to fiddle around with flags specifying
the include and lib paths to the OC configure.
(BDB configure --help gives BDB details)
(OC ./configure --help gives OC details)
Roger
----------------------------------------------------------------
thanks,
no I had not specified them, but now i did and configure worked but I got another error using make
/bin/sh ../libtool --tag=CC --mode=link gcc -fsigned-char -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-format-y2k -DSUPER_OPTIMIZE -O2 -finline-functions -fomit-frame-pointer -o libcob.la -rpath /usr/local/lib -version-info 1:0:0 -no-undefined libcob_la-common.lo libcob_la-move.lo libcob_la-numeric.lo libcob_la-intrinsic.lo libcob_la-termio.lo libcob_la-fileio.lo libcob_la-screenio.lo libcob_la-strings.lo libcob_la-call.lo -lm -lgmp -lncurses -ldb-4.4
gcc -dynamiclib -o .libs/libcob.1.0.0.dylib .libs/libcob_la-common.o .libs/libcob_la-move.o .libs/libcob_la-numeric.o .libs/libcob_la-intrinsic.o .libs/libcob_la-termio.o .libs/libcob_la-fileio.o .libs/libcob_la-screenio.o .libs/libcob_la-strings.o .libs/libcob_la-call.o -lm /usr/local/lib/libgmp.a -lncurses /usr/lib/libdb-4.4.dylib -install_name /usr/local/lib/libcob.1.dylib -Wl,-compatibility_version -Wl,2 -Wl,-current_version -Wl,2.0
ld: common symbols not allowed with MH_DYLIB output format with the -multi_module option
/usr/local/lib/libgmp.a(mp_bpl.o) definition of common ___gmp_junk (size 4)
/usr/bin/libtool: internal link edit command failed
make[2]: *** [libcob.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Rene
----------------------------------------------------------------
Something wrong wiith the GMP build/install -
On the gcc line -> /usr/local/lib/libgmp.a
This is wrong, it should be picking up the
dylib.
Need info on the GMP configure/make
(config.log and make/make install output)
Roger
----------------------------------------------------------------
Actually, researching shows that it is
a GMP problem.
Follow this thread -
http://swox.com/list-archives/gmp-bugs/2006-April/000383.html
It "may" be fixed in current GMP release (4.2.1)
Will look more closely later.
Roger
----------------------------------------------------------------
No, I do not think it is fixed in 4.2.1
I have a patched version which "may" work here -
http://www.sim-basis.de/gmp-4.2.1.tar.gz
Mail the config.log and the output from the make.
Of course, you DID do what the GMP INSTALL says and
ran "make check" ?
Do it.
Roger
----------------------------------------------------------------
Alternatively, when building GMP, you
can do -
./configure CC='gcc -fPIC'
Roger
----------------------------------------------------------------
thanks,
where should I mail it to?
rene
----------------------------------------------------------------
Hop over to OpenCOBOL at SourceForge and
click on my Userid.
Roger
----------------------------------------------------------------
Can you also post a
ls -lai /usr/local/lib after the "make install"
of GMP.
Roger
----------------------------------------------------------------
According to the GMP mailing lists,
you may need also to add the following
to the configure -
--enable-cxx --enable-shared
Roger
----------------------------------------------------------------
And you may also need a
export ABI=32
before you do the GMP configure.
More info on the GMP mailing lists.
Roger
----------------------------------------------------------------
Roger,
I just send you an email.
I have not tried your latest sugestions yet
Rene
----------------------------------------------------------------
Hi,
Im getting this error as well om Solaris 2.8:
checking for gmp.h... yes
checking for __gmp_randinit in -lgmp... no
configure: error: GMP 3 or later is required
This is happenning with open-cobol-0.32 and the open-cobol-0.33 I found in this forum. Any other ideas?
Thanks,
Leslie
----------------------------------------------------------------
Something wrong with the gmp installation.
Did you gen gmp yourself ?
Check in /usr/local/lib and /usr/lib for
gmp shared libraries eg.
ls -lai /usr/local/lib/libgmp*
ls -lai /usr/lib/libgmp*
If you just see libgmp.a, that's no good.
Recheck the gmp installation.
Roger
----------------------------------------------------------------
hello friend,
this error is because of you installed gmp 4
try gmp 3.x you will get your open cobol configured
----------------------------------------------------------------
Hi,
I did recompile the gmp, and I do have libraries in /usr/local/lib. When I configure open-cobol-0.33, I get the error "configure: error: GMP 3 or later is required".
As someone pointed out, I may need to install gmp 3.x which I would be happy to do, if I can find it. I don't see it on the gmp site
Any Ideas?
Leslie
----------------------------------------------------------------
The 0.33 prerelease at :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
has been tested with several different versions of
BDB including the latest (4.4.20) and also several different versions of GMP including the latest (4.2.1).
Roger
----------------------------------------------------------------
I've downloaded this new version, and I am still getting configure errors:
checking for getopt_long_only... no
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for __gmp_randinit in -lgmp... no
configure: error: GMP 3 or later is required
It has to be something in my enviroment, but I don't know what it could be.
Thanks,
Leslie
----------------------------------------------------------------
What does
ls -l /usr/lib/libgmp*
ls -l /usr/local/lib/libgmp*
show?
----------------------------------------------------------------
ls -l /usr/lib/libgmp*
/usr/lib/libgmp*: No such file or directory
ls -l /usr/local/lib/libgmp*
-rw-r--r-- 1 root other 2966876 Jul 31 15:48 /usr/local/lib/libgmp.a
-rwxr-xr-x 1 root other 693 Jul 31 15:48 /usr/local/lib/libgmp.la
lrwxrwxrwx 1 root other 15 Jul 31 15:48 /usr/local/lib/libgmp.so -> libgmp.so.3.3.2
lrwxrwxrwx 1 root other 15 Jul 31 15:48 /usr/local/lib/libgmp.so.3 -> libgmp.so.3.3.2
-rwxr-xr-x 1 root other 1708064 Jul 31 15:48 /usr/local/lib/libgmp.so.3.3.2
----------------------------------------------------------------
This on a Linux box ?
If so, why did you not use the distro's
GMP ? - This would be installed in /usr/lib.
Did you configure/make/install GMP yourself ?
If on Linux, try doing "ldconfig" as root.
If not on Linux, then it is likely that
/usr/local/lib is not in the default library
search path. If so, then various options -
1) Consult system documentation to get /usr/local
into the default search path for includes/libs.
2) Reconfigure/make/install GMP with "--prefix=/usr"
3) Consult the output from OC's "./configure --help"
Roger
----------------------------------------------------------------
Subject: Dynamic calls from COBOL to a C++ DLL
I'm trying to write a COBOL program that calls into a DLL. The User Manual appears to cover calling a stand-alone module. When I run, I'm getting the message: libcob: LoadLibrary/GetProcAddress error 127.
Can somebody point me in the right direction?
Thanks,
Ed
----------------------------------------------------------------
OK This was a Windows/VS 8.0 issue.
1) instead of -l name.dll like cobc says, MS changed the parm so the new syntax is -link name.dll.
2) In the DLL, the non-mangled name was not exported. I had to go into Linker Input and specify a Module Definition File.
Side qustion.. Anybody know how to get rid of my duplicate post?
----------------------------------------------------------------
I thought you could do it yourself.
Maybe not, must ask Keisuke.
Anyway, I've got rid of it.
Roger
----------------------------------------------------------------
Subject: buffer overflow
I have a problem compiling any program with a select statement in it. Any help or suggestions would be appreciated.
opencobol 0.32
ar 2.16.91.0.6
fedora core 5
kernel 2.6.16-1.2122_FC5
gcc version 4.1.1
Please ask if any other program version #'s are needed.
Here is my program:
IDENTIFICATION DIVISION.
PROGRAM-ID. TESTPGM.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT PFILE
ASSIGN TO "pfile.dat".
DATA DIVISION.
FILE SECTION.
FD PFILE.
01 PREC PIC X(10).
PROCEDURE DIVISION.
0000-DUMMY.
DISPLAY "STARTING TESTPGM".
DISPLAY "NORMAL PROGRAM TERMINATION".
STOP RUN.
PROGRAM-EXIT.
EXIT.
And here is the output:
[krisda@programmer0 dev]$ cobc TESTPGM.cbl
*** buffer overflow detected ***: cobc terminated
======= Backtrace: =========
/lib/libc.so.6(__chk_fail+0x41)[0x77e2b1]
/lib/libc.so.6(__vsprintf_chk+0x0)[0x77db48]
/lib/libc.so.6(_IO_default_xsputn+0x9c)[0x702817]
/lib/libc.so.6(_IO_vfprintf+0x93c)[0x6dc955]
/lib/libc.so.6(__vsprintf_chk+0xa1)[0x77dbe9]
/lib/libc.so.6(__sprintf_chk+0x30)[0x77db3c]
cobc[0x80667d0]
cobc[0x8067fa4]
cobc[0x8069658]
cobc[0x804a798]
/lib/libc.so.6(__libc_start_main+0xdc)[0x6b7724]
cobc[0x80491a1]
======= Memory map: ========
00684000-00685000 r-xp 00684000 00:00 0 [vdso]
00685000-0069e000 r-xp 00000000 03:04 3606285 /lib/ld-2.4.so
0069e000-0069f000 r-xp 00018000 03:04 3606285 /lib/ld-2.4.so
0069f000-006a0000 rwxp 00019000 03:04 3606285 /lib/ld-2.4.so
006a2000-007cf000 r-xp 00000000 03:04 3606293 /lib/libc-2.4.so
007cf000-007d1000 r-xp 0012d000 03:04 3606293 /lib/libc-2.4.so
007d1000-007d2000 rwxp 0012f000 03:04 3606293 /lib/libc-2.4.so
007d2000-007d5000 rwxp 007d2000 00:00 0
076a7000-076b2000 r-xp 00000000 03:04 3604505 /lib/libgcc_s-4.1.1-20060525.so.1
076b2000-076b3000 rwxp 0000a000 03:04 3604505 /lib/libgcc_s-4.1.1-20060525.so.1
08047000-08088000 r-xp 00000000 03:04 986576 /usr/bin/cobc
08088000-0808b000 rw-p 00040000 03:04 986576 /usr/bin/cobc
0808b000-08093000 rw-p 0808b000 00:00 0
0826e000-0828f000 rw-p 0826e000 00:00 0 [heap]
b7d19000-b7f19000 r--p 00000000 03:04 986421 /usr/lib/locale/locale-archive
b7f19000-b7f1a000 rw-p b7f19000 00:00 0
b7f24000-b7f26000 rw-p b7f24000 00:00 0
bfe10000-bfe25000 rw-p bfe10000 00:00 0 [stack]
Aborted
[krisda@programmer0 dev]$
----------------------------------------------------------------
Moving up to the 0.33 prerelease should fix this.
Download at :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
Roger
(OC Developer)
----------------------------------------------------------------
Subject: DISPLAY AND ACCEPT WITH SIZE OPTION.
I am amenable to additions/fixes :-)
(preferably against CVS/prerelease).
Roger
----------------------------------------------------------------
Why don't have Display and Accept statements the size option ?
example:
ACCEPT ..... LINE 1 COLUMN 1 SIZE 01
DISPLAY ..... LINE 1 COLUMN 1 SIZE 01
thank you.
----------------------------------------------------------------
Subject: OpenCOBOL 0.33 release forthcoming
OpenCOBOL 0.33 is going to be released this month in whatever state it is in !
I recommend getting the prerelease at :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
Note - This is usually a bit ahead of CVS over at SourceForge.
Changes are made to the tarball as and when I think they should be applied.
Do NOT rely on programs compiled with an earlier version running with a new tarball.
The CVS/tarball are prerelease and, as such, ALWAYS recompile application programs.
(And that means that programs compiled with a tarball from yesterday will NOT necessarily run with a tarball from today)
Please test and post comments.
Roger While
(Main OpenCOBOL developer)
----------------------------------------------------------------
Subject: FAQ - Multiple OpenCOBOL on one machine
Can I test OpenCOBOL versions alongside a production (installed) version ?
(Applies to 0.33)
Sure.
Just do the usual
> ./configure
> make
in the directory where the new OC source is
(eg. /home/20060608/open-cobol-0.33)
and STOP there without doing a "make install".
(You can of course do a "make check")
Then if you want to use this version -
. /home/20060608/open-cobol-0.33/tests/atconfig
. /home/20060608/open-cobol-0.33/tests/atlocal
Note the "." at the start, this changes your environment to
work with the "test" version of OC IN THE CURRENT shell.
Do NOT try to mix executables/modules produced by one version of OC with another.
I recommend using the (0.33) --with-patch-level=n
(default 0) option to the "./configure" to distinguish
between installations. This will make sure that no program/module will be executed that has not been compiled with the correct version.
(Do NOT do this for a production install)
All the above will be added to a FAQ in final release.
Roger While
(Main OC developer)
----------------------------------------------------------------
Subject: Final call - Please test 0.33 prerelease
Per subject at :
http://ww.sim-basis.de/open-cobol-0.33.tar.gz
Comments here or over at SourceForge.
Roger
(Main OC Developer)
----------------------------------------------------------------
i m using osx 10.4.6
got error msg as below:
/bin/sh ../libtool --tag=CC --mode=link gcc -fsigned-char -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-format-y2k -DSUPER_OPTIMIZE -O2 -finline-functions -fomit-frame-pointer -o libcob.la -rpath /usr/local/lib -version-info 1:0:0 -no-undefined libcob_la-common.lo libcob_la-move.lo libcob_la-numeric.lo libcob_la-intrinsic.lo libcob_la-termio.lo libcob_la-fileio.lo libcob_la-screenio.lo libcob_la-strings.lo libcob_la-call.lo -lm -ldb-4.4 -lgmp -lncurses
gcc -dynamiclib -o .libs/libcob.1.0.0.dylib .libs/libcob_la-common.o .libs/libcob_la-move.o .libs/libcob_la-numeric.o .libs/libcob_la-intrinsic.o .libs/libcob_la-termio.o .libs/libcob_la-fileio.o .libs/libcob_la-screenio.o .libs/libcob_la-strings.o .libs/libcob_la-call.o -lm /usr/lib/libdb-4.4.dylib /usr/local/lib/libgmp.a -lncurses -install_name /usr/local/lib/libcob.1.dylib -Wl,-compatibility_version -Wl,2 -Wl,-current_version -Wl,2.0
ld: common symbols not allowed with MH_DYLIB output format with the -multi_module option
/usr/local/lib/libgmp.a(mp_bpl.o) definition of common ___gmp_junk (size 4)
/usr/bin/libtool: internal link edit command failed
make[2]: *** [libcob.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
any clues?
thanks
----------------------------------------------------------------
Yep. Your GMP installation is borked
and/or you have wrong environment/options to
the OC configure.
What is the "/usr/local/lib/libgmp.a" doing
there ?
This is wrong, there is no default reference
to the static GMP library.
Roger
----------------------------------------------------------------
Roger. I, as like as other people, always appreciate your contribution.
I tried test 0.33 on my PC which is uing Windows 2000, MinGW, MSYS, and Berkeley DB 4.4.20.
And I got the following configure error.
libdb is required.
----------------------------------------------------------------
Well, the relevant part or all of the
"config.log" would help :-)
When you configured BDB, you did remember to specify
--enable-compat815 --enable-mingw ??
And you probably need a --prefix=
as well as BDB does not install in the usual
directories. Also make sure you install into
the MinGW environment (which is usually seperate
to the MSYS environment).
Roger
----------------------------------------------------------------
I've kinda just started but I'm using .33 to compile some utility programs I wrote ages ago. So far pretty painless.
----------------------------------------------------------------
Subject: Passing parameters to main program
I'm trying to compile a program that has a using clause on the procedure division but I get the error message below. The program is just hello world with a linkage section and using on the procedure division.
cobc gives me :
hello.cob:14: Error: Executable program requested but PROCEDURE/ENTRY has USING clause
How do you pass parameters to the main program?
----------------------------------------------------------------
The MicroFocus extensions to do this are implemented.
See the ACCEPT/DISPLAY syntax for COMMAND-LINE
ARGUMENT-NUMBER ARGUMENT-VALUE.
There are also extensions (ACU/MF) for getting/setting
environment values.
The MF language reference is online at www.microfocus.com
(Support->Product Documentation, then one of the
Server Express, ->Language Reference)
Roger
----------------------------------------------------------------
Thanks for the reply. That should work for me. Not exactly what I was hoping for but it's not so bad.
----------------------------------------------------------------
I am not sure what you were hoping for!
You might also like to look at the CHAINING (ACU Cobol) clause.
This is supported in the 0.33 prerelease.
Roger
----------------------------------------------------------------
What was I hoping for?
Oh, I have some mainframe cobol programs that take parameters from jcl. They pass them via linkage section and the using clause on the procedure division. I was hoping I wouldn't have to modify the source code but could use them as they are and the parameters would be passed the same way. I know using the accept clause instead isn't a big change but a change nontheless.
I'm going to open source them and now I'll have to have two versions.
Update: I suppose it would be easy enough to create a stub model just for the purpose of passing the command line to the first REAL program. That would way I could use the same exact source.
btw, ACCEPT xxxx FROM COMMAND-LINE is simple enough.
----------------------------------------------------------------
I found this:
"PROCEDURE DIVISION USING BY CONTENT etc. â€
↑
Parameter passing to the main program â€
If a main program has a USING clause, how should we pass parameters to it? Command line arguments or environment variables? What other compilers do? Note (Roger) - We now have the MF extended ACCEPT/DISPLAY syntax to reference command line argumants and manipulate environment variables."
So you did know what I was hoping for! :)
Since the ACCEPT FROM COMMAND-LINE works well, it seems it wouldn't be such a hard thing to reuse the code and do the same basic thing when there is a USING clause and it's being compiled with '-x'.
Perhaps there are bigger fish to fry but I think it would be worth keeping this on the list.
----------------------------------------------------------------
Well, the problem is that the standard
has seen fit to ignore interaction with
the environment (85, 2002 and 2008).
So, everybody did/does their own thing.
Generally speaking, it is wrong to have
a PROCEDURE USING in a main (executable) program.
Roger
----------------------------------------------------------------
I see.
In the mainframe world I have quite a few MAIN programs that can call one another and they all have PROCEDURE USING. So will ACCEPT work to pass parameters between MAIN programs?
----------------------------------------------------------------
Then they are not MAIN progs are they ? :-)
Roger
----------------------------------------------------------------
Sure they are. Just like in most other languages. Take C for instance. You can run a C program as a stand alone program or call it from another program. You can do this in most languages.
Perhaps I wasn't clear on how you were using the term 'MAIN'. I understood we were talking about MAIN as in what is commonly referred to as stand alone or what would make up the executable. If that's the definition we're using, then yes, they are MAIN programs.
I don't know what other definition you'd have for MAIN.
At any rate, MAIN programs should be able to call each other and pass data back and forth. I was just asking how you pass data between main programs.
----------------------------------------------------------------
Ok. The combination of the ACCEPT statement to get values passed via the command line and making variables EXTERNAL gives the same basic functionality and works well. And I read a bit about there being no standard on the mechanism of programs calling each other. Seems funny to me that wouldn't be in the standard. Oh well.
So now the question is, "Is there a performance benefit/cost to using external variables instead of linkage?"
----------------------------------------------------------------
I think you are mixing apples, oranges and pears here :-)
The ACCEPT for environment values has nothing to do
with the EXTERNAL declaration. Neither of these have
anything to do with the mechanism of program calling
(which IS well defined in the standard, as is EXTERNAL).
To the question, well that depends on what you want to do :-)
Simple example showing difference :
Progs A and B both want to call prog C and pass info
in "myfield".
Scenario 1 with EXTERNAL
Progs A, B and C all have eg in WORKING
01 myfield pic ... EXTERNAL.
Progs A and B fill myfield and do
CALL "C".
Scenario 2 with LINKAGE
Progs A and B have eg. in WORKING
01 myfield pic ....
Progs A and B fill myfield and do
CALL "C" USING myfield.
Prog C has LINKAGE myfield
and PROCEDURE USING myfield
In scenario 1, note that myfield is the SAME
storage area for all progs, so that changes made
by prog A will be seen by prog B and vice-versa.
(And of course by prog C)
Possible problem here is that some prog
(eg. A or B) forgets the EXTERNAL attribute in
which case C is operating on a freshly initialized
storage area (And you will not know it).
In scenario 2, the areas being passed to C are distinct.
Possible problem here is that the calling prog forgets
to pass the parameter (CALL "C"), in which case
you get all you asked for :-)
Personally, I can only think of (maybe) one
reason to use EXTERNAL and that is with a heavily nested
call sequence.
eg Prog A calls Prog B calls Prog C calls Prog D ...
and the last Prog needs some info from Prog A.
(However this is frought with danger as you must make sure
that the last program is only reachable through the call sequence from Prog A).
Roger
----------------------------------------------------------------
Roger,
I can see how you'd think I'm mixing apples and oranges but I know pretty well how external files and data and linkage works. My problem is I worked so long with cobol that allows USING on the PROCEDURE DIVISION I forgot all about the possibility of using EXTERNAL in COBOL.
I have several utility programs I created years ago that make use of USING on the PROCEDURE DIVISION for both main and subprograms. Mostly it has to do with how control data is passed to the program.
e.g. I have a string replacement program. It can be used in 3 different 'modes' if you will. The format of the parm passed to it is ';STRING1;STRING2;' where the first ';' is the delimiter to be used to delimit the rest of the parm, STRING1 = the string that will be replaced by STRING2 and STRING2 is the string that will replace STRING1. This parm can be a couple thousand bytes long. STRING1 and STRING2 can be repeated as needed.
Modes
1. Called as the MAIN program where the PARM isn't too long and is passeed either via JCL parm or command line. On the MAINFRAME this only works if there aren't too many string to be replaced because the PARM can only be 100 bytes long. On other platforms where the command line PARMS can be longer, this isn't very practical when there are too many strings to be replaced.
2. Called as the MAIN program where the PARM is too long to really be practical or even possible depending on the platform so it will be read in from a file. In this mode, the PARM is passed via the command line or JCL but the first byte of the PARM(the only byte that is used in this situation) is an 'F' to indicate the PARM data is being read from a file. One of the first things the program does is check the first byte of the parm. If it's an 'F' it then reads the parm file and process each row as if the program were called one per line in the file. If it's not an 'F' the program continues like normal.
3. Called from another MAIN program. In this mode the program that calls the string replacement program and passes a PARM in the format discussed in either 1 or 2 above.
This makes the program more flexible. By the way, this is a pretty common way of passing parameters in the computing world. For instance many of the *nix utility programs can be called from other programs and can take command line parms and have a command line parm that means, "read the parm to act on from a file."
So, that's the behavior I want to keep for these programs when I convert them for use in linux. That's where ACCEPT from COMMAND line and EXTERNAL varialbes come in.
By just changing a few lines of code in each program, I can use this combination to pass data from both the command line and between main programs. While I'd rather just be able to use 'USING' on the procedure division in the MAIN program, this will work well enough for my needs and won't be TOO big of a bear when I make changes on one platform and want to sync of the code of the different platforms.
As you pointed out there are pitfalls to look out for. They shouldn't cause me any problems. It's pretty typical for me to work on systems with hundreds of COBOL programs calling each other so I check my linkage section pretty well. It's also relatively common in these systems that every program gets passed the exact same linkage section.
In this case I'll just treat the external variables very much like they are linkage. Since I won't be using a linkage section on the non mainframe versions, I'll likely keep them in the linkage section but comment out the LINKAGE SECTION line so they're really WORKING STORAGE.
So basically, many of the COBOL programs I write take PARMS, can be used as stand alone or called from another program, and take a switch that is used to indicate that the REAL parm is to be read from a file.
I don't want to change that. Actually, when I design a program this is the default and I have to find a reason not to build this functionality in.
And if you can't use USING on a MAIN program, this seems to be the only way to accomplish this.
Is there another?
Jason
----------------------------------------------------------------
I decided to just create a program that takes in the name of a program to call and the paramater you want to pass to it. This will let me use the same source for the mainframe, windows, and linux platforms.
So in the non mainframe world, this program is the program that gets called first. It in turns calls the program you tell it.
It's a simple enough program but if anyone likes, post here and I'll send the source.
At some point, I'll probably make a patch to enable this to work as it does in the mainframe. Until I do or someone else does, this is a pretty painless work around.
Jason
----------------------------------------------------------------
I think I know where you are heading but it won't work.
PROCEDURE USING is defined/reserved for called
programs. It is NOT a way to pass runtime parameters.
Maybe it did work on some mainframe install but
we will not take this over (and it will NOT work
with eg. MF or ACU). One way of passing
runtime params is using CHAINING which is an ACU
extension supported by OC.
Also consider (abbreviated) :
LINKAGE.
01 MYFLD ..
PROC DIV.
ENTRY "MYENT" USING MYFLD.
and
LINKAGE.
01 MYFLD ..
PROC DIV USING MYFLD2.
ENTRY "MYENT2".
or any derivation of the above.
The basic problem is, as I said, lack of standards.
We will NOT/NEVER interpret PROC USING params as
command line params UNLESS the CHAINING command is used.
Roger
----------------------------------------------------------------
Subject: FOSS ISPF like editor
I'm just guessing there are at least some mainframers here who'd rather edit cobol programs in an ispf type editor. Well here's a free one I've used in linux and windows. The author actively maintains it and is responsive.
This is the only free editor I've seen that's pretty close to the ispf editor. I'm posting here just because I haven't seen this in many of the free editor sites I've seen and figure you might not have heard of it.
http://www.geocities.jp/sakachin2/index.htm
----------------------------------------------------------------
If you give this a try please post here and let us know how it went.
----------------------------------------------------------------
This editor, in my humble opinion, is getting closer and closer to ispf as far as the editor stuff is concerned.
Some of the recent updates to this editor include:
* Typematic support for Right-Control key(can be used as newline)
* Crosshair support
* Linux version is now packaged by libtool to enable installing from source by "./configure && make"
* bounds support
* text flow support
* large file support >4g
* find support added to the directory lists.
* added 3.12 & 3.14 interface to the file search and file compare that comes with gxe. not exactly like the mainframe versions but kinda similar.
----------------------------------------------------------------
Subject: DISPLAY ... UPON STDERR
I can't figure out how to send the display to stderr. Display ... upon stderr gives me -> warning: 'stderr' undefined in SPECIAL-NAMES
Same thing with syserr. If I define it in special-names, the compile is clean, but nothing comes out anywhere. What am I missing? Thanks in advance.
Never mind... Just tried it with 0.33 and it works great.
----------------------------------------------------------------
Yep, 0.33 is light-years ahead of 0.32 :-)
(That's why it is taking so long to get the release out)
I will put together a post with the 0.33
features in the near future.
In the meantime you can peruse the ChangeLog
file in each directory (top level included)
Roger
----------------------------------------------------------------
Subject: INTRINSIC FUNTIONS
I noticed that the documentation says that intrinsic functions aren't implemented so I took the ones I was using out. Turns out I forgot some but they worked just fine. Aren't intrinsic functions the things you call like this?
FUNCTION UPPER-CASE('Hello World')
----------------------------------------------------------------
They are implemented in 0.33.
And, yes, that is a valid example.
If, after the usual configure/make,
you run "make check", you see the OC
tests for FUNCTION's ala:
99: FUNCTION ABS ok
100: FUNCTION ACOS ok
101: FUNCTION ANNUITY ok
102: FUNCTION ASIN ok
103: FUNCTION ATAN ok
104: FUNCTION CHAR ok
105: FUNCTION COS ok
106: FUNCTION DATE-OF-INTEGER ok
107: FUNCTION DATE-TO-YYYYMMDD ok
108: FUNCTION DAY-OF-INTEGER ok
109: FUNCTION DAY-TO-YYYYDDD ok
110: FUNCTION EXCEPTION-FILE ok
111: FUNCTION EXCEPTION-LOCATION ok
112: FUNCTION EXCEPTION-STATEMENT ok
113: FUNCTION EXCEPTION-STATUS ok
114: FUNCTION EXP ok
115: FUNCTION FACTORIAL ok
116: FUNCTION FRACTION-PART ok
117: FUNCTION INTEGER ok
118: FUNCTION INTEGER-OF-DATE ok
119: FUNCTION INTEGER-OF-DAY ok
120: FUNCTION INTEGER-PART ok
121: FUNCTION LENGTH ok
122: FUNCTION LOG ok
123: FUNCTION LOG10 ok
124: FUNCTION LOWER-CASE ok
125: FUNCTION MAX ok
126: FUNCTION MEAN ok
127: FUNCTION MEDIAN ok
128: FUNCTION MIDRANGE ok
129: FUNCTION MIN ok
130: FUNCTION MOD ok
131: FUNCTION NUMVAL ok
132: FUNCTION ORD ok
133: FUNCTION ORD-MAX ok
134: FUNCTION ORD-MIN ok
135: FUNCTION PRESENT-VALUE ok
136: FUNCTION RANGE ok
137: FUNCTION REM ok
138: FUNCTION REVERSE ok
139: FUNCTION SIGN ok
140: FUNCTION SIN ok
141: FUNCTION SQRT ok
142: FUNCTION STANDARD-DEVIATION ok
143: FUNCTION STORED-CHAR-LENGTH ok
144: FUNCTION TAN ok
145: FUNCTION VARIANCE ok
Roger
----------------------------------------------------------------
Good thing I tried .33!
----------------------------------------------------------------
Subject: COBOL runtime for SCO release 3.2 v4.2
Hi,
I'm suddenly faced with the need for a cobol runtime (runcobol)on my SCO release 3.2 v4.2 NCR computer (recovering from a hard disk failure). Although I was able to find the OS recovery floppy disks and tape, I could not find any COBOL runtime diskettes. Can anyone recommend a runtime other than Liant Software? Is the "runcobol" program something I can obtain from the OpenCOBOL project? Thank you one and all for your help.
----------------------------------------------------------------
No, you are out of luck.
Executables and libraries are NOT
interchangable.
Better boot up a Linux sytem :-)
Roger
----------------------------------------------------------------
Subject: cob_init from within COBOL program
What's the equivalent cobol call for the C call cob_init(0,NULL); ?
I'm porting DB2/VSE (Mainframe) stored procedures written in COBOL to Linux. With a few minor changes and a wrapper program written in C to call cob_init, it works great. The stored procedure has to take parameters, so it needs a linkage section and a procedure division with using. I'd love to get rid of that wrapper program and just call cob_init from within the program itself.
I am really impressed with the work you guys have done. Keep up the good work. Thanks.
----------------------------------------------------------------
There isn't one :-)
By the time the first COBOL statement is executed,
is the the check for cob_init already done.
Roger
----------------------------------------------------------------
OK. With that in mind, do you have a philosophical problem with maybe adding another flag to generate a cob_init(0,NULL) call from within a module, if cob_init hasn't already been called?
My problem is, I don't have control over the calling program, which loads the module dynamically. I made minor changes to the source to suit my purposes (and it works great), but I'd rather not maintain it if I don't have to. If you're interested, I can send you a patch. If you're not interested, I'll keep it to myself.
----------------------------------------------------------------
Patches always welcome.
(diff -u format against latest prerelease)
IIRC, we did this at some stage. There was some
sort of problem involved. I will have to see
if I have my old notes available to find out why.
Roger
----------------------------------------------------------------
Here's the cvs diff -u against the CVS on sourceforge. I've used this to port stored procedures from DB2 on VSE to DB2 on Linux and, so far, it has been pretty straight forward.
Dan
Index: cobc/cobc.c
===================================================================
RCS file: /cvsroot/open-cobol/open-cobol/cobc/cobc.c,v
retrieving revision 1.201
diff -u -r1.201 cobc.c
--- cobc/cobc.c 26 Jul 2006 12:39:20 -0000 1.201
+++ cobc/cobc.c 1 Aug 2006 17:34:11 -0000
@@ -86,6 +86,7 @@
int cb_id = 1;
int cb_flag_main = 0;
+int cb_flag_auto_init = 0;
int errorcount = 0;
int warningcount = 0;
@@ -148,9 +149,10 @@
static const char fcopts[] = " ";
#endif
-static char short_options[] = "hVvECScmxOgwo:t:I:L:l:";
+static char short_options[] = "ahVvECScmxOgwo:t:I:L:l:";
static struct option long_options[] = {
+ {"autoinit", no_argument, NULL, 'a'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
/* getopt_long_only has a problem with eg. -xv - remove
@@ -376,6 +378,7 @@
" -C Translation only; convert COBOL to C\n"
" -S Compile only; output assembly file\n"
" -c Compile and assemble, but do not link\n"
+ " -a Auto init, used for standalone modules with no argc / argv\n"
" -t Place the listing into \n"
" -I Add to copybook search path\n"
" -L Add to library search path\n"
@@ -464,6 +467,9 @@
wants_nonfinal = 1;
cb_compile_level = CB_LEVEL_ASSEMBLE;
break;
+ case 'a':
+ cb_flag_auto_init = 1;
+ break;
case 'm':
if (cb_flag_main) {
fprintf (stderr, "Only one of options 'm', 'x' may be specified\n");
Index: cobc/cobc.h
===================================================================
RCS file: /cvsroot/open-cobol/open-cobol/cobc/cobc.h,v
retrieving revision 1.99
diff -u -r1.99 cobc.h
--- cobc/cobc.h 2 Jul 2006 10:10:21 -0000 1.99
+++ cobc/cobc.h 1 Aug 2006 17:34:12 -0000
@@ -86,6 +86,7 @@
extern int cb_id;
extern int cb_flag_main;
+extern int cb_flag_auto_init;
extern int errorcount;
extern int warningcount;
Index: cobc/codegen.c
===================================================================
RCS file: /cvsroot/open-cobol/open-cobol/cobc/codegen.c,v
retrieving revision 1.588
diff -u -r1.588 codegen.c
--- cobc/codegen.c 26 Jul 2006 12:39:20 -0000 1.588
+++ cobc/codegen.c 1 Aug 2006 17:34:17 -0000
@@ -3188,9 +3188,15 @@
output_line ("if (unlikely(initialized == 0))");
output_indent (" {");
/* output_stmt (cb_build_assign (cb_return_code, cb_int0)); */
- output_line ("if (!cob_initialized) {");
- output_line (" cob_fatal_error (COB_FERROR_INITIALIZED);");
- output_line ("}");
+ if (cb_flag_auto_init) {
+ output_line ("if (!cob_initialized) {");
+ output_line (" cob_init (0,NULL);");
+ output_line ("}");
+ } else {
+ output_line ("if (!cob_initialized) {");
+ output_line (" cob_fatal_error (COB_FERROR_INITIALIZED);");
+ output_line ("}");
+ }
output_line
("cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL);");
if (prog->flag_screen) {
----------------------------------------------------------------
Yes, idea is good.
Couple of nitpicks -
I have the "a" option slated for 0.34 development.
No big problem as I want to revise the whole options/flags
stuff for 0.34. So we can do this for 0.33.
There is also an alternative in using "-fxxxx";
see cobc/flags.def. (Which, on reflection, might be
a better idea; we have enough clutter in the options already)
Bigger problem is possible confusion between this
and the configuration variable "auto-initialize"
(see config/default.conf) and it's attendant
C variable cb_auto_initialize.
Maybe we should use something like "autoarg".
Let me think about this.
I'll get back later today.
Roger
----------------------------------------------------------------
Roger,
This was just my throw-together solution. Whatever works for you and OpenCOBOL, I can adjust to. Thank you.
Dan
----------------------------------------------------------------
Sorry, I meant to post yesterday but
had to take the wife to the airport.
I will cook something up and post
when the tarball is ready.
Roger
----------------------------------------------------------------
OK. New tarball up as usual at :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
cobc --help should give you the option :-)
It's -fimplicit-init
This, of course, will be in 0.33 release.
Roger
----------------------------------------------------------------
Subject: Lock mode and keys
symbasys? Don't know them :-)
What's the problem ?
The messages are quite clear :-)
So, no, nobody can help you :-)
If you mean when are these features going to
be implemented, I cannot say.
As mentioned in another thread, I am the only active OC developer at the moment and I do have a full-time job.
(Which does NOT include OC development)
Therefore, if anybody wants to start coding this
stuff, please do so and get in contact with me.
(Based on CVS or tarball)
Roger
----------------------------------------------------------------
I've downloaded from symbasys.de latest release.
Compilation still gives me:
LOCK MODE not implemented
SPLIT KEYS not implemented
READ ... WITH LOCK not implemented
Can anyone help me?
Thanks
----------------------------------------------------------------
Subject: Access to the Windows API.
Is it possible to access the WinApi with Opencobol?; e.g. via
call WINAPI "FunctionName"
If not, is there another way to implement http-access (e.g. downloading a file from a Webserver)?
Also: are there other modules implemented for Windows which can be accessed via
call "Module_Name" ?
I use the pre-compiled Windows binary, version 0.33.
thanks and keep
up the good work.
----------------------------------------------------------------
No, Yes(non-Win) and No :-)
With Linux, to retrieve a file from the
web you can do something like :
01 MYDOWN PIC X(128) VALUE
"wget http://server/filename 1>/dev/null 2>&1".
CALL "SYSTEM" USING MYDOWN.
IF RETURN-CODE = 0
... OK
ELSE
... It didn't work
END-IF.
This is immensely simplified; see the man pages for wget.
Note "SYSTEM" just recently implemented in tarball.
Roger
----------------------------------------------------------------
Subject: error in running cobol program
after compiling hello.cob when i run it i got following error
error while loading shared libraries : libcob.so.1 : cannot open shared object file : no such file or directory
how can i resolve this problem
----------------------------------------------------------------
I do not know :-)
My crystal ball does not seem to be working :-)
What OC release ?
What system ?
For the 0.33 prerelease, have you read
the README ?
Did you take note of information when you did
a make install ?
eg: (from a make install)
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
Roger
----------------------------------------------------------------
I have the same problem on SuSe linux 9.0 and libraries are in /usr/local/lib and this path is in ld.conf
Help !
----------------------------------------------------------------
Run (as root) "ldconfig".
It's in the 0.33 README :-)
Roger
----------------------------------------------------------------
Thank you it's work ! I have installed the 0.32 release.
It's fine to include this remark in the 0.33 release !
----------------------------------------------------------------
Install 0.33 !
Roger
----------------------------------------------------------------
I still have this problem with version 0.33
Please help!
----------------------------------------------------------------
Read the second post in this thread !!
How the **** can I help when NO details
are provided ? !!!
This is like faxing your local garage saying
"Hi, My car has stopped working, help" :-)
Roger
----------------------------------------------------------------
Subject: Calling sub-programs
Is it possible to call subprograms using openCOBOL? I'm not sure they're called "subprograms", but basically I want to use a CALL command followed by the alias or filename of another executable cobol program in the same directory. This was possible on COBOL 85.
----------------------------------------------------------------
Yes, of course.
What use would a Cobol compiler be without
being able to support the CALL statement :-)
Roger
----------------------------------------------------------------
Ok.. I can't seem to get this to work. It's probably something obvious. To clarify, here's what I'm trying to do. I wrote to programs MAIN_PROGRAM.cob and SUB_PROGRAM.cob, compiled them, and their executables are sitting in my directory. I run the MAIN_PROGRAM "./MAIN_PROGRAM". Within my MAIN_PROGRAM I've got a CALL statement "CALL SUB_PROGRAM" (SUB_PROGRAM is also the Program_ID for SUB_PROGRAM.cob). When MAIN_PROGRAM runs, I get an error message stating that "module SUB_PROGRAM" could not be found.
Anyone see what I'm doing wrong?
----------------------------------------------------------------
"and their executables are sitting in my directory"
Did you compile both programs with "-x"?
That's wrong.
Modules (sub-programs) should be compiled with "-m".
ie.
cobc -x MAIN_PROGRAM.cob
cobc -m SUB_PROGRAM.cob
./MAIN_PROGRAM
In fact, it is easier to compile everything as
modules and then execute your "main" program
with "cobcrun". ie.
cobc -m MAIN_PROGRAM.cob
cobc -m SUB_PROGRAM.cob
cobcrun MAIN_PROGRAM
Roger
----------------------------------------------------------------
That fixed it. Thanks very much.
----------------------------------------------------------------
Subject: Possible memory overflow causing issue
Given the following definition in cobol:
-----------------------------------------------------
01 MY-REC-LINES.
05 AAAAAAAAAAAAAAAAA PIC 9(4) COMP SYNC VALUE 125.
05 BBBBBBBBBBB PIC X(4) VALUE 'XXXX'.
05 CCCCCCCCCC.
10 FILLER PIC X(30) VALUE
'111111111111111111111111111111'.
10 FILLER PIC X(25) VALUE
'2222222222222222222222222'.
10 FILLER PIC X(34) VALUE
'3333333333333333333333333333333333'.
10 FILLER PIC X(31) VALUE
'4444444444444444444444444444444'.
10 FILLER PIC X(33) VALUE
'555555555555555555555555555555555'.
10 FILLER PIC X(42) VALUE
'666666666666666666666666666666666666666666'.
10 FILLER PIC X(45) VALUE
'777777777777777777777777777777777777777777777'.
10 FILLER PIC X(27) VALUE
'888888888888888888888888888'.
10 FILLER PIC X(38) VALUE
'99999999999999999999999999999999999999'.
05 DDDDDDDDDDDDD PIC 9(4) COMP SYNC VALUE 305.
05 EEEEEEEEEEEEEEE.
10 EEEEEEEEEE-KEY PIC 9(8).
-----------------------------------------------------
The cobol compiler generates the following C code
static cob_field f_104 = {2, b_103, &a_388}; /* AAAAAAAAAAAAAAAAA */
memcpy (b_103 + 2, "XXXX", 4);
memcpy (b_103 + 6, "111111111111111111111111111111", 30);
memcpy (b_103 + 36, "2222222222222222222222222", 25);
memcpy (b_103 + 61, "3333333333333333333333333333333333", 34);
memcpy (b_103 + 95, "4444444444444444444444444444444", 31);
memcpy (b_103 + 126, "555555555555555555555555555555555", 33);
memcpy (b_103 + 159, "666666666666666666666666666666666666666666", 42);
memcpy (b_103 + 201, "777777777777777777777777777777777777777777777", 45);
memcpy (b_103 + 246, "888888888888888888888888888", 27);
memcpy (b_103 + 273, "99999999999999999999999999999999999999", 38);
static cob_field f_116 = {2, b_103 + 312, &a_388}; /* DDDDDDDDDDDDD */
I would have expected field f_116 should start at offset
311 instead of 312 ... this could potentially overrun the
b_103 buffer as we keep assigning the other fields to the
various offsets in b_103.
One of the fields in our pgm was getting reset to an
invalid value ... this could be the cause ?
Rgds
Bhaskar
----------------------------------------------------------------
It is perfectly correct.
You defined DDDDDDDDDDDDD with SYNC
so (for this 2 byte field) that gets allocated on an even byte boundary ie. 312.
Total size of MY-REC-LINES is 322, also correct.
The only way to get SYNC ignored is to specify
-std=mf as compile option (but that may not be what you
want)
Roger
----------------------------------------------------------------
Subject: strange results using SUBTRACT or ADD, but using COMPUTE works fine
Dear All,
I am seeing strange results when using "SUBTRACT" or "ADD":
[code]
ID DIVISION.
PROGRAM-ID. SUBSTRACT.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INDATE PIC 9(8) VALUE 20060807.
01 OUTDATE PIC 9(8) VALUE ZERO.
01 OUTDATE-FILLER1 REDEFINES OUTDATE.
05 OUTDATE-YY PIC 9(4).
05 OUTDATE-MM PIC 9(2).
05 OUTDATE-DD PIC 9(2).
PROCEDURE DIVISION.
BEGIN-PGM.
DISPLAY "INDATE = " INDATE.
DISPLAY "USING COMPUTE ...".
MOVE INDATE TO OUTDATE.
DISPLAY " OUTDATE BEFORE = " OUTDATE.
COMPUTE OUTDATE-DD = OUTDATE-DD - 1.
DISPLAY " OUTDATE AFTER = " OUTDATE.
DISPLAY "USING SUBTRACT 1 ...".
MOVE INDATE TO OUTDATE.
DISPLAY " OUTDATE BEFORE = " OUTDATE.
SUBTRACT 1 FROM OUTDATE-DD.
DISPLAY " OUTDATE AFTER = " OUTDATE.
DISPLAY "USING ADD -1 ...".
MOVE INDATE TO OUTDATE.
DISPLAY " OUTDATE BEFORE = " OUTDATE.
ADD -1 TO OUTDATE-DD.
DISPLAY " OUTDATE AFTER = " OUTDATE.
STOP RUN.
[/code]
result:
[code]
INDATE = 20060807
USING COMPUTE ...
OUTDATE BEFORE = 20060807
OUTDATE AFTER = 20060806
USING SUBTRACT 1 ...
OUTDATE BEFORE = 20060807
OUTDATE AFTER = 20060894
USING ADD -1 ...
OUTDATE BEFORE = 20060807
OUTDATE AFTER = 20060894
[/code]
tested with OpenCOBOL 0.31 on SunOS/Sparc and OpenCOBOL 0.32 on Linux/intel.
Could anyone help me ?
THX!
----------------------------------------------------------------
now I have tested it with the OpenCOBOL 0.33 Prerelease (on Linux/intel) and the problem seems to be fixed.
Thanks again for your nice work!
----------------------------------------------------------------
Subject: Migration from Microfocus Cobol to OpenCobol
Hi,
I'm a beginner in CObol, but I try to migrate from hp microfocus cobol on hp-unix to open cobol on linux platform, unfortunately I have some messages :
1- Permanent file error (STATUS=30)
2- Level 01 item cannot have occurs clause
5- Alphanumeric value is expected
How to debug programs with gdb?
Thanks for help
----------------------------------------------------------------
cobc --help
is a good start :-)
Move up to 0.33 prerelase if you have not
already done so.
Generally, if you are coming from MicroFocus,
then the first thing to check is if you
were (with MF) implicitly or explicitly using
the IBMCOMP option (Note this can be implicitly
set by other options eg. DIALECT; check your MF doc).
If you did NOT have the IBMCOMP option, then
you probably should start with the "-std=mf"
OC option.
If you DID have the IBMCOMP option, then you
probably need one of the "-std=mvs",
"-std=bs2000", "-std=ibm" OC options.
You can look at "config/default.conf" for the
default configuration settings and, then, the
individual "xxx.conf" (eg. bs2000.conf) files to see what is overridden.
For debugging, look at the "-debug" and "-ftrace"
options.
Roger
----------------------------------------------------------------
Hi,
Got these problems when migrating:
- (STATUS =30), most of the time it's a bad ASSIGN order.
with MF you can write :
ASSIGN "TMPDIR/WRKFILE"
MF understand that the file named WRKFILE is located at $TMPDIR variable substitution
OC doesn't so change like that:
ASSIGN "$TMPDIR/WRKFILE"
you can change all your assign commmands by a sed command.
- Level 01 item can not have occurs.
MF authorise to declare:
01 THINGS OCCURS 10.
means you declare a array of 10 elements called THINGS. and you use THINGS(1),THINGS(2)... THINGS(I)
With OC you must declare the array on an other level than 01 and so create a 01 level:
01 MANY-THINGS.
03 THINGS OCCURS 10.
- alphanumeric value... not encoutered but I've already seen that MF is quiet cool with variables declared as characters and used as integers or vice-versa
----------------------------------------------------------------
- ASSIGN "TMPDIR/WRKFILE"
No, from the MF File Handling reference manual -
****
In this example, opening input-file opens the file prog in the data directory (relative to the current directory):
select input-file
assign to "data/prog".
****
- Level 01 item can not have occurs.
Depends on compiler option, one of
-std=mf, -std=ibm, -std=mvs, -std=bs2000
will allow this.
(Specifically, it is the top-level-occurs-clause
clause in the xxx.conf file in the config directory)
----------------------------------------------------------------
- ASSIGN "TMPDIR/WRKFILE"
I agree that this syntax means to assign file "WRKFILE" in directory "TMPDIR".
But I see hundreds of cobol lines compiled with MF OCS 4.2 on AIX 4.3 which understand it as "$TMPDIR/WRKFILE"... I don't know why but I know it works like that on my site + 40 other sites using the same product and MF (OCS or Express)
----------------------------------------------------------------
Not quite.
You are almost correct.
Refer to chapter 3.3 Filename Mapping
in the File Handling reference.
MF will NOT look for env variable TMPDIR.
It WILL however look for dd_TMPDIR or
DD_TMPDIR.
(Tested with Server Express 2.2 and 4.0)
Note that this is very MF specific and
extremely non-portable.
A simple ASSIGN "WRKFILE" with appropiate
mods to the JCL is the way to go :-)
Having said all that, I will take a look at being
more MF compatible.
Note that for simple names (eg. "WRKFILE"), we already
do filename mapping ie. We check for env variables
DD_WRKFILE, dd_WRKFILE and WRKFILE in that order.
----------------------------------------------------------------
Things become clearer...
I now understand better why a variable DD_TMPDIR is set on my system... and is the same value than TMPDIR.
But my cobol "select" statements refers to TMPDIR for sequential files or indexed sequential files and not DD_TMPDIR... Strange...
----------------------------------------------------------------
Not strange, that's what MF does.
As I said, refer to the File Handling
reference manual.
Excerpt from Chapter 3.3 (delimited asterisks)
******************************
3.3 Filename Mapping
This COBOL system provides several ways of mapping the filename supplied by the program via the ASSIGN clause onto a different name, for greater flexibility at run time.
When the File Handler is presented with a filename (which may be a literal, the contents of a data item, or, in the case of the ASSIGN TO EXTERNAL syntax, an external reference), it isolates the first element of that name, that is, all the text before the first slash character (/), all the text if the name does not include such a character, or nothing if the filename starts with a slash character. Having done that, it:
Removes the leading dollar character ($) if it is present, prefixes the characters "dd_" to this first element and searches for an environment variable with this name.
If it does not find this environment variable and either the ASSIGN EXTERNAL syntax was used or the first element of the filename began with a dollar character, it looks for an environment variable with the same name as the first element (minus the leading dollar character if present).
If the search is unsuccessful, the original filename is left unchanged, except in the case where the name begins with a dollar character and contains at least one slash character. In this case, the whole of the first element, together with the first slash is removed from the name.
The result is then considered to be the filename of the physical file.
Consider the following examples:
*****************************************************
Note that although not specifically mentioned, it also
prefixes and looks for "DD_" (note upper case).
The MF documentation is online through
www.microfocus.com, Support, Product Documentation
and then select a flavour of Server Express and then
File Handling.
----------------------------------------------------------------
OK, all is clear now. I haven't correctly understood the previous message.
----------------------------------------------------------------
As an addendum, note that the environment variable
"TMPDIR" is used by MF (and OC) for other purposes.
It is used for compiler temporary (intermediate) files
and also by SORT for intermediate files.
See MF Users Guide(SE 2.2) Chapter 6.2 and Appendix A.
Roger
----------------------------------------------------------------
Subject: Need help understanding Cobol
I got a specification for a report format I need to understand. It is explained using some Cobol stuff, but I've never read Cobol and noone else around can help me.
Can anyone explain how to parse:
Pic -(10)9,99
How many bytes is it? What is a valid value?
After reading an old Cobol book I thought it was 14 bytes and a valid value was "-1234567890,00", but that doesnt look right...
----------------------------------------------------------------
It is 14 bytes, however be careful.
If the last two places are supposed to represent
a fractional part, then you will need the
DECIMAL-POINT IS COMMA clause in SPECIAL-NAMES
if the picture is as stated.
Let's look at examples.
Given 2 values eg. 1234567890.99 and -98.76
With no DECIMAL-POINT clause -
PIC -(10)9,99
gives
" 12345678,90"
" -0,98"
Do you see why? The "," is just an editing symbol,
so only the integer part of the value is represented.
Now lets look at
PIC -(10)9.99
gives
" 1234567890.99"
" -98.76"
** NOTE **
Posting seems to screw up the spacing; all values between
the quotes in the above examples are 14 characters and right-justified.
Note also that the left most place is always reserved for
a possible negtive sign, so that a maximum of 10 digits for the integer part can be represented.
(If larger, it will be left-truncated)
As stated above, the DECIMAL-POINT clause affects this behaviour.
Roger
----------------------------------------------------------------
Subject: configure on 64-bit: bdb >=4.1 test seg fault solution
On a 64-bit Linux, the configure gets segmentation faults testing for the version of BDB. The test program needs a
#include
to get past it. For some reason it wasn't a problem on 32-bit.
--Dan
----------------------------------------------------------------
Hmm. What BDB version ?
This would imply either :
a) Something wrong with your include files
(unlikely when this is a normal Linux distro)
b) BDB is missing an include in "db.h".
This is likely to be the problem.
The question is, what does BDB need from stdlib.h
that is dependent on 32/64 bit ?
OK, we can put in extra include(s) in the configure
but this is really a BDB problem.
Roger
----------------------------------------------------------------
I have updated the configure in the 0.33 prerelease.
Roger
----------------------------------------------------------------
It's actually a getenv problem.
Dan
----------------------------------------------------------------
Ahh, yes, prototype for getenv is in stdlib.h.
Well spotted.
Roger
----------------------------------------------------------------
Subject: libcob.conf
Is there a way I can set defaults with this file?
For example, I would like to set -free, so as to not have to type it every time i compile something.
I cant seem to find any documentation on this file.
Ian Sulzer
----------------------------------------------------------------
Maybe because it does not exist :-)
Currently there is no way to set free as the
default.
For info, the Cobol standards require that fixed
format is the default.
Easy way is to set up your own script for compiling
and make sure it is somewhere in your "$PATH".
eg. Here is a stripped down example of something
I use for a mainframe app that :
a) Has upper-case names and ".CBL" as suffix.
b) Assumes that the programs reside in
directory "$SRC" and that COPY's reside in
directory "$CPYDIR" (which may be the same as $SRC)
(Both default to current directory if not set)
c) There is a temporary directory ("$TMP") for
error lists (defaults to "/tmp")
If this script is called "occomp" and I have
progs PROG1.CBL, PROG2.CBL, etc., then I can do eg.
occomp prog1 prog2.cbl
or
occomp PROG1.cbl PROG2
or
occomp prog1 prog2
You can, of course, have various scripts for various
compile options eg. for debug.
Roger
The script :
(Posting seems to screw up spacing/tabbing,
so this may appear very strange. In the original
and this post it is correctly tab indented)
#
# shell script to compile a COBOL program under OpenCobol.
#
# Note in this example, it is assumed that programs have upper-case
# names and use the suffix ".CBL"
#
LANG=C; export LANG
if [ ${#} -lt 1 ]
then
echo "Missing parameter(s)"
exit 1
fi
export EXVAL=0
if [ -z "${TMP}" ]
then
export TMP="/tmp"
fi
if [ -z "${SRC}" ]
then
export SRC="."
fi
if [ -z "${CPYDIR}" ]
then
export CPYDIR="."
fi
cd ${SRC}
for ARG in ${*}
do
INP=`echo ${ARG} | tr "[a-z]" "[A-Z]"`
INP=`basename ${INP} .CBL`
if [ ! -r ${INP}.CBL ]
then
echo "${INP}.CBL does not exist in ${SRC}"
continue
fi
rm -f ${TMP}/${INP}.lst
echo "Compile ${INP} start at `date`"
rm -f ${INP}
rm -f ${INP}.o
rm -f ${INP}.so
cobc -O2 -fixed -std=mvs -I${CPYDIR} -m ${INP}.CBL 1>${TMP}/${INP}.lst 2>&1
RETVAL=${?}
ERRORS=""
if [ ${RETVAL} -ne 0 ]
then
EXVAL=1
ERRORS="(Errors found)"
echo "Errors found - listing in ${TMP}/${INP}.lst"
rm -f ${INP}
rm -f ${INP}.o
rm -f ${INP}.so
else
rm -f ${INP}.o
rm -f ${TMP}/${INP}.lst
fi
echo "Compile ${INP} end at `date` ${ERRORS}"
done
exit ${EXVAL}
----------------------------------------------------------------
Subject: Use with Oracle Pro*COBOL precompiler?
I am not a COBOL programmer, so this may be a stupid question.
My organization buys and runs an application package from a software vendor. A handful of programs are legacy items that are written in COBOL. Recently we have been forced into an upgrade of the application and of Oracle(this application uses Oracle). And that required an upgrade of our MicroFocus Cobol Compiler (to server express 2.2+) and subsequent expenditure of bales of money.
Would OpenCOBOL fit in this environment? Is it something
I should just try and see what happens?
(Oh! I should add that we have source code to this application and do our own compile cycle of any changes that
come from the software vendor.)
P.s. our OS is HP-UX 11i Oracle 10g
Thanks!
----------------------------------------------------------------
No reason why it should not work.
Use the 0.33 prerelease and follow the
README.
Roger
----------------------------------------------------------------
Subject: Permission denied error when using OpenCobol with Cygwin
Hi
I've installed OpenCobol on Cygwin successfully.
I've also compiled a .cob file into .exe file.
But when executing .exe file I received "Permission Denied".
Can anyone help me out?
Thanks a lot.
----------------------------------------------------------------
Sorry, Can not reproduce.
I always test pre-releases with Cygwin.
Download the 0.33 pre at the link on the left of
the home page and try again.
Next time, please, versions from OC and Cygwin :-)
Roger
----------------------------------------------------------------
Subject: COBOL and Stored Procedures
Don't know.
Sounds like a relational database interface.
If it works with some Unix/Linux Cobol compiler
like MF, then we should be able to do it.
Roger
----------------------------------------------------------------
Hi folks,
is it possible to call a stored procedure from COBOL when one of the parameters is a cursor? Also, the cursor was made for crystal reports. My colleague told me that the cursor used is exclusive for crystal reports. If so, can i just create another package for a cursor and use it? but how's the cobol code going to like? and how will i be able to retrieve the data from the cursor in cobol code?
----------------------------------------------------------------
Subject: syntax error, unexpected LITERAL, expecting COLUMN or LINE
Dear,
it forgives my English
I work with micro focus COBOL and Sco Unix 5.2..
I need to migrate for Red Hat linux 9….
already I installed and I configured open COBOL 3,2, and this executing ok….
I use DISPLAY field AT line+column and ACCEPT field AT line+column, but occurs error in compiler
already I tried:
cobc -std=cobol2002 program.cob
cobc -std=cobol85 program.cob
cobc -std=ibm program.cob
cobc -std=mvs program.cob
cobc -std=mf program.cob
the following error always occurs: syntax error, unexpected LITERAL, expecting COLUMN or LINE
only accepted open COBOL syntax ACCEPT/DISPLAY line (nn) column (nn)???????
geraldo
----------------------------------------------------------------
Move to 0.33 prerelease at the link on the left
of the home page here.
However, this might not get what you want as we
currently do NOT have any reasonable screen handling.
(Code donations welcome :-) )
Roger
----------------------------------------------------------------
Subject: Prerelease 0.33 notes
Some notes.
DO read the README !
(And do ALL what it recommends!)
The default action for the compiler (cobc) is to
produce a module not an executable (Change from 0.32)
If you want to produce an executable use the "-x"
option.
The "-m" option (produce a module) is default
(as per MF)
cobc --help gives details.
(Hint - Compile everything with default
ala. MF and execute with cobcrun)
Cobol FUNCTION's are implemented.
The FUNCTION list is taken from the Cobol 2002
standard. Implemented FUNCTION's can be seen in
cobc/reserved.c at ca. line 583
The top-level directory and the sub-directories
cobc, libcob, lib, bin, tests, config contain a file
named ChangeLog which documents all committed changes.
These are the main recourse to determining
new/changed features.
Also implemented are several MF/ACU system routines.
There are MANY bug fixes against 0.32, therefore it is
advisable to try 0.33 now.
Really, read the ChangeLog's since 0.32 release (05/2005)!
Roger
----------------------------------------------------------------
Also note that the prerelease is continually
updated.
For instance, today there has been an update
to rectify various things.
Roger
----------------------------------------------------------------
Hi
I have a modified codegen.c which addresses some of the problems when using ddd to debug. Basically, I have changed the output to remove newlines so all 'c' code relating to a cobol line is on one line. This allows you to use ddd to step through the cobol code.
I have produced this as a patch against the latest prerelease package.
If you feel it of use please let me know and I will email it to you.
Regards
Shaun Coughlin
shaunc@traderman.co.uk
----------------------------------------------------------------
New pre-release uploaded.
** Note ** ISAM secondary index files are NOT
compatible. Please unload/reload.
Further changes, see ChangeLog in top dirctory
and "cobc", "libcob" directories.
Roger
----------------------------------------------------------------
New pre-release uploaded.
** Note ** ISAM secondary index files are NOT
compatible. Please unload/reload.
Further changes, see ChangeLog in top dirctory
and "cobc", "libcob" directories.
----------------------------------------------------------------
Please read the previous post.
For those that have the "wget" command and
have an internet connection, then you can do
wget http://www.sim-basis.de/open-cobol-0.33.tar.gz
Roger
----------------------------------------------------------------
Bump.
Read original post.
*DO* read the README !!
Download direct at :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
(however, see previous post)
Roger
----------------------------------------------------------------
Subject: Problem reporting
Firstly check out the official
SourceForge website at :
http://sourceforge.net/projects/open-cobol
Alternatively with https
Please supply the following information :
OC version :
a) cobc --version
b) When prerelease, when downloaded.
What OS :
a) What version
b) What version from C or GCC
What version from dependent software :
a) GMP
b) BDB
c) ncusrses/pdcurses
Do NOT write it does not work.
I need an example
(And do not be afraid to post
it inline, we need the source!).
(My crystal ball is very cloudy :-) )
PS. I may need the output from configure/make -
Post/send config.log and/or the output from make (see README)
Roger
----------------------------------------------------------------
Until I get this as a "sticky" thread,
I will post to get this at the top of the list.
Roger
----------------------------------------------------------------
Subject: problem on mac os x (libdb)
i have the macpro 2,66 ghz and mac os x 10.4.8
i install db berkeley and the make install put it in
[omignard:/usr/local/BerkeleyDB.4.4] omignard% ls lib
libdb-4.4.a libdb-4.4.dylib libdb-4.4.la libdb-4.dylib libdb.a libdb.dylib
[omignard:/usr/local/BerkeleyDB.4.4] omignard%
buth the results of the configure of opencobol :
checking db.h usability... yes
checking db.h presence... yes
checking for db.h... yes
checking db_185.h usability... no
checking db_185.h presence... no
checking for db_185.h... no
checking db3/db_185.h usability... no
checking db3/db_185.h presence... no
checking for db3/db_185.h... no
checking db4/db_185.h usability... no
checking db4/db_185.h presence... no
checking for db4/db_185.h... no
checking db4.1/db_185.h usability... no
checking db4.1/db_185.h presence... no
checking for db4.1/db_185.h... no
checking db4.2/db_185.h usability... no
checking db4.2/db_185.h presence... no
checking for db4.2/db_185.h... no
checking db4.3/db_185.h usability... no
checking db4.3/db_185.h presence... no
checking for db4.3/db_185.h... no
checking db4.4/db_185.h usability... no
checking db4.4/db_185.h presence... no
checking for db4.4/db_185.h... no
checking db4.5/db_185.h usability... no
checking db4.5/db_185.h presence... no
checking for db4.5/db_185.h... no
checking for __db_open in -ldb-4.5... no
checking for dbopen in -ldb-4.5... no
checking for __db_open in -ldb-4.4... no
checking for dbopen in -ldb-4.4... no
checking for __db_open in -ldb-4.3... no
checking for dbopen in -ldb-4.3... no
checking for __db_open in -ldb-4.2... no
checking for dbopen in -ldb-4.2... no
checking for __db_open in -ldb-4.1... no
checking for dbopen in -ldb-4.1... no
checking for __db_open in -ldb-4... no
checking for dbopen in -ldb-4... no
checking for __db_open in -ldb... no
checking for dbopen in -ldb... no
configure: error: libdb is required
where is the problem ?
----------------------------------------------------------------
Well you answered that yourself in the second sentence.
BDB has a very strange default install path.
You have two options -
1) Fiddle around with setting environment variables so that
OC finds BDB. OC's ./configure --help will give you info.
2) This is the recommended way - Regenerate BDB using
./configure --prefix=/usr/local
(or ./configure --prefix=/usr)
and then the usual make install.
(Don't forget to do a "make distclean" first)
** AND ** - Please use the OC 0.33 prerelease; this has
fixes for the Mac.
(Download is on the left of the home page)
Roger
----------------------------------------------------------------
i used the oc 0.33 :-D
----------------------------------------------------------------
Subject: problem with ld ..
ld: common symbols not allowed with MH_DYLIB output format with the -multi_module option
/usr/local/lib/libgmp.a(mp_bpl.o) definition of common ___gmp_junk (size 16)
/usr/bin/libtool: internal link edit command failed
make[2]: *** [libcob.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
----------------------------------------------------------------
That's not an OC problem.
Something is borked with GMP.
This has happened before -
See the thread -
"configure: error: GMP 3 or later is required"
Seems that a workaround for generating/installing
GMP is -
export ABI=32
./configure --with-pic --enable-cxx --enable-shared
Roger
----------------------------------------------------------------
i am on a mac pro xeon
i have this error
tmp-dive_1.s:108:junk `@GOT' after expression
make[2]: *** [dive_1.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5363.obj~28/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-arch=nocona --with-tune=generic --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5363)
----------------------------------------------------------------
Sorry, you are going to have to take this
over to the GMP list.
www.swox.com/gmp
Look for lists and submit to the bug list.
----------------------------------------------------------------
Subject: Running error: symbol lookup error
this is i have got while running this program...
./FILE01: symbol lookup error: ./FILE01: undefined symbol: cob_save_call_params
compile ok! but when i try running it fails
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. PHNADD01.
000800 ENVIRONMENT DIVISION.
000900 INPUT-OUTPUT SECTION.
001000 FILE-CONTROL.
001200 SELECT PHONE-FILE
001300 ASSIGN TO "PHONE.DAT"
001500 ORGANIZATION IS SEQUENTIAL.
001600
001700 DATA DIVISION.
001800 FILE SECTION.
001900 FD PHONE-FILE
002000 LABEL RECORDS ARE STANDARD.
002100 01 PHONE-RECORD.
002200 05 PHONE-LAST-NAME PIC X(20).
002500
003600 PROCEDURE DIVISION.
003700 MAIN-LOGIC SECTION.
003800 PROGRAM-BEGIN.
003900 OPEN EXTEND PHONE-FILE.
000000 DISPLAY "INTRODUCE LAST NAME: ".
006700 ACCEPT PHONE-LAST-NAME.
008100 WRITE PHONE-RECORD.
004100 CLOSE PHONE-FILE.
004600 PROGRAM-DONE.
004700 STOP RUN.
009000
please help me.
gcc version 4.0.3
opencobol 0.33.0 and 0.32.x
!ldconfig done!
----------------------------------------------------------------
Mismatch between compiler and libraries.
Check your environment.
If you have done a default configure/make install,
then you do not need to do anything special in
the environment.
If nothing is obvious,
redo (as root) the "make install" from 0.33.
Redo "ldconfig".
Check output from :
ldconfig -p | grep libcob
Then do
hash cobc
hash
Check the paths to cobc from the hash command and
from the ldconfig command.
----------------------------------------------------------------
thanks i have solved it.
problems with libcob version 0.32.x
----------------------------------------------------------------
hi
i have the same problem,
but i don't quite understand your solution
output from ldconfig -p | grep libcob:
libcob.so.1 (libc6) => /usr/lib/libcob.so.1
libcob.so (libc6) => /usr/lib/libcob.so
output from hash:
hits command
0 /usr/local/bin/cobc
4 /usr/bin/sudo
1 /bin/ls
and now what ...
i'm not really what you can call an advanced linux user (using ubuntu), so any help is welcome :-)
thx
----------------------------------------------------------------
Download/install 0.33 prerelease.
If this problem persists, then
I want the the config.log file.
Roger
----------------------------------------------------------------
downloaded and installed the 0.33 prerelease, and the error persists
[url=http://fabian.madoka.be/files/config.log]config.log[/url]
----------------------------------------------------------------
And did you carefully read the README :-)
----------------------------------------------------------------
i've read the readme, followed the installation procedure (and the the test, which passed) but still not working
----------------------------------------------------------------
How many times -
Say your environment, etc.
Roger
----------------------------------------------------------------
Subject: compilation problem
Hi there
I'm trying to compile opencobol 0.33 on solaris.
Here is the last compilation line :
gcc -m64 -DHAVE_CONFIG_H -I. -I. -I.. -fsigned-char -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-format-y2k -DSUPER_OPTIMIZE -I.. -O2 -finline
-functions -fomit-frame-pointer -MT libcob_la-fileio.lo -MD -MP -MF .deps/libcob_la-fileio.Tpo -c fileio.c -fPIC -DPIC -o .libs/libcob_la-fileio.o
and here are the first errors :
fileio.c:236: error: parse error before "DB"
fileio.c:236: warning: no semicolon at end of struct or union
fileio.c:237: warning: type defaults to `int' in declaration of `key'
fileio.c:237: warning: data definition has no type or storage class
fileio.c:238: error: parse error before "data"
fileio.c:238: warning: type defaults to `int' in declaration of `data'
fileio.c:238: warning: data definition has no type or storage class
fileio.c:250: error: parse error before '}' token
fileio.c: In function `cob_sync':
fileio.c:380: error: dereferencing pointer to incomplete type
fileio.c:380: error: dereferencing pointer to incomplete type
fileio.c:389: error: dereferencing pointer to incomplete type
fileio.c:389: error: dereferencing pointer to incomplete type
fileio.c: In function `indexed_open':
fileio.c:1272: error: invalid application of `sizeof' to an incomplete type
fileio.c:1323: error: dereferencing pointer to incomplete type
fileio.c:1323: error: `DB' undeclared (first use in this function)
fileio.c:1323: error: (Each undeclared identifier is reported only once
fileio.c:1323: error: for each function it appears in.)
fileio.c:1323: error: parse error before ')' token
fileio.c:1328: error: dereferencing pointer to incomplete type
fileio.c:1337: error: `BTREEINFO' undeclared (first use in this function)
fileio.c:1337: error: parse error before "info"
fileio.c:1370: error: `info' undeclared (first use in this function)
fileio.c:1372: error: `R_DUP' undeclared (first use in this function)
fileio.c:1383: error: dereferencing pointer to incomplete type
Any idea of the problem ?
----------------------------------------------------------------
Something screwy with the BDB include files.
Send or post config.h and config.log
----------------------------------------------------------------
Oups, the configure script reported the db.h missing. As there were no error, I didn't look at it ...
Thanks !
----------------------------------------------------------------
Installing the db4 dev package solved this for me.
----------------------------------------------------------------
Subject: gcc for mvs
You might like to use GCC 3.2.3 for OpenCOBOL, as it has been ported to MVS 3.8, MVS/XA and OS/390 (native, not USS). You can find it here:
http://www.softlib.org/GCCMVS/gccmvs.html
BFN. Paul.
----------------------------------------------------------------
That would be GREAT! Have a working COBOL that supports functions!
----------------------------------------------------------------
Subject: configure: error: gmp.h is required
I have downloaded and trying to run ./configure but I get and error "configure: error: gmp.h is required". I have checked and GMP is installed. I'm running on Suse 10.1 Linux. Do I need to download any patches or some other package. Thanks for any info into this matter.
----------------------------------------------------------------
What OC release ?
If it's 0.32, there is a known problem with
gmp detection.
Use OC 0.33.
If you are using 0.33 post config.log.
OC works fine with default Suse packages
for GMP, BDB on 10.1. (I use it at home)
----------------------------------------------------------------
I am using OC 0.33
the config.log follows:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by OpenCOBOL configure 0.33, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = program-1
uname -m = i686
uname -r = 2.6.16.13-4-default
uname -s = Linux
uname -v = #1 Wed May 3 04:53:23 UTC 2006
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /sbin
PATH: /usr/sbin
PATH: /usr/local/sbin
PATH: /opt/gnome/sbin
PATH: /root/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /usr/X11R6/bin
PATH: /bin
PATH: /usr/games
PATH: /opt/gnome/bin
PATH: /opt/kde3/bin
PATH: /usr/lib/jvm/jre/bin
PATH: /usr/lib/mit/bin
PATH: /usr/lib/mit/sbin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1612: checking for a BSD-compatible install
configure:1667: result: /usr/bin/install -c
configure:1678: checking whether build environment is sane
configure:1721: result: yes
configure:1786: checking for gawk
configure:1802: found /usr/bin/gawk
configure:1812: result: gawk
configure:1822: checking whether make sets $(MAKE)
configure:1842: result: yes
configure:2010: checking whether to enable maintainer-specific portions of Makefiles
configure:2019: result: no
configure:2133: checking for gcc
configure:2149: found /usr/bin/gcc
configure:2159: result: gcc
configure:2403: checking for C compiler version
configure:2406: gcc --version &5
gcc (GCC) 4.1.0 (SUSE Linux)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2409: $? = 0
configure:2411: gcc -v &5
Using built-in specs.
Target: i586-suse-linux
Configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.1.0 --enable-ssp --disable-libssp --enable-java-awt=gtk --enable-gtk-cairo --disable-libjava-multilib --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --enable-libstdcxx-allocator=new --without-system-libunwind --with-cpu=generic --host=i586-suse-linux
Thread model: posix
gcc version 4.1.0 (SUSE Linux)
configure:2414: $? = 0
configure:2416: gcc -V &5
gcc: '-V' option must have argument
configure:2419: $? = 1
configure:2442: checking for C compiler default output file name
configure:2445: gcc conftest.c >&5
configure:2448: $? = 0
configure:2494: result: a.out
configure:2499: checking whether the C compiler works
configure:2505: ./a.out
configure:2508: $? = 0
configure:2525: result: yes
configure:2532: checking whether we are cross compiling
configure:2534: result: no
configure:2537: checking for suffix of executables
configure:2539: gcc -o conftest conftest.c >&5
configure:2542: $? = 0
configure:2567: result:
configure:2573: checking for suffix of object files
configure:2594: gcc -c conftest.c >&5
configure:2597: $? = 0
configure:2619: result: o
configure:2623: checking whether we are using the GNU C compiler
configure:2647: gcc -c conftest.c >&5
configure:2653: $? = 0
configure:2657: test -z
|| test ! -s conftest.err
configure:2660: $? = 0
configure:2663: test -s conftest.o
configure:2666: $? = 0
configure:2679: result: yes
configure:2685: checking whether gcc accepts -g
configure:2706: gcc -c -g conftest.c >&5
configure:2712: $? = 0
configure:2716: test -z
|| test ! -s conftest.err
configure:2719: $? = 0
configure:2722: test -s conftest.o
configure:2725: $? = 0
configure:2736: result: yes
configure:2753: checking for gcc option to accept ANSI C
configure:2823: gcc -c -g -O2 conftest.c >&5
configure:2829: $? = 0
configure:2833: test -z
|| test ! -s conftest.err
configure:2836: $? = 0
configure:2839: test -s conftest.o
configure:2842: $? = 0
configure:2860: result: none needed
configure:2878: gcc -c -g -O2 conftest.c >&5
conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me'
configure:2884: $? = 1
configure: failed program was:
| #ifndef __cplusplus
| choke me
| #endif
configure:3028: checking for style of include used by make
configure:3056: result: GNU
configure:3084: checking dependency style of gcc
configure:3174: result: gcc3
configure:3196: checking how to run the C preprocessor
configure:3231: gcc -E conftest.c
configure:3237: $? = 0
configure:3269: gcc -E conftest.c
conftest.c:13:28: error: ac_nonexistent.h: No such file or directory
configure:3275: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.33"
| #define PACKAGE_STRING "OpenCOBOL 0.33"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.33"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| /* end confdefs.h. */
| #include
configure:3314: result: gcc -E
configure:3338: gcc -E conftest.c
configure:3344: $? = 0
configure:3376: gcc -E conftest.c
conftest.c:13:28: error: ac_nonexistent.h: No such file or directory
configure:3382: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.33"
| #define PACKAGE_STRING "OpenCOBOL 0.33"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.33"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| /* end confdefs.h. */
| #include
configure:3425: checking for egrep
configure:3435: result: grep -E
configure:3626: checking for ANSI C header files
configure:3651: gcc -c -g -O2 conftest.c >&5
configure:3657: $? = 0
configure:3661: test -z
|| test ! -s conftest.err
configure:3664: $? = 0
configure:3667: test -s conftest.o
configure:3670: $? = 0
configure:3759: gcc -o conftest -g -O2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:35: warning: incompatible implicit declaration of built-in function 'exit'
configure:3762: $? = 0
configure:3764: ./conftest
configure:3767: $? = 0
configure:3782: result: yes
configure:3806: checking for sys/types.h
configure:3822: gcc -c -g -O2 conftest.c >&5
configure:3828: $? = 0
configure:3832: test -z
|| test ! -s conftest.err
configure:3835: $? = 0
configure:3838: test -s conftest.o
configure:3841: $? = 0
configure:3852: result: yes
configure:3806: checking for sys/stat.h
configure:3822: gcc -c -g -O2 conftest.c >&5
configure:3828: $? = 0
configure:3832: test -z
|| test ! -s conftest.err
configure:3835: $? = 0
configure:3838: test -s conftest.o
configure:3841: $? = 0
configure:3852: result: yes
configure:3806: checking for stdlib.h
configure:3822: gcc -c -g -O2 conftest.c >&5
configure:3828: $? = 0
configure:3832: test -z
|| test ! -s conftest.err
configure:3835: $? = 0
configure:3838: test -s conftest.o
configure:3841: $? = 0
configure:3852: result: yes
configure:3806: checking for string.h
configure:3822: gcc -c -g -O2 conftest.c >&5
configure:3828: $? = 0
configure:3832: test -z
|| test ! -s conftest.err
configure:3835: $? = 0
configure:3838: test -s conftest.o
configure:3841: $? = 0
configure:3852: result: yes
configure:3806: checking for memory.h
configure:3822: gcc -c -g -O2 conftest.c >&5
configure:3828: $? = 0
configure:3832: test -z
|| test ! -s conftest.err
configure:3835: $? = 0
configure:3838: test -s conftest.o
configure:3841: $? = 0
configure:3852: result: yes
configure:3806: checking for strings.h
configure:3822: gcc -c -g -O2 conftest.c >&5
configure:3828: $? = 0
configure:3832: test -z
|| test ! -s conftest.err
configure:3835: $? = 0
configure:3838: test -s conftest.o
configure:3841: $? = 0
configure:3852: result: yes
configure:3806: checking for inttypes.h
configure:3822: gcc -c -g -O2 conftest.c >&5
configure:3828: $? = 0
configure:3832: test -z
|| test ! -s conftest.err
configure:3835: $? = 0
configure:3838: test -s conftest.o
configure:3841: $? = 0
configure:3852: result: yes
configure:3806: checking for stdint.h
configure:3822: gcc -c -g -O2 conftest.c >&5
configure:3828: $? = 0
configure:3832: test -z
|| test ! -s conftest.err
configure:3835: $? = 0
configure:3838: test -s conftest.o
configure:3841: $? = 0
configure:3852: result: yes
configure:3806: checking for unistd.h
configure:3822: gcc -c -g -O2 conftest.c >&5
configure:3828: $? = 0
configure:3832: test -z
|| test ! -s conftest.err
configure:3835: $? = 0
configure:3838: test -s conftest.o
configure:3841: $? = 0
configure:3852: result: yes
configure:3864: checking for getopt_long_only
configure:3921: gcc -o conftest -g -O2 conftest.c >&5
configure:3927: $? = 0
configure:3931: test -z
|| test ! -s conftest.err
configure:3934: $? = 0
configure:3937: test -s conftest
configure:3940: $? = 0
configure:3952: result: yes
configure:3970: checking kpathsea/getopt.h usability
configure:3982: gcc -c -g -O2 conftest.c >&5
conftest.c:62:29: error: kpathsea/getopt.h: No such file or directory
configure:3988: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.33"
| #define PACKAGE_STRING "OpenCOBOL 0.33"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.33"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define COB_PARAM_CHECK 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| #include
| #if HAVE_SYS_TYPES_H
| # include
| #endif
| #if HAVE_SYS_STAT_H
| # include
| #endif
| #if STDC_HEADERS
| # include
| # include
| #else
| # if HAVE_STDLIB_H
| # include
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| # include
| # endif
| # include
| #endif
| #if HAVE_STRINGS_H
| # include
| #endif
| #if HAVE_INTTYPES_H
| # include
| #else
| # if HAVE_STDINT_H
| # include
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include
| #endif
| #include
configure:4011: result: no
configure:4015: checking kpathsea/getopt.h presence
configure:4025: gcc -E conftest.c
conftest.c:28:29: error: kpathsea/getopt.h: No such file or directory
configure:4031: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.33"
| #define PACKAGE_STRING "OpenCOBOL 0.33"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.33"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define COB_PARAM_CHECK 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| #include
configure:4051: result: no
configure:4086: checking for kpathsea/getopt.h
configure:4093: result: no
configure:3970: checking getopt.h usability
configure:3982: gcc -c -g -O2 conftest.c >&5
configure:3988: $? = 0
configure:3992: test -z
|| test ! -s conftest.err
configure:3995: $? = 0
configure:3998: test -s conftest.o
configure:4001: $? = 0
configure:4011: result: yes
configure:4015: checking getopt.h presence
configure:4025: gcc -E conftest.c
configure:4031: $? = 0
configure:4051: result: yes
configure:4086: checking for getopt.h
configure:4093: result: yes
configure:4145: checking gmp.h usability
configure:4157: gcc -c -g -O2 conftest.c >&5
conftest.c:63:17: error: gmp.h: No such file or directory
configure:4163: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.33"
| #define PACKAGE_STRING "OpenCOBOL 0.33"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.33"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define COB_PARAM_CHECK 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_GETOPT_H 1
| /* end confdefs.h. */
| #include
| #if HAVE_SYS_TYPES_H
| # include
| #endif
| #if HAVE_SYS_STAT_H
| # include
| #endif
| #if STDC_HEADERS
| # include
| # include
| #else
| # if HAVE_STDLIB_H
| # include
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| # include
| # endif
| # include
| #endif
| #if HAVE_STRINGS_H
| # include
| #endif
| #if HAVE_INTTYPES_H
| # include
| #else
| # if HAVE_STDINT_H
| # include
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include
| #endif
| #include
configure:4186: result: no
configure:4190: checking gmp.h presence
configure:4200: gcc -E conftest.c
conftest.c:29:17: error: gmp.h: No such file or directory
configure:4206: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.33"
| #define PACKAGE_STRING "OpenCOBOL 0.33"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.33"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define COB_PARAM_CHECK 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_GETOPT_H 1
| /* end confdefs.h. */
| #include
configure:4226: result: no
configure:4261: checking for gmp.h
configure:4268: result: no
configure:4278: error: gmp.h is required
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_F77_set=
ac_cv_env_F77_value=
ac_cv_env_FFLAGS_set=
ac_cv_env_FFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=
ac_cv_func_getopt_long_only=yes
ac_cv_header_getopt_h=yes
ac_cv_header_gmp_h=no
ac_cv_header_inttypes_h=yes
ac_cv_header_kpathsea_getopt_h=no
ac_cv_header_memory_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_objext=o
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=
ac_cv_prog_egrep='grep -E'
ac_cv_prog_make_make_set=yes
am_cv_CC_dependencies_compiler_type=gcc3
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL='${SHELL} /usr/local/src/open-cobol-0.33/missing --run aclocal-1.9'
ALLOCA=''
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='${SHELL} /usr/local/src/open-cobol-0.33/missing --run tar'
AR=''
AS=''
AUTOCONF='${SHELL} /usr/local/src/open-cobol-0.33/missing --run autoconf'
AUTOHEADER='${SHELL} /usr/local/src/open-cobol-0.33/missing --run autoheader'
AUTOMAKE='${SHELL} /usr/local/src/open-cobol-0.33/missing --run automake-1.9'
AWK='gawk'
CC='gcc'
CCDEPMODE='depmode=gcc3'
CFLAGS='-g -O2'
COBC_LIBS=''
COB_BIGENDIAN=''
COB_CC='gcc'
COB_CFLAGS=''
COB_CONFIG_DIR=''
COB_EXPORT_DYN=''
COB_LDFLAGS=''
COB_LIBRARY_PATH=''
COB_LIBS=''
COB_MODULE_EXT=''
COB_PIC_FLAGS=''
COB_SHARED_OPT=''
CPP='gcc -E'
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
DLLTOOL=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='grep -E'
EXEEXT=''
F77=''
FFLAGS=''
GMSGFMT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
INTLLIBS=''
LDFLAGS=''
LIBCOB_CFLAGS=''
LIBCOB_LIBS='-lm'
LIBICONV=''
LIBINTL=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBICONV=''
LTLIBINTL=''
LTLIBOBJS=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL} /usr/local/src/open-cobol-0.33/missing --run makeinfo'
MKINSTALLDIRS=''
MSGFMT=''
MSGMERGE=''
OBJDUMP=''
OBJEXT='o'
PACKAGE='open-cobol'
PACKAGE_BUGREPORT='open-cobol-list@lists.sourceforge.net'
PACKAGE_NAME='OpenCOBOL'
PACKAGE_STRING='OpenCOBOL 0.33'
PACKAGE_TARNAME='open-cobol'
PACKAGE_VERSION='0.33'
PATH_SEPARATOR=':'
POSUB=''
RANLIB=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
USE_NLS=''
VERSION='0.33'
XGETTEXT=''
ac_ct_AR=''
ac_ct_AS=''
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_ct_DLLTOOL=''
ac_ct_F77=''
ac_ct_OBJDUMP=''
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include='include'
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${prefix}/share'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/usr/local/src/open-cobol-0.33/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='mkdir -p --'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define COB_DEBUG 1
#define COB_PARAM_CHECK 1
#define HAVE_GETOPT_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define PACKAGE "open-cobol"
#define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
#define PACKAGE_NAME "OpenCOBOL"
#define PACKAGE_STRING "OpenCOBOL 0.33"
#define PACKAGE_TARNAME "open-cobol"
#define PACKAGE_VERSION "0.33"
#define PATCH_LEVEL 0
#define STDC_HEADERS 1
#define VERSION "0.33"
#define WITH_DB 3
#define WITH_LFS64 1
#define WITH_VARSEQ 1
#define __USE_STRING_INLINES 1
configure: exit 1
----------------------------------------------------------------
It can not find the GMP include file -
| #include
configure:4186: result: no
configure:4190: checking gmp.h presence
configure:4200: gcc -E conftest.c
conftest.c:29:17: error: gmp.h: No such file or directory
So, GMP is not correctly installed.
(Or there is something screwy in your envirionment).
In /usr/include, there should be gmp.h and gmpxxx.h.
In /usr/lib, there should be the libraries -
libgmp*.
----------------------------------------------------------------
Subject: libcob.so.1 path error
I am using RH Fedora 5 and OpenCOBOL 0.33 patchlevel 0 downloaded 10/20/06. 'configure' was run without any parameters.
hello.cob from the manual was used for my initial test. At runtime the 'libcob.so.1' file could not be found. It was in '/usr/local/lib/' but the runtime object was looking for it in '/usr/lib/'.
As a work around I created a symbolic link:
ln -s /usr/local/lib/libcob.so.1 /usr/lib/libcob.so.1
and everything worked just fine, including the test in 'tests/cobol85'.
Curt
I found this issue addressed in the TODO section.
----------------------------------------------------------------
That should not be necessary.
From the README -
*********
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.
*********
----------------------------------------------------------------
I did the following:
Booted my laptop
Removed the extra link (above)
ran, as root, ldconfig
compiled hello.cob
ran './hello', got this message:
./hello: error while loading shared libraries: libcob.so.1: cannot open shared object file: No such file or directory
Placed the link back in /usr/lib
ran './hello', got this message:
Hello World!
Let me know if there is anything else I can do to help resolve this.
Thanks for your help,
Curt
----------------------------------------------------------------
OK. It seems that there are Red Hat distros that
do not include /usr/local/lib in the default search
path. eg. See
http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html - Chapter 3.2, Paragraph 2.
Remove the extra link.
Edit /etc/ld.so.conf and add in /usr/local/lib.
Run ldconfig.
(You do not have to reboot to do all this)
I will put a note in the README regarding Red Hat.
This is rather perturbing in that RH
IS searching /usr/local/include for the compile
(otherwise you could not compile hello.cob), yet
not searching (per default) /usr/local/lib for
runtime. Weird and could cause a lot of confusion
for add on packages. Note that /usr/local is the
default install path for many packages.
I hope RH has /usr/local/bin as part of the default PATH.
Try running "cobcrun".
----------------------------------------------------------------
Everything works now - thanks!
It appears /etc/ld.so.conf runs the *.conf files in /etc/ld.so.conf.d. I created OpenCOBOL.conf file in this directory.
/usr/local/bin is in the default path.
Curt
----------------------------------------------------------------
Subject: embedded SQL
What is the current status of embedded SQL?
Are you looking for contributers?
Curt
----------------------------------------------------------------
Not quite sure I understand the question.
SQL is not part of any COBOL standard.
Major relational databases already provide
a COBOL precompiler (eg. Oracle, Informix, etc.)
Are you thinking about specific RDB support
eg. Postgresql ?
----------------------------------------------------------------
I was thinking about mySQL support (or other open RDB).
----------------------------------------------------------------
OK. Suggest Postgresql and mySQL for starters.
Well, first of all, you will have to decide exactly the SQL syntax (from the COBOL point of view) that you will support.
Then you will have to provide the COBOL copy files for the
equivalent of the sqlca, etc. structures relevant for each DB.
That's for starters.
Incidentally, many years ago, the XOPEN group brought out
an SQL COBOL standard. I think I still have a copy. Must dig it out. (Anybody remember that?)
----------------------------------------------------------------
Sounds simple enough :-)
I use COBOL embedded SQL on an IBM AIX box so I'm familiar with the basic operations.
Recommendations from those that know the inter-workings of OpenCOBOL would be very helpful, especially on the interface design. Is there anyone else interested in getting involved with this?
I think this is definately worth investigating.
Curt
----------------------------------------------------------------
As a proof-of-concept I built a small interface to mysql via mysqlclient. This is NOT embedded SQL, but utilizes COBOL calls to access the database.
SQL 'SELECT' results set handling was fairly straight forward. The biggest deficiency appears to be there is no was to get parameter information (type/length) on parameterized statements. It looks like the mysql folks are in the process of supplying this functionality.
If anyone is interested is trying out this lightly tested and undocumented code, let me know and I'll make it available. You'll need the client and the header files from dev.mysql.com
Curt
----------------------------------------------------------------
Subject: ./configure error
I am running CYGWIN on a Windows XP laptop and I receive the following error:
dhickey@coldhickey /cygdrive/c/OpenCOBOL/open-cobol-0.33
$ ./configure
: command not found3:
./configure: line 21: syntax error near unexpected token `elif'
./configure: line 21: `elif test -n "${BASH_VERSION+set}" && (set -o posix) >/de
'/null 2>&1; then
I have received this same error for the 0.32 version as well. What am I missing in my setup?
----------------------------------------------------------------
I do not know.
Looks like a Cygwin problem.
There is nothing that is peculiar at line 21 in the
configure script.
Sure you are running the bash shell ?
$ echo $SHELL
/bin/bash
Works fine here under XP.
----------------------------------------------------------------
have the same problem - did you found out what was the reason?
----------------------------------------------------------------
No and the original poster did not reply.
Works fine here with W2K and WXP.
You must start the bash shell from the
icon on the desktop.
Roger
----------------------------------------------------------------
I had this too. The problem is that Cygwin is expecting text lines to be delimited Unix-style with a line feed "\n" character, but the OpenCOBOL files have lines ending in Windows-style "\r\n" (carriage return, line feed).
If you used Windows tools to get OpenCOBOL, you will probably end up with Windows-style text lines. WinZIP has an option to turn off "smart newlines" or something like that, but you could unpack from the Cygwin prompt with "gzip -d open-cobol-0.33.tar.gz;tar -xvf open-cobol-0.33.tar".
If you got OpenCOBOL from CVS, WinCVS has an option on the "Globals" page - "Checkoout using Unix LF" - or you could ask someone how to use CVS from the Cygwin prompt.
See http://en.wikipedia.org/wiki/Line_feed#Common_problems for some background and other suggestions.
----------------------------------------------------------------
Most certainly not. There are
no "DOS" things in the source from
OC 0.33.
What people do with it is another
question ;-)
Roger
----------------------------------------------------------------
Subject: Indexed file very slow
Hi,
I'm trying to migrate from MF to OC
Everything has been compiled but when I'm using Indexed files it's extraordinary slow compared to MF (10 times slower at less...)
Any experiences, ideas or other to solve the problem ?
OC 0.33 loaded 11 October 2006
Berkeley DB 4.5.20
gmp 4.21
lt 5.22
ncurses 5.5
AIX 4.3.3.10
----------------------------------------------------------------
Yes, that's the consequence of piggybacking an
ISAM functionality on top of a relational database.
MF uses a modified version of IBM (formally INFORMIX)
C-ISAM. Many years ago they bought the rights to the source.
I have been trying to get IBM to OpenSource C-ISAM as it
can't be any great revenue for them. So far without success.
It might help if you, and all others who read this, also
put pressure on IBM to release C-ISAM to the OpenSource
community.
Having said this, I have been looking at alternatives.
One that MAY eventually be a possibility is VBISAM over at
SourceForge.
The VB has NOTHING, repeat NOTHING to do with Visual Basic :-)
It comes from the originator - Trevor Van Bremen.
Problem is that Trevor disappears for months at a time.
I have, however, taken the code, completely revised it and put it under control of autotools (so that you can do a normal configure, make, etc. on a variety of platforms)
This is still not ripe for usage.
You can at least check if it will configure/make on your
platform - Download at
http://www.sim-basis.de/vbisam-2.0.tar.gz
You will not be able to do very much with this other than
the configure/make.
To date, I have not found anything else that might be an alternative.
----------------------------------------------------------------
Ok. Thanks.
I'll look how I can use this VBISAM to solve my problems.
Knowing the origin of the problem is the start of the solution...
----------------------------------------------------------------
Well, you can't until we integrate another ISAM handler into OC :-)
However, a configure/make on your AIX would provide useful info on porting.
----------------------------------------------------------------
If you want to apply pressure on IBM to
opensource C-ISAM, the product manager is
Andrea Reid - E-Mail areid@us.ibm.com
----------------------------------------------------------------
Latest attempt to influence IBM -
**********************************
Hello Roger, the comment below from Thomas is the current & correct assessment for C-ISAM. From time to time we have looked into open sourcing C-ISAM and have decided it was not something we wanted to pursue.
If there's anything else I can help you with let me know.
Regards,
Andrea Reid
WW Informix Product Manager
DB2 Information Management Software
IBM Software Group
areid@us.ibm.com
VOICE: 530-877-6712
***************************
----------------------------------------------------------------
Hello,
I'm working on the project described above by jfrot and i have a few questions about the handling of indexed sequential files/sort.
I've noticed that VBISAM (or C-ISAM) is implemented for the handling of sequential or relative files but not for indexed sequential files, nor sort
So I've three questions :
- Do you have statistics in the use on aix and linux platforms on the handling of indexed sequential files/sort with db berkeley ?
- To enhance the performance of the handling, how could it be possible to customize the settings of the db (with set_pagesize and/or set_cachesize - with are not used in the function "indexed_open") manually or automatically
- Do you think in implementing VBISAM in handling those kind of files ? If so, when ? Do you think it could take about 5 to 15 days to some developer to implement and test it ?
Thanks in advance for your help.
----------------------------------------------------------------
VBISAM/C-ISAM is NOT and can NOT be used for anything in
OC at the moment. Sequential/relative has nothing whatsoever to do with IS.
To the questions :
1) No.
2) If your BDB is version >= 4.1 and you set DB_HOME, then
this will be done automatically. (See join_environment)
Note that setting DB_HOME to a directory also means that the
files (when not absolute paths) land up there.
3) a) Yes
b) I do not know
c) See below
(c) continued :
C-ISAM we can forget if IBM will not opensource.
VBISAM needs a bunch of mods (also applies to C-ISAM) eg.
a) Support for lock on write when manually locking.
b) Support for own comparison routine
c) Support for Win locking (it currently does not work
even under Cygwin)
VBISAM also needs rigorous testing. There is no testbed
for this.
To get VBISAM in some sort of shape for use by OC will
probably take ca. 20-30 man days.
Assuming we then have required functionality, then we
probably need ca. 15-20 man days for OC changes.
Roger
----------------------------------------------------------------
Hello,
I find that the way OC handles the different kind of files access methods used in COBOL is well designed (a set of functions for each kind of method - SEQ / REL / IS / sort).
And for ISAM, the fact that the records+key and the indexes are stored in their own file is, i suppose, for general purpose.
Because, (As heard in a show called Eurovision :) The results for ISAM are (with 3 simple test programs which write, read, read and rewrite records) :
- AIX 4.3.3 (5 000 records with MF) :
* Write < 5 s
* Read < 5 s
* Rewrite < 5 s
- AIX 4.3.3 (5 000 records with OC) :
* Write < 5 s
* Read < 5 s
* Rewrite = 25 min
- LX RH EL AS 4 / VMWare (5 000 records with OC) :
* Write < 1 s
* Read < 1 s
* Rewrite = 3 min 30 s
- LX RH EL AS 4 / VMWare (100 000 records with OC) :
* Write < 5 s
* Read < 5 s
* Rewrite > 8 hours
Those tests show that the way the rewrite function was developped is not efficient enough for big files.
I give you some details about a part of the project I'm on :
the IS files are used for temporary use :
- extraction from db to IS files (some IS files have huge number of records > 200 000)
- calculation are made in IS files (thus no modification on key/indexes but need of rewrites data part) - this step takes more than 6 hours with MF and more than 3 days with OC (on AIX platform)
- commit to db from IS files
So I have two questions :
- is the way the functions set for ISAM was developped by design :
* so any underlying product can fit
* the underlying product didn't have the needed options to implement efficient handling of indexes in ISAM without an "abstract" layer
* or other reasons
- since BDB version 4.x, the function associate appear to deal with indexes in a secondary db : what is your opinion in the use of this function ?
----------------------------------------------------------------
Subject: ACCEPT statement not to capture the carriage-return character.
On using the ACCEPT statement to capture elementary data items, when I use MOVE to store them in a file record there appears the characters "^@" at the end of each the data item. I am interpreting this to be the carriage-return that I press after keying-in the data. How do I make these "^@" characters not to be captured and/or saved in the file?
Also, is there a way that the ACCEPT statement can capture data in group fields like in Micro Focus Cobol?
Thanks.
----------------------------------------------------------------
I can not reproduce this.
Please post an example program.
----------------------------------------------------------------
Subject: start up
hi, I'm very new to cobol. started a few hours ago, and my questions will sound very silly.
installed open-cobol-0.33 and cygwin, using crimson editor for source.
couldn't find a site to get what I need to install and how to do so.
for $ cobc hello.cob in cygwin gives the following error:
bash: cobc: command not found
I appreciate any help to get me run a cobol program
Aliv
:-(
----------------------------------------------------------------
It looks to be (at less) a problem of 'PATH' environment variable. Add it the path to opencobol bin directory, if it is not already done.
Jerome
----------------------------------------------------------------
thank you kindly. I havn't done thsi in a few years.
would you possibly tell me how can I set the path? I'm a little confuse.
thanks a lot
----------------------------------------------------------------
Don't know exactly how it work under cygwin because I never used it.
but typing the command :
set PATH = $PATH:opencobol_dir/bin
where opencobol_dir is the directory where you installed OC, should work. To verify just check by
cobc --help
being in an other directory than opencobol_dir.
the command set PATH =... must be in the appropriate file.
Look at the install guide and user manual to set all the other necessary variables (LB_LIBRARY_PATH, COB_LIBRARY_PATH...) to find the standard libraries during linking.
----------------------------------------------------------------
Hi
thanks a lot. I tried it in so many way but it did not work.
thanks a lot,
Aliv
----------------------------------------------------------------
Well, it would help if you described exactly how you did the OpenCOBOL install.
Also what version of Cygwin.
There are no known problems installing/using OC with
a fairly recent ( < 1 - 2 year old) Cygwin.
Read the README provided with the 0.33 release, make
sure you have any prerequisites installed and follow
the README instructions.
----------------------------------------------------------------
Subject: make errors
Hi to all, well I got past my gmp.h error and was able to run configure with no errors. Now when I run make I get a DB error. Anyone have an idea of what's going on. Here is part of the cocde I get...
fileio.c:236: error: 'struct indexed_file' has no member name 'db'
Is this a Berkley DB issue?
Thanks for any info on this
----------------------------------------------------------------
Looks like you do not have BDB (4.x) correctly installed.
Do a
rpm -qa | grep db-
Amongst a couple of other packets you should see
db-4.x.x-n
db-devel-4.x.x-n
If not, install these with Yast.
Recheck that they are there.
Then in OC, do a
make distclean
./configure
make
and so on.
Roger
----------------------------------------------------------------
Subject: Cut VALUE
Hello,
Normally, I develop Cobol Under Windows because I didn't know that OpenCobol exist.
Now, I've discovered it and I compile my Cobol source file with it, but I've several problems.
In fact, with the compiler that I used under Win, I could type :
77 Sentence PIC X(50) VALUE "Hello, how"
- "are you".
So, I could "cut" my VALUE. I tried to do it with OpenCobol, but it fails. How can I do this ?
Thanks a lot and sorry for my language (I'm not English)
----------------------------------------------------------------
Firstly, SENTENCE is a reserved word, so you will
have to change that.
Then, assuming you are using fixed format (default), the
continuation character '-' must be in column 7.
Also the '77' should start in column 8.
Roger
----------------------------------------------------------------
In fact, as I'm Belgian, I've exactly type :
77 Phrase PIC X(50) VALUE "Hello, how"
- "are you".
So The problem wasn't the reserved word Sentence, but I'm gonna test your solution and i'll tell you if you're right.
Thanks
----------------------------------------------------------------
Probably you can also use the -free option with cobc to avoid problems linked to the number of column...
----------------------------------------------------------------
Actually, no. He specifically uses the continuation
character '-'. That's only valid in fixed format.
There is no continuation in free format.
Continuation of literals in free format is achieved
by concatenation eg. "A" & "B".
Roger
----------------------------------------------------------------
Subject: Error compiling prog. with USAGE COMP-6
I have a projet with a lot of cobol sorce files with data defined USAGE COMP-6. For example
05 KEYS.
10 KEY1 PIC 9(18) COMP-6.
10 KEY2 PIC 9(18) COMP-6.
10 KEY3 PIC 9(18) COMP-6.
10 KEY4 PIC 9(18) COMP-6.
10 KEY5 PIC 9(10) COMP-6.
10 KEY6 PIC 9(18) COMP-6.
10 FILLER PIC X(16).
This programs are compiled with MF Cobol (Server Express) and OpenCobol don't like:
...XXX.cpy:5: syntax error, unexpected WORD, expecting EXTERNAL or GLOBAL
The project have about 5 millions of lines and I trying for compiling with OpenCobol, so I can't modify the sources.
I set some compiler directives for MF:
COB_OPTIONS = -cxg \
-C COPYLIST=0 \
-C DATE \
-C TIME \
-C OSEXT=cpy \
-C COPYEXT="cpy" \
-C XREF \
-C REF \
-C NOANIM \
-C ASSIGN=EXTERNAL \
-C ADDRSV=COMP-6 \
-C COMP-6=2
What can I do for solve this problem.
Tanks.
----------------------------------------------------------------
COMP-6 is a RM Cobol "invention".
I do not think we will ever support the
weird RM non-standard syntax.
Change the syntax to COMP-3 or nothing.
ie. Packed or normal numeric.
Note in both cases that storage allocation will
be different.
A simple shell script will do this.
eg.
Assuming you have source with prefixes ".cpy", ".cbl" -
Set up a new directory eg. "mynewsource" -
Then from your current source directory -
for i in `ls *.cpy *.cbl`
do
sed -e 's/COMP-6/COMP-3/g' <$i >mynewsource/$i
done
That changes COMP-6 to COMP-3 globally.
If you want to change to normal numeric, replace the
COMP-3 in the sed statement with 6 spaces.
(Why spaces? - In case you have comments in columns 73-80)
Somebody may ask why we do not simply accept COMP-6 as a synonym for COMP-3. Well, the format is similar but NOT identical. COMP-3 (aka. PACKED) always has a sign "nibble" (half-byte) regardless whether it is signed/unsigned.
ie. PIC 99 COMP-3 takes 2 bytes (actually 1 and 1/2, the left hand half-byte is ignored) with the right hand half-byte ("nibble") being 0xF.
PIC S99 COMP-3 is the same with the right hand half-byte representing the sign - 0xC positive, 0xD negative.
COMP-6 unsigned (RM) does not have any sign nibble.
Therefore PIC 99 COMP-6 is 1 byte.
Actually, if we did ever support this, it might make more sense to treat COMP-6 as COMP.
----------------------------------------------------------------
> COMP-6 is a RM Cobol "invention".
>
> I do not think we will ever support the weird RM non-standard syntax.
>
> Change the syntax to COMP-3 or nothing. ie. Packed or normal numeric.
>
> Note in both cases that storage allocation will be different.
>
> A simple shell script will do this. eg.
>
> Assuming you have source with prefixes ".cpy", ".cbl" -
> Set up a new directory eg. "mynewsource" -
>
> Then from your current source directory -
>
> for i in `ls *.cpy *.cbl`
> do
> sed -e 's/COMP-6/COMP-3/g' <$i >mynewsource/$i
> done
>
> That changes COMP-6 to COMP-3 globally.
>
> If you want to change to normal numeric, replace the COMP-3 in the sed
> statement with 6 spaces. (Why spaces? - In case you have comments in
> columns 73-80)
>
I can't do this, because in my applications COMP-6 don't means the
same that COMP-3. COMP-6 is a UNSIGNED PACKED DECIMAL, in other words,
without sing nibble. So an area "PIC 9(18) COMP-6" takes 9 bytes and
an area "PIC X(17) also takes 9 bytes, but the left hand half-byte is
ignored.
But on the other hand, I'm keeping a dinamyc copy of producction
source tree in a 'git' respositorie. This make that modify the sources
to adjust to OpenCobol syntax increase the complexity level of this
task.
This project is very large, and we're to look a free Cobol Compiler
that fit a our coding style.
>
> Somebody may ask why we do not simply accept COMP-6 as a synonym for
> COMP-3. Well, the format is similar but NOT identical. COMP-3
> (aka. PACKED) always has a sign "nibble" (half-byte) regardless
> whether it is signed/unsigned.
>
> ie. PIC 99 COMP-3 takes 2 bytes (actually 1 and 1/2, the left hand
> half-byte is ignored) with the right hand half-byte ("nibble") being
> 0xF. PIC S99 COMP-3 is the same with the right hand half-byte
> representing the sign - 0xC positive, 0xD negative.
>
> COMP-6 unsigned (RM) does not have any sign nibble. Therefore PIC 99
> COMP-6 is 1 byte.
> That changes COMP-6 to COMP-3 globally.
>
> If you want to change to normal numeric, replace the COMP-3 in the sed
> statement with 6 spaces. (Why spaces? - In case you have comments in
> columns 73-80)
>
Alright. See the next quote from MicroFocus explaining the COMP-6
Compiler Directive (remember that in my istallation is set to 2):
**********************************************************************
COMP-6
Specifies whether COMP-6 data is to be held in binary or packed
decimal format.
Syntax:
-------
>>-.---.--COMP-6--"integer"----------------><
.-/-+
Parameters:
-----------
integer Must be 1 or 2.
Properties:
-----------
Default: COMP-6"2"
Phase: Syntax check
$SET: Initial
Dependencies:
-------------
RM or MF must be set.
RM and RM"ANSI" set COMP-6"1".
NORM sets COMP-6"2".
Comments:
---------
The possible values of integer are:
1 A binary format is used for COMP-6 data, as described in the
chapter Ryan McFarland COBOL V2.0 Syntax Support in your
Language Reference - Additional Topics.
2 Packed decimal format is used. If the item is signed, the
format is identical to COMP-3. If the item is unsigned, no
sign field is present.
Even if you specify the COMP-6 directive, the reserved word
COMP-6 is recognized only if it belongs to the dialect specified
by RM or MF"10".
Example:
--------
With COMP-6"2" specified:
PIC 99 COMP-6 VALUE 87 is stored in one byte as x"87"
PIC S99 COMP-6 VALUE 87 is stored in two bytes as x"087C"
**********************************************************************
See complete documentation on:
http://supportline.microfocus.com/documentation/books/sx22sp1/cypubb.htm
>
> Actually, if we did ever support this, it might make more sense to
> treat COMP-6 as COMP.
Why? I dont understant.
For legacy applications derived form RM dialects the proper form it's
explained previusly in COMP-6 MF Compiler Directive (COMP-6"2").
----------------------------------------------------------------
You do not need to quote MF stuff at me.
I have been using MF since the days of MF "Level II ET"
which is a couple of decades ago :-)
I gave the answer in my first post.
Change the application so that it is
conformant to Cobol standard.
I generally have had no problem in convincing customers to change their programs to be standard conformant.
If you are asking is it possible that OC could support COMP-6, then, sure, we could support anything.
However, as I have said in other threads, I do have a full-time job which does NOT include developing/maintaining OC.
As such, feature requests like this are at the bottom of my
priority list.
If people would like oddball features like this, then my recommendation is to get involved in the OC source code;
particularly the directories "cobc" (compiler) and "libcob" (runtime).
I am willing to review any submitted code.
Roger
----------------------------------------------------------------
Because this old topic is the only one that wrote about COMP-6 and I just had a quick look at COMP-6 in OC I wanted to bump it up.
There are a lot of interesting things Roger mentioned (I like especially the part of "I am willing to review any submitted code").
Before having a deeper look I wanted to ask what you think about this? How should one decide what mode is used? [code]
1 A binary format is used for COMP-6 data
2 Packed decimal format is used. If the item is signed, the format is identical to COMP-3.
If the item is unsigned, no sign field is present. (standard)[/code]
I think if I'd have a look I would make OC use COMP-6 just as COMP-3 (no matter how the sign field looks like) or as BINARY.
human
BTW: I'm not using COMP-6 or plan to do so, I just want to give our nice OC an addition for easier migrations and this one looks not so hard.
----------------------------------------------------------------
Changing a program from using COMP-6 to COMP-3 (or any other USAGE) is EASY. The problem is that the DATA itself won't work. You need to CONVERT all your outside data files (databases whatever) from an unsigned (not sign nibble) packed format to a format that takes a sign nibble. If you have an odd number of 9's in the PICTURE, this is relatively easy, just convert from
Pic 9(odd-number) Comp-6
to
Pic S9(Odd-number) Packed-Decimal
(or the non-Standard but common COMP-3).
However, if the data is defined with an even numb er of 9's, then your actual files will need to ber expanded by one byte (one for the sign nibble and one for "slack").
Yes, it would be possible to convert to some other USAGE, but I think this would be the easiest way to do it.
NOTE:
This is anotehr place where the MF extension of allowing "makesyn" might be nice. You could actually keep your source code as COMP-6, but make it a synonym for COMP-3.
----------------------------------------------------------------
Do you have some useful examples for makesyn? If I understood [url=http://supportline.microfocus.com/documentation/books/sx22sp1/cyadir.htm#0102]makesyn command line switch from MF[/url] right there only has to be a SEARCH+REPLACE during preprocessing the COBOL file (and copybooks) to add that feature (and only allow this for two reserved words). If this would be added [url=http://supportline.microfocus.com/documentation/books/sx22sp1/cyadir.htm#0016]addsyn[/url] and maybe [url=http://supportline.microfocus.com/documentation/books/sx22sp1/cyadir.htm#0119]override[/url] (the same just with user-defined --> reserved) should be added, too.
Or maybe just add a new own command line switch for doing SEARCH+REPLACE words (without checking if they are reserved or user-defined words)?
Before looking at that I surely want to know how Roger's thoughts about that look like.
human
----------------------------------------------------------------
[quote]
wmklein wrote:
Changing a program from using COMP-6 to COMP-3 (or any other USAGE) is EASY.
[/quote]
It is more complicated. Assume you store a date in a PIC 9(8) COMP-6. Then you can redefine it to a group DAY PIC 9(2) COMP-6, MONTH PIC 9(2) COMP-6 and YEAR PIC 9(4) COMP-6. This won't work any more if you always have a trailing sign nibble.
Alex
----------------------------------------------------------------
Alex, you missed the important next sentence in your [quote]The problem is that the DATA itself won't work.[/quote] But you gave another good example for that problem.
human
----------------------------------------------------------------
Subject: Copy not working & screen section question
In the program use :
copy openfile.
Compile with :
cobc -x -I/usr/local/src/cobol/cpy yourprog.cob
Why are you using /usr/local for user programs ?
You shouldn't be doing that. /usr/local is a
system directory. This also usually means you
are working as "root". DO NOT do this!
(I suppose this could be a MinGW/Cygwin environment
but even then you should work from the home directory)
Re: screen section. There is basically no
runtime support yet. Most of the syntax is
accepted by the compiler.
Roger
----------------------------------------------------------------
Hi to all and I have completely gotten OC 0.33 installed & working. My question is when I run cobc - x testlst.cob A simple file open, read, print & close file program. I get the following error when I run cobc and the source has the standard COBOL copy:
copy openfile.cob in /usr/local/src/cobol/cpy.
I get the following error:
testlst.cob:78: Error: openfile: No such file or directory
cob in /usr/local/src/cobol/cpy/
Anyone have an idea of what I might be doing wrong. Also could someone tell me if screen-section works or not. I see some mention of it not working yet but when I run make check I see Ncurses (libncurses) 5.2 or later referenced. If it is supported is there any documentation avail for this.
Thanks
----------------------------------------------------------------
Subject: Where should OC & prog's go
Thank you Roger for the help with prior post and thanks for pointing out that I should not be using "/usr/local/" directories. With being new to the Linux world could you tell me where OC 'compiler and libraries' should be placed, and where source, copy, and user built libraries should be placed in a Linux system. Should the PATH variable have the location of the OC compiler added to it?
Thanks for the help.
----------------------------------------------------------------
It is correct that the default OC install places things
in the /usr/local directory. This is so that users can use the compiler/runtime without changing anything in their environment and so that the compiler/runtime can be automatically found.
User Cobol programs should be placed somewhere else other than system directories.
eg. On Linux, when you add a user, the user usually gets
(per default) a home directory of /home/.
ie. Let's say you add a user ljungers.
Login as ljungers and you will likely be in
/home/ljungers.
Put your programs/copys there and compile/execute as usual.
Note for the build/install of OC, you only need root permission to do the "make install". Therefore, the
usual procedure (eg. for the 0.33 prerelease) is :
Login as a normal user (eg. ljungers), then :
(Note, next command assumes internet connectivity and presence of the "wget" command; otherwise get the tarball in your usual manner) -
wget http://www.sim-basis.de/open-cobol-0.33.tar.gz
tar xzf open-cobol-0.33.tar.gz
cd open-cobol-0.33
./configure
make
make check
sudo make install
To repeat what I said. do NOT operate as "root"
unless it is really necessary.
Roger
----------------------------------------------------------------
Subject: Any work arounds available for the screen-section?
Was wondering if there is any good work arounds that could replace the function of the screen section. I have several old Micro Focus DOS/batch programs that I would like to convert, but 1st would like to know what would be the easiest way to handle the screen-section. I'm open to any and all sugestions.
Thanks for any info.
----------------------------------------------------------------
Subject: Cobol Reference Manual
Where can I find some document like "Open-Cobol Reference Manual" ?. I'm testing open-cobol and I would like to have informations on ACCEPT / DISPLAY statements... :-(
----------------------------------------------------------------
Subject: several compiler and runtime errors using version 0.33
Hi COBOL user group,
we want to use the open cobol compiler to migrate old COBOL IBM/MVS cobol sources to a Linux system. With the first (smaller, round about 1.000 lines of code ) cobol sources we have no problems. Now i have a cobol programm with roud about 69.000 lines and i have some problems:
1.) the created header file for the c source include several times the same declarations of a structure cob_field f0;
2.) running the changed code i have a core dump in following statement (of the generated c code)
...
if (((cob_cmp((...)
...
curently i'm not able to debug this function of the cobol compiler project.
Can anybody give some hint's how to debug this call?
-Steffen Groba-
----------------------------------------------------------------
Can you send me the offending program
(and any necessary COPY files).
Roger
----------------------------------------------------------------
Hello Roger,
thanks for offering help. We have found in the chrismas week the error on our side. We have used a copy from the MVS System, including all procedures in one text file. Splitting the source code per programm-id, the compiler works fine and we have also not longer the error, to have sevaral times the same declarations in the include file.
But today i will add a new request. Currently i'm not able call a procedure, defined in another source code file. Perhaps you can help me here?
-Steffen- :-)
----------------------------------------------------------------
Sure :-)
----------------------------------------------------------------
Subject: Help Needed on ACCEPT / DISPLAY statements
WORKING-STORAGE SECTION.
77 witem1 pic X(10).
77 x-funkey pic 9(04).
77 wLin pic 999.
77 wPos pic 999.
PROCEDURE DIVISION.
BEGIN.
.
move 5 to wlin
move 10 to wpos
.
ACCEPT witem1
line wlin column wpos
no beep prompt tab
size 5
foreground-color 1
background-color 7
on exception x-Funkey
not on exception
continue
END-ACCEPT.
what can I do to make this work OK ?
If anyone has an idea ... Thank you ..
----------------------------------------------------------------
Subject: please help to download and install opencobol compiler
Hi, im new here and trying to learn cobol programming. The problem is i need compiler to test my codes but im having trouble finding free cobol compiler and thats how i end up here. Tried to download the openCobol .32 but dont know how to start the installation or do I still need to download something, if so please can anyone tell me where i can download. your friendly advise is well appreciated. Thanks
----------------------------------------------------------------
What machine/operating system ?
----------------------------------------------------------------
Subject: Calling cobol procedures from different object files
I have create two small COBOL example files and tested, if i can call from one cobol file a procedure, defined in a second file.
file1 (MAIN):
000020 IDENTIFICATION DIVISION. V78AVER
000030 PROGRAM-ID. TESTPRG. LV008
000170*REMARKS 03.12.90
000180 ENVIRONMENT DIVISION. V78AVER
000190 CONFIGURATION SECTION. V78AVER
000220 SPECIAL-NAMES. DECIMAL-POINT IS COMMA. V78AVER
000230 INPUT-OUTPUT SECTION. V78AVER
000350 DATA DIVISION. V78AVER
000360 FILE SECTION. V78AVER
000370* V78AVER
001140 WORKING-STORAGE SECTION. V78AVER
001150 01 TEST1 PIC S9(4) COMPUTATIONAL.
000280*
000290 88 DB-AUFRUF-OK VALUE +0.
000300 88 KEIN-WEITERER-SATZ-DA VALUE +3.
000310 88 ZEIT-ABGELAUFEN VALUE +9.
000320 88 KEINE-ET-DATEN-DA VALUE +80.
000330 88 SATZ-NICHT-DA VALUE +120.
000340 88 SATZ-NICHT-FREI VALUE +145.
000350 88 SATZ-SCHON-DA VALUE +199.
002660* PVCV000
002670 LINKAGE SECTION. V78AVER
002680/ V78AVER
002690 PROCEDURE DIVISION. V78AVER
002700 V78AVER
002710******************************************************************V78AVER
002720* *V78AVER
002730 H-STEUERUNG SECTION. V78AVER
002740* *V78AVER
002750******************************************************************V78AVER
002760* V78AVER
02768 CALL 'VTEST' USING TEST1.
002910 IF TEST1 = SATZ-SCHON-DA
002920 THEN V78AVER
002930 DISPLAY "Hallo" . V78AVER
002990 STOP RUN.
file2 (PROCEDURE):
000020 IDENTIFICATION DIVISION. V78AVER
000030 PROGRAM-ID. VTEST. LV008
000170*REMARKS 03.12.90
000180 ENVIRONMENT DIVISION. V78AVER
000190 CONFIGURATION SECTION. V78AVER
000200 SOURCE-COMPUTER. IBM-370. V78AVER
000210 OBJECT-COMPUTER. IBM-370. V78AVER
000220 SPECIAL-NAMES. DECIMAL-POINT IS COMMA. V78AVER
000230 INPUT-OUTPUT SECTION. V78AVER
000350 DATA DIVISION. V78AVER
000360 FILE SECTION. V78AVER
000370* V78AVER
001140 WORKING-STORAGE SECTION. V78AVER
002670 LINKAGE SECTION. V78AVER
001150 01 TEST1 PIC S9(4) COMPUTATIONAL.
000280*
000290 88 DB-AUFRUF-OK VALUE +0.
000300 88 KEIN-WEITERER-SATZ-DA VALUE +3.
000310 88 ZEIT-ABGELAUFEN VALUE +9.
000320 88 KEINE-ET-DATEN-DA VALUE +80.
000330 88 SATZ-NICHT-DA VALUE +120.
000340 88 SATZ-NICHT-FREI VALUE +145.
000350 88 SATZ-SCHON-DA VALUE +199.
002660* PVCV000
002690 PROCEDURE DIVISION USING TEST1. V78AVER
002761 MOVE +199 TO TEST1.
027620 MOVE +0 TO TEST1.
027630 MOVE +3 TO TEST1.
027640 MOVE +9 TO TEST1.
027650 MOVE +80 TO TEST1.
027660 MOVE +120 TO TEST1.
027670 MOVE +199 TO TEST1.
002990 EXIT. V78AVER
compiler call:
#!/bin/sh
#
cobc -C \
-std=mvs \
-fixed \
-Wall \
-Wobsolete \
-ftrace \
-fdebugging-line \
-fsource-location \
VTEST.cob \
2> TESTPRG.log
cobc -C \
-std=mvs \
-fixed \
-Wall \
-Wobsolete \
-ftrace \
-fdebugging-line \
-fsource-location \
TESTPRG.cob \
-x 2>> TESTPRG.log
#
gcc -ggdb *.c -o TESTPRG -lm -lcob
exit 0;
Result:
"libcob: can not find module 'VTEST'
Any idea??
----------------------------------------------------------------
Works fine here :-)
roger: # cat TSTPRG.cob
000020 IDENTIFICATION DIVISION.
000030 PROGRAM-ID. TESTPRG.
000170*REMARKS 03.12.90
000180 ENVIRONMENT DIVISION.
000190 CONFIGURATION SECTION.
000220 SPECIAL-NAMES. DECIMAL-POINT IS COMMA.
000230 INPUT-OUTPUT SECTION.
000350 DATA DIVISION.
000360 FILE SECTION.
000370*
001140 WORKING-STORAGE SECTION.
001150 01 TEST1 PIC S9(4) COMPUTATIONAL.
000280*
000290 88 DB-AUFRUF-OK VALUE +0.
000300 88 KEIN-WEITERER-SATZ-DA VALUE +3.
000310 88 ZEIT-ABGELAUFEN VALUE +9.
000320 88 KEINE-ET-DATEN-DA VALUE +80.
000330 88 SATZ-NICHT-DA VALUE +120.
000340 88 SATZ-NICHT-FREI VALUE +145.
000350 88 SATZ-SCHON-DA VALUE +199.
002660* PVCV000
002670 LINKAGE SECTION.
002680/
002690 PROCEDURE DIVISION.
002700
002710******************************************************************V78AVER
002720* *V78AVER
002730 H-STEUERUNG SECTION.
002740* *V78AVER
002750******************************************************************V78AVER
002760*
027680 CALL 'VTEST' USING TEST1.
002910 IF TEST1 = SATZ-SCHON-DA
002920 THEN
002930 DISPLAY "Hallo" .
002990 STOP RUN.
roger: # cat VTEST.cob
000020 IDENTIFICATION DIVISION.
000030 PROGRAM-ID. VTEST.
000170*REMARKS 03.12.90
000180 ENVIRONMENT DIVISION.
000190 CONFIGURATION SECTION.
000200 SOURCE-COMPUTER. IBM-370.
000210 OBJECT-COMPUTER. IBM-370.
000220 SPECIAL-NAMES. DECIMAL-POINT IS COMMA.
000230 INPUT-OUTPUT SECTION.
000350 DATA DIVISION.
000360 FILE SECTION.
000370*
001140 WORKING-STORAGE SECTION.
002670 LINKAGE SECTION.
001150 01 TEST1 PIC S9(4) COMPUTATIONAL.
000280*
000290 88 DB-AUFRUF-OK VALUE +0.
000300 88 KEIN-WEITERER-SATZ-DA VALUE +3.
000310 88 ZEIT-ABGELAUFEN VALUE +9.
000320 88 KEINE-ET-DATEN-DA VALUE +80.
000330 88 SATZ-NICHT-DA VALUE +120.
000340 88 SATZ-NICHT-FREI VALUE +145.
000350 88 SATZ-SCHON-DA VALUE +199.
002660* PVCV000
002690 PROCEDURE DIVISION USING TEST1.
002761 MOVE +199 TO TEST1.
027620 MOVE +0 TO TEST1.
027630 MOVE +3 TO TEST1.
027640 MOVE +9 TO TEST1.
027650 MOVE +80 TO TEST1.
027660 MOVE +120 TO TEST1.
027670 MOVE +199 TO TEST1.
002990 EXIT.
roger: # cobc -x TESTPRG.cob VTEST.cob
roger: # ./TESTPRG
Hallo
Or -
roger: # cobc -x TESTPRG.cob
roger: # cobc -m VTEST.cob
roger: # ./TESTPRG
Hallo
Or -
roger: # cobc TESTPRG.cob
roger: # cobc VTEST.cob
roger: # cobcrun TESTPRG
Hallo
Note the "-m" option is implicit (create module)
----------------------------------------------------------------
Hallo Simrw,
thanks also here for the correct cmpiler options.
-Steffen- :-)
----------------------------------------------------------------
No probs :-)
(Must get the doc up to date - Geez)
Roger
----------------------------------------------------------------
Subject: Ncurses (Screen) Support for Open Cobol Users
First - a big thanks to the developers of the Open Cobol project! I really like what you guys are doing with this project.
For those impatient to get some sort of full screen support for their Open Cobol programs, be sure to visit my project on SF here:
http://sourceforge.net/projects/cobcurses
It started out as a basic Ncurses binding for Cobol programs. The project is mature enough that you can use ncurses from your Cobol programs, but I quickly discovered that ncurses is just a little tedious for the average screen application. However, it does work and can be used in an ncurses only mode.
To make screen development less painful and more rapid, I am currently developing a Screen Designer framework for use with the Ncurses interface provided.
The CobCurses project now fully supports hand crafted screens using "edit fields" instead of bare ncurses calls. The edit field provides sophisticated edit controls and CobCurses supports a field state machine for screen event handling.
The Screen Designer is able to use screens to define screens, their screen background (with the screen painter), and define fields and field features (such as numeric verification and password masking etc.). Screen data is saved in INDEXED files.
The program BGGEN (to be renamed later on), now generates WORKING-STORAGE code for screen background data, and "field info" text. Additionally it generates PROCEDURE DIVISION code for initializing arrays for screen background and field position and attribute info. The field state array is not yet produced, but will be next.
To find out more, browse the CVS repository and view the file named QUICKSTART.
The project already includes a few operating screens for those willing to try it. Perhaps by the time you read this, I'll have some screen shots available at the site as well.
Two major current limitations of the project are:
1. Host endian order only for cobcurses.c
2. Only known to work with Open Cobol (vers 0.32)
I expect that it will work with future versions of Open Cobol. I also plan to make the endianness a compilable choice (perhaps someone wants to volunteer the changes?)
I hope you'll find this useful.
Thanks, Warren.
----------------------------------------------------------------
I haven't thought much about the details but wouldn't it be easier to develop a WEB server interface to OpenCobol? All of the presentation software is already available (the browser). Passing form variables to an OpenCobol application seems like it sould be no more difficult than interfacing to ncurses.
Curt
----------------------------------------------------------------
A web interface to Cobol is certainly an interesting idea, and I think there are good applications for that. However, depending upon what you are doing, web interfaces can be slow and clumsy for data entry operations.
OTOH, I have seen data entry operators fly through text mode screens that were designed for the purpose.
Anyway, nobody's insisting you accept my preferences ;-)
Warren.
----------------------------------------------------------------
Just a quick update (Release 0.02): The screen designer now allows you to configure and save all field states. The generator (BGGEN) now generates all Working-Storage and Procedure Division grunt code in COPY books that you can use. Use module SD001050.cob as an example, since the screen designer now takes advantage of its own generated code.
Warren.
----------------------------------------------------------------
What exactly is this ?
Can we integrate runtime into OC ?
Is it pdcurses compatible (Win) ?
Roger
----------------------------------------------------------------
Re: Big-endian
Generate COMP-5 items or
handle byte-swap :-)
(Depending on compile opts .-) )
Roger
----------------------------------------------------------------
Hi Roger:
CobCurses is more of an "application framework" for using OpenCobol with ncurses. In this form, I doubt there would be anything that you would want to use directly in the compiler/runtime library. If you've ever done any ncurses programming in C, you know that it takes a large number of ncurses API calls to produce anything close to a "sophisticated" screen. As a result, C programmers usually wrap a number of things into higher API calls to reduce the complexity.
Using Ncurses from Cobol presents an even greater challenge than C, because of the impedance mismatch between Cobol's CALL and C programs. As a result you end up moving arguments to fixed locations (PIC 9999 COMP), and passing those. For example, to move the cursor, in CobCurses you would have to do this:
[code]
COPY COBCURSL. {W-S items}
...
MOVE 23 TO NC-POS-COLUMN
MOVE 5 TO NC-POS-LINE
PERFORM NC-MOVE
...
COPY COBCURSQ. {CobCurses Paragraphs}
[/code]
You can use CobCurses this way, if you are a ncurses diehard. I quickly abandoned that idea in favour of expanding that into a "framework" that can work with a screen designer.
To increase the RAD factor, I created a screen designer that let's you paint a screen background, design individual fields (with various input/edit options) and then define the field state array for the state machine (all info stored in INDEXED files). Then a screen generator blasts out two COPY books:
1. WORKING-STORAGE SECTION code
2. PROCEDURE DIVISION code
COPY-ed into a template program, it then becomes much much easier to get a screen up and running, and drastically reduce the amount of debugging.
The "field" interface, calls into a ncurses aware C module (cobcurses.c). Within it the complexities of insert/delete/characters and undo etc. are all handled. One other feature it supports is the "Windowed Field" concept where the field can be much larger than the actual space used on the screen (often a pain in screen design).
The field state machine reduces and almost eliminates the need for special application if statements to control which field is entered next. Obviously, the application can "intervene", as is often necessary when implementing "searches" etc.
What is generated is the initialization of 3 CobCurses specific arrays that define the screen background, the field positon, buffers and attributes, and finally the state array entries.
What I am currently in the process of doing is bootstrapping the new screen designer using the first, mostly hand crafted one. The new one is much cleaner and reliable so far.
Oh, and if I could put a little "plug" in now, I have registered a bug on the SF area regarding variable length tables. Right now CobCurses preallocates fixed sized arrays, but variable length tables would clean up my design. ;-)
I know that is a winded reply- hopefully that explains better what CobCurses is about. I haven't tried pdcurses with CobCobol yet, but I expect that it "should" work. I do intend to test with pdcurses towards the end of the development cycle (I think this would be good for non-cygwin progs).
As far as adding terminal support to OpenCobol, I think ncurses/pdcurses is the right way to go. I am willing to be consulted if you like about ncurses, but beyond getting CobCurses done, I don't think I really have enough free time to otherwise contribute (I have a 2 hour commute to work). Let me know if you want my email address and we can discuss it further if you like. Maybe I can contribute somehow in other ways. I'd sure like to see terminal support added.
Warren.
----------------------------------------------------------------
I didn't know about the COMP-5, but that is a great idea. Is COMP-5 supported in 0.32? I guess I'll probably know before you reply ;-)
Thanks, Warren.
----------------------------------------------------------------
Ok, I just tried out COMP-5 and it works like a charm. Thanks for the tip!
Warren.
----------------------------------------------------------------
:-)
----------------------------------------------------------------
OK.
Mail me private re support/questions.
I have done curses since 1986(!) so I think
I can get to grips with this.
(incidentally, I wrote a (pseudo) curses
package (way back-when)
and only our defined interfaces :
Here is the header for still actual :
#if defined(__hpux) && defined(KHPUX11)
#define __HP_CURSES
#define _CURS_SGTTY
#else /* KHPUX11 */
#ifndef _USING_DGUX
#define _BOOL_T
#define _CHTYPE_T
typedef char bool;
#ifndef KRCHTYPEDEF
typedef char chtype;
#endif
#endif
#endif /* KHPUX11 */
#ifdef NONXPG3
#include
typedef struct termio SGTTY;
#else
#include
#define _SGTTY_T
typedef struct termios SGTTY;
#endif
#ifdef __alpha
#define SINGLE
#endif
#ifdef KAIXBUG
#ifndef __attr_t_
#define __attr_t_
typedef long attr_t;
#endif
#ifndef __cchar_t_
#define __cchar_t_
#define ZLC_MOD_MAX 5
typedef struct {
attr_t a;
wchar_t c;
wchar_t z[ZLC_MOD_MAX];
} cchar_t;
#endif
#endif /* KAIXBUG */
#ifdef __linux__
#include "../src/linterm.h"
#else
#include
#endif
#ifdef CUR
#undef CUR
#endif /* CUR */
#ifdef __linux__
#define CUR termptr.type.
#else
#define CUR termptr.
#endif
#ifdef CURB
#undef CURB
#define CURB bool_str.
static struct _bool_struct bool_str = { 0 };
static char dummypad1[32] = "\0";
#endif /* CURB */
#ifdef CURN
#undef CURN
#define CURN num_str.
static struct _num_struct num_str = { 0 };
static char dummypad2[64] = "\0";
#endif /* CURN */
#ifdef CURS
#undef CURS
#define CURS cur_str.
static struct _str_struct cur_str = { (char *)0 };
static char dummypad3[128] = "\0";
#define KVR2EXT
#endif /* CURS */
static struct term termptr = { 0 };
#include
#include
#include
#include
#ifdef KRSELECTOK
#include
#endif
----------------------------------------------------------------
Very good then. You would also understand the curses programming challenges well from the Cobol side, I expect. ;-)
Anyway, there's nothing in CobCurses that would be useful to the compiler project. The only possible [b]exception[/b] is that if you ever get to the point where you want a "smart field input" feature, some code could be snarfed from my cobcurses.c module if you like.
Is there any roadmapped time line for terminal support in OC?
Thanks, Warren.
----------------------------------------------------------------
Well, post 0.33 release.
The compiler stage is pretty well set up.
Just needs the runtime component.
Roger
----------------------------------------------------------------
I'd be willing to contribute library code if you have the API more-or-less defined for what's needed. Email me at:
[code]
STRING "ve3wwg",
"@",
"cogeco.ca"
TO EMAIL-ADDRESS.
[/code]
if you like.
Thanks, Warren.
----------------------------------------------------------------
Subject: Ability to read from standard input
Microfocus would allow me to SELECT FILE-NAME ASSIGN TO KEYBOARD when I then executed the program I would pipe to the program the input to be read.
Is there an equivalent way to do this in OC?
I have several utility programs to convert that all read from standard input, often being piped the output from several processes.
Thanks
Michael
----------------------------------------------------------------
Maybe this is too obvious, but ACCEPT reads a pipe (stdin) for example, and DISPLAY sends to standard output.
I know that ACCEPT works nicely with piped commands, because I used that in a Makefile.
echo Whatever | mycobolprog
Warren.
----------------------------------------------------------------
The problem we have is that the code we are conveting uses the READ verb. It may be possible to convert to accept instead by moving things around. The question was if OC supported the KEYBOARD option in the Select statement or someother way to use the READ verb to obtain data from Standard Input.
Thanks
----------------------------------------------------------------
I am able to use the ACCEPT verb, however, detecting end of file seems to be a problem. Previously with the SELECT ASSGIGN to KEYBOARD, the READ AT END syntax handled the end of file. How can the ACCEPT detect end of file when a file is piped to the process?
----------------------------------------------------------------
Yes, well, that is what you get for using
non-standard Cobol :-)
However, I will look at this MF variation
and see what can be done.
(We have a number of MF extensions already)
Roger
----------------------------------------------------------------
OK. Pick up the latest 0.33 prerelease from
the link on the home page.
Or directly here :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
ASSIGN [TO] KEYBOARD is handled specially.
The file type will automatically be set
to line sequential (regardless if specified).
Obviously, you can only OPEN INPUT on such
a file.
Roger
----------------------------------------------------------------
I downloaded the linked gz file, did a fresh build, and when I run the program that attempts to use SELECT ... ASSIGN TO KEYBOARD I get the error:
libcob: File does not exist (STATUS=35) File : ''
Do I need to compile with the MF option?
----------------------------------------------------------------
No. Post the prog.
----------------------------------------------------------------
And how you are executing
Roger
----------------------------------------------------------------
Do download/regen..
When again,, post source.
Roger
----------------------------------------------------------------
Did new download and clean rebuild, now program works perfectly reading from standard input via the ASSIGN KEYBOARD syntax.
Thanks
Michael
----------------------------------------------------------------
OK. Thanks, that's good to know.
I will also put a test in the
OC test suite for this.
I hope nobody wants support for
ASSIGN DISPLAY !
That's not trivial.
Roger
----------------------------------------------------------------
Update on last post.
Actually it's not so bad. I have a test
version for ASSIGN [TO] DISPLAY which
appears to work correctly.
This is quite nice as it allows one to program
Cobol as a filter with KEYBOARD/DISPLAY and use
as any other Unix command.
More later when I update the prerelease.
Roger
----------------------------------------------------------------
This is updated.
ChangeLog's etc. is in 0.33.
Roger
----------------------------------------------------------------
Subject: Segmentation vialotion message running example from opencobol manual with release 0.33
Testing the possibility of calling other C-Libs or COBOL Libs from a cobol main lib, i tested the example from your documentation 2.3 (static cobol to c). I only exchange the option -fmain with -x. The result was a "Memory acess violation on shell level. Any idea why? I'm working with gcc version 3.3.3 on SuSE 9.
Thanks!
----------------------------------------------------------------
Works fine here :
roger:~ # cc -c say.c
roger:~ # cobc -x -c -static hello.cob
roger:~ # cobc -x -o hello hello.o say.o
roger:~ # ./hello
Hello World!
----------------------------------------------------------------
Hello Roger,
thanks for the hint with the -x optin in the link section. Perhaps it make sense to extend the user manual for release 0.33 with this needed link option.
----------------------------------------------------------------
Indeed, you are correct :-)
I have sadly neglected the doc :-(
Roger
----------------------------------------------------------------
Subject: Counting Trailing Blanks in Cobol
Whithout resorting to a PERFORM VARYING loop on a character by character basis, how can you count trailing blanks in Open Cobol? I've tried all of the following (below), but none are supported. I believe only the first form is "standard". I did find the other 3 references on the web however.
Thanks, Warren.
[code]
01 B-COUNT PIC 999 VALUE 0.
01 TEST-CASE PIC X(80)
VALUE "This is my string.".
...
ATTEMPT-ONE.
INSPECT FUNCTION REVERSE(TEST-CASE)
TALLYING B-COUNT
FOR ' '.
ATTEMPT-TWO.
INSPECT TEST-CASE IN REVERSE ORDER
TALLYING B-COUNT
FOR ' '.
ATTEMPT-THREE.
INSPECT TEST-CASE
TALLYING B-COUNT
FOR TRAILING BLANKS.
ATTEMPT-FOUR.
MOVE LENGTH-OF-STRING(TEST-CASE) TO B-COUNT.
[/code]
----------------------------------------------------------------
Below refers to OC 0.33 -
Almost correct :-)
Attempt one should be :
INSPECT FUNCTION REVERSE(TEST-CASE)
TALLYING B-COUNT
FOR LEADING ' '.
This should be compatible with all Cobol variants.
(Adheres to Cobol standard)
Attempt three should be :
INSPECT TEST-CASE
TALLYING B-COUNT
FOR TRAILING SPACE.
This is NOT Cobol standard (there is no TRAILING
in the standard), but OC supports this.
Roger
----------------------------------------------------------------
Thanks Roger. Yes, I somehow managed to drop the LEADING from the example I posted here. Attempt three was copied from the net somewhere.
That is great news that it is supported in 0.33.
Implementation Question: When INSPECT FUNCTION REVERSE(TEST-CASE) is used, does just imply a reverse in semantics, or is there an actual behind the scenese 'reverse' operation being done before applying a normal INSPECT? It's just a question of effiency.
Thanks, Warren.
----------------------------------------------------------------
This is a real function that allocates storage for
the size of the source field, does the reverse, and
returns a new field with this.
(See libcob/intrinsics.c)
If the question is aimed at performance then the second (non-standard) solution is better.
Roger
----------------------------------------------------------------
Just to clarify the use of FUNCTION.
(Applies to 0.33)
FUNCTION (generally speaking, there are exceptions) can
be used anywhere where a source item is valid.
It always results in a new temporary field.
This will have the desired characteristics dependant
on the parameters.
eg. FUNCTION MIN (x, y, z)
with x PIC 99
y PIC 9(8) COMP
z PIC 9(6)V99
will result in returning a field that has
at least 8 positions before the (implied) decimal
point and 2 after.
It does NOT ever change the contents of parameters
to the function.
FUNCTION's are nestable.
eg.
DISPLAY FUNCTION REVERSE (FUNCTION UPPER-CASE (myfield)).
Roger
----------------------------------------------------------------
Subject: OpenCOBOL on Windows
Hi.
Can you use OC on Windows too ? I saw it's written there as a supported platform, but there aren't any specific details about how to install it on Windows in the INSTALL file.
I might be missing something. Anyway, any help on how to install OC on Windows will be appreciated.
Thanks in advance.
Dan Dumitru
----------------------------------------------------------------
Sergey Kashyrin maintains various binaries at :
http://kiska.net/opencobol/
They are not actual development, but are at
least based on 0.33.
When 0.33 comes out of the door, these will be updated.
Note - Sergey has been an invaluable tester for
various ports to eg. AIX, HP (-UX), Win 32/64, etc.
Roger
----------------------------------------------------------------
Subject: opencobol0.33+procool 10.2+linuxx86_64
Hello,
Just one question:
Does opencobol 0.33 work with procobol/Oracle 10.2 for linux x86_64 bits ?
Thank you
----------------------------------------------------------------
Ask Oracle :-)
Roger
----------------------------------------------------------------
Subject: CobCurses Release 0.4 Available (Screen Designer)
I have managed to bootstrap the Screen Designer with the first mostly hand-crafted one. SD002 is the Screen Designer 2.0 program that can be used to design screens and generate a large portion of the cobol code as COPY book segments. Use program SD002010.cob as a fairly good example of how to implement a simple file maintenance screen.
Unfortunately documentation is still sadly lacking, but it is moving up on the priority list.
Further productivity enhancements will be added later, like the ability to generate a default set of state definition records. For now the editor otherwise seems quite stable and useful.
Load/unload utilities were added so that you can backup your screen definition database. Furthermore, you should be able to build it on any open platform (you no longer need the binary indexed data files).
There are both source and i386-cygwin download packages available here at [url=http://sourceforge.net/projects/cobcurses]sourceforge.net/projects/cobcurses[/url]
Warren.
----------------------------------------------------------------
Within the CVS repository, you can now get documentation about the Screen Designer program. The API documentation is still outstanding, but you may not need much of that. PDF or MS-Word is available there. If you don't cvs, you can cvs browse to the document and download it that way.
Also look for the template_main.cob and template_screen.cob programs. The next "file release" will build this working template.
The cvs release also now includes full character set support.
Enjoy, Warren.
----------------------------------------------------------------
Release 0.5 is now available. This release includes:
1) The restricted character set support in the
Screen Designer for fields
2) A pair of template Cobol programs for your
next screen. This is a complete and working
program, but suitable as a starting template.
3) A User Guide is provided in PDF format.
Download site: http://sourceforge.net/projects/cobcurses
----------------------------------------------------------------
Subject: problem in compilation(im new to cobol)
Greetings to all members
Im just new to cobol.I just downloaded the opencobol 0.33.and follow the instruction as written on site.im using redhat 9.
un tar:tar xzfv filename
./configure
make
make install
make clean
un tar libtool
tar xzfv libtool
./configure
make
make install
make clean
untar gpm
tar xzfv filename
./configre
make
make install
make clean
Im sure ive done well with out any mistaken in installation.i copied the simple code of hellow world from the forum and paste it inot a file and save it hello.cob
when im compling it directly like
cobc hello.cob
then
./hello
im getting the error open share library object:libcob.so.1 then i make the link of that file and resolve that issue might be im doing that wrong so kindly tell me how to resolve that share library problem and also getting the error segmantaion fault on runing compiled.im looking forward for your kind help
Regards
Net_Spy
----------------------------------------------------------------
From the README -
** 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, /usr/local/lib
is NOT automatically searched at runtime.
Edit /etc/ld.so.conf and add /usr/local/lib to the file.
Rerun "ldconfig".
Also to get an executable -
cobc -x hello.cob
./hello
or compile to module (default - is equivalent to -m option)
cobc hello.cob
cobcrun hello
cobc --help shows options and defaults
Also from the README -
(NOTE - all the following packages are normally part of a Linux distribution. Cygwin also has these as installable packages)
ie. GMP
and
*** Note - libltdl is NOT needed when installing on Linux
or Windows (including Cygwin and MingW) ***
Roger
----------------------------------------------------------------
when i make open cobol i got following messages
[quote]common.c:48: warning: pointer targets in initialization differ in signedness
common.c:49: warning: pointer targets in initialization differ in signedness
common.c:50: warning: pointer targets in initialization differ in signedness
common.c:51: warning: pointer targets in initialization differ in signedness
common.c:52: warning: pointer targets in initialization differ in signedness[/quote]
Also when i run cobc ie cobc hello.cob i got
[quote]In file included from /tmp/cob5ysiH7.c:9:
/tmp/cob5ysiH7.c.h:5: warning: pointer targets in initialization differ in signedness[/quote]
Also when i tried to execute file hello ie ./hello i got error as
[quote]./hello: error while loading shared libraries: libcob.so.1: cannot open shared object file: No such file or directory
[/quote]
my shared lib libcob.so.1 found at /usr/local/lib/
i am using ubuntu 6.06 lts please help me
----------------------------------------------------------------
I don't have ld.so.conf in /etc dir after creating a new one in /etc and addind /usr/local/lib line in the file i got command ./hello worked but other problems still exist
while compiling i got
[quote]
In file included from /tmp/cob5ysiH7.c:9:
/tmp/cob5ysiH7.c.h:5: warning: pointer targets in initialization differ in signedness[/quote]
and make command also results in previous post's warning
[b]ie pointer targets in initialization differ in signedness[/b]
----------------------------------------------------------------
Fix your compiler :-)
Let me guess - Ubuntu has released
with the broken gcc 4.0 or 4.1 compiler.
Roger
----------------------------------------------------------------
Actually, if you use the latest 0.33 prerelease at -
http://www.sim-basis.de/open-cobol-0.33.tar.gz
then there is a workaround for these broken 4.x compilers :-)
----------------------------------------------------------------
how can i upgraded to open cobol-0.33. now i am using open cobol 0.32 . I uninstalled old version and configured 0.33 and when tried the make command i got following error
-------------------------------------------------------------
mkdir .libs
gcc -O2 -finline-functions -fomit-frame-pointer -fsigned-char -Wall -Wwrite-stri ngs -Wmissing-prototypes -Wno-format-y2k -Wl,--export-dynamic -o .libs/cobcrun c obcrun-cobcrun.o -L/home/unni/softwares/open-cobol-0.33/libcob /home/unni/softw ares/open-cobol-0.33/libcob/.libs/libcob.so -lm -lgmp -lncurses -ldb-4.3 -ldl
/home/unni/softwares/open-cobol-0.33/libcob/.libs/libcob.so: undefined reference to `mpz_init2'
collect2: ld returned 1 exit status
make[2]: *** [cobcrun] Error 1
make[2]: Leaving directory `/home/unni/softwares/open-cobol-0.33/bin'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/unni/softwares/open-cobol-0.33'
make: *** [all] Error 2
--------------------------------------------------------
----------------------------------------------------------------
Looks like it is not only gcc that is broken :-)
"mpz_init2" is a routine in the gmp library and there
is quite clearly a "-lgmp" on the command line.
Do this -
make distclean
env | sort >env.txt
./configure 1>conf.txt 2>&1
make 1>make.txt 2>&1
Send me env.txt, conf.txt, make.txt,
config.h and config.log
Roger
----------------------------------------------------------------
Env.txt
[quote]
COLORTERM=gnome-terminal
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-9b5kRNDCLz,guid=4f2fe1458e273e7a8dae2d3dec31f800
DESKTOP_SESSION=default
DISPLAY=:0.0
GDMSESSION=default
GDM_XSERVER_LOCATION=local
GNOME_DESKTOP_SESSION_ID=Default
GNOME_KEYRING_SOCKET=/tmp/keyring-BTklF3/socket
GTK_RC_FILES=/etc/gtk/gtkrc:/home/unni/.gtkrc-1.2-gnome2
HISTCONTROL=ignoredups
HOME=/home/unni
LANG=en_IN
LANGUAGE=en_IN:en
LESSCLOSE=/usr/bin/lesspipe %s %s
LESSOPEN=| /usr/bin/lesspipe %s
LOGNAME=unni
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.flac=01;35:*.mp3=01;35:*.mpc=01;35:*.ogg=01;35:*.wav=01;35:
OLDPWD=/home/unni/softwares
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games
PWD=/home/unni/softwares/open-cobol-0.33
SESSION_MANAGER=local/ubuntu:/tmp/.ICE-unix/5072
SHELL=/bin/bash
SHLVL=1
SSH_AGENT_PID=5114
SSH_AUTH_SOCK=/tmp/ssh-nwDGzU5072/agent.5072
TERM=xterm
USERNAME=unni
USER=unni
_=/usr/bin/env
WINDOWID=35652977
XAUTHORITY=/home/unni/.Xauthority
[/quote]
----------------------------------------------------------------
Per discussion over private mail, it
was discovered that the GMP and BDB
installations were screwed.
Roger
----------------------------------------------------------------
thanks roger for the help
i will tell the process that solved my problem.
my problem in installing new 0.33 prerelease was some errors in the result of make command. the error thrown at make command is [quote]undefined reference to `mpz_init2'[/quote]. I dont know for what reason i got that error.
i will quote the private email discussion with reoger
[quote]
roger: Looks like it is not only gcc that is broken :-)
"mpz_init2" is a routine in the gmp library and there
is quite clearly a "-lgmp" on the command line.
Do this -
make distclean
env | sort >env.txt
./configure 1>conf.txt 2>&1
make 1>make.txt 2>&1
Send me env.txt, conf.txt, make.txt,
config.h and config.log
Roger
[/quote]
after sending those files i got replay as
[quote]Hi,
OK.
Not to do with the problem, however your BDB installation is
not correct -
> checking for BDB db.h version >= 4.1 ... no (3.2)
Here it says that /usr/include/db.h is from version 3.2
> checking for __db_open in -ldb-4.3... yes
Here it says that the library is version 4.3
Make sure you have runtime AND development packages
installed for BDB 4.x (as per README)
Please send output from -
ls -l /usr/lib/libgmp*
Roger
[/quote]
after sending the listing
[quote]Hi,
Well that is not correct.
It is missing some things.
Are there other bits of gmp maybe in other directories ?
Try -
ls -l /lib/libgmp*
ls -l /usr/local/lib/gmp*
If neither of the above show any files, then
your gmp installation is broken.
Reinstall gmp (runtime and development if seperate)
( A complete/correct gmp install looks something like -
ls -l /usr/lib/libgmp*
-rw-r--r-- 1 root root 473418 Mar 19 2005 /usr/lib/libgmp.a
-rwxr-xr-x 1 root root 779 Mar 19 2005 /usr/lib/libgmp.la
lrwxrwxrwx 1 root root 15 Aug 20 2005 /usr/lib/libgmp.so ->
libgmp.so.3.3.3
lrwxrwxrwx 1 root root 15 Aug 20 2005 /usr/lib/libgmp.so.3 ->
libgmp.so.3.3.3
-rwxr-xr-x 1 root root 204200 Mar 19 2005 /usr/lib/libgmp.so.3.3.3
-rw-r--r-- 1 root root 31398 Mar 19 2005 /usr/lib/libgmpxx.a
-rwxr-xr-x 1 root root 834 Mar 19 2005 /usr/lib/libgmpxx.la
lrwxrwxrwx 1 root root 17 Aug 20 2005 /usr/lib/libgmpxx.so ->
libgmpxx.so.3.0.5
lrwxrwxrwx 1 root root 17 Aug 20 2005 /usr/lib/libgmpxx.so.3 ->
libgmpxx.so.3.0.5
-rwxr-xr-x 1 root root 14928 Mar 19 2005 /usr/lib/libgmpxx.so.3.0.5
)
Roger
[/quote]
after reinstalling gimp, i send the libgmp listing
[quote]Hi,
OK. That looks better.
Remove the stuff in /usr/local -
rm /usr/local/include/gmp*
rm /usr/local/lib/libgmp*
and remove the spurious 3.3 lib from /usr/lib -
rm /usr/lib/libgmp.so.3.3.3
When you have done this, run -
ldconfig
(as root)
Incidentally, where did this 3.1 gmp come from ?
I can not believe that this Ubuntu version released with 3.1.
(However, everything should be OK with 3.1)
Now, you need to fix up your BDB and then you should be OK.
Roger
[/quote]
first i used tar ball to install gmp and bdb i think that leads to all these problems later i used packages to install them.
Hope that this will be useful to someone with same problem :-)
----------------------------------------------------------------
To be perfectly clear here and
as documented in the 0.33 README -
For Linux,
Use the distro's packages for
(development and runtime) for
GMP and BDB.
Roger
----------------------------------------------------------------
Subject: OPENCOBOL 0.33 for windows
hi!
i was looking for an open source compiler for windows XP
and i read that open cobol can be used in windows (yehey!!) :)
umm.. the problem is i'm having trouble installing it.
so far, i have downloaded and installed MINGW 5.1.3 and
CYGWIN because I read that I needed this to run Opencobol in windows. i'm not sure about my next step. I read the
install guide but I couldn't quite understand it hehe. :)
Where and when do you do that ./configure and the rest? :)
Sorry, i'm just a super-newbie. :) I only started learning the language a week ago. May I request a step-by-step guide on installing it in windows? I would really love to use this software. Thank You!!
:-)
----------------------------------------------------------------
Look down about 9 topics and you'll see what you're looking for.
----------------------------------------------------------------
I was waiting for that :-)
----------------------------------------------------------------
Subject: Migrate from MicroFocus Cobol to OpenCobol - Problem With level 03
Hello...
I try to migrate from microfocus cobol on HPUX to OpenCobol on linux / Oracle 10G and I have some problems with some variables declared in level 03.
For Example
HPUX / Microfocus Code --> Without Problems of Execution
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
77 S-COUNT PIC S9(7) COMP VALUE 0.
.....
01 S-V1.
03 S-EXAMPLE-V11 PIC S9(4) COMP VALUE 0.
03 S-EXAMPLE-V12 PIC S9(2) COMP VALUE 0.
03 S-EXAMPLE-V13 PIC S9(2) COMP VALUE 0.
....
EXEC SQL END DECLARE SECTION END-EXEC.
...
...
...
...
EXAMPLE-FUNCTION.
EXEC SQL
SELECT COUNT(*)
INTO :S-COUNT
FROM FINCAS
WHERE DAT1 = :S-EXAMPLE-V11
AND DAT2 = :S-EXAMPLE-V12
AND DAT3 = :S-EXAMPLE-V13
END-EXEC.
IN HPUX THE QUERY RETURNS A VALUE N. IN OPENCOBOL-LINUX, RETURNS 0 AND SQLCODE IS = 0
I DID FOLLOWING MODIF AND WALKED...
77 S-EXAMPLE-V11 PIC S9(4) COMP VALUE 0.
77 S-EXAMPLE-V12 PIC S9(2) COMP VALUE 0.
77 S-EXAMPLE-V13 PIC S9(2) COMP VALUE 0.
Somebody had similar problems.... ?
Thank..
----------------------------------------------------------------
1) Use the latest 0.33
2) Check what compile options were used for MF.
In particular, the DIALECT= and IBMCOMP directives
alter the size of binary fields.
If you do not have these directives then you should
be OK with "-std=mf" for OC compiles. If you do,
then start with "-std=bs2000".
3) To actually see what is going on, we would need
to see the generated code from the Oracle preprocessor.
4) Are you sure that the fields should be defined as
COMP and not COMP-5 ?
Note, HP-UX on HP risc is big-endian arhcitecture,
so that COMP is the same as COMP-5.
As you mention Linux, you are probably on Intel x86
whereby COMP is always (compatibly) big-endian and
COMP-5 is little-endian (native machine format).
Roger
----------------------------------------------------------------
Roger,
I updated version of OpenCobol (V 0.33) and worked.
Thank you very much. -
----------------------------------------------------------------
That is nice to know :-)
Everybody take note -
Update to 0.33, you will not regret it.
(I know that I am behind in releasing this
but there seem to be always extensions that
are necessary) :-)
Roger
----------------------------------------------------------------
Subject: Dynamic calls on Windows platform
I'm using the Windows executables provided by Sergey Kashyrin and I'm reading the documentation on opencobol.org. The documentation provides excellent examples of both static and dynamic calls on a UNIX platform. Can somebody provide an example using Windows? I've got a entry in a DLL I'd like to call.
Wow, before I hit enter I hit upon an idea of how to do it but I'd like verification. If I want to dynamically call program ABC, it appears it must be in a DLL called ABC.DLL. There appears to be no way to call ABC which resides in FUBAR.DLL. Right or wrong?
If this is true, I'd like to suggest a new parm on the COBC command where you can specify the library (FUBAR) to find the executable. I'm better the same applies to UNIX but I could be wrong since I don't current test on that platform.
Thanks.
Ed
----------------------------------------------------------------
Already there :-)
I am a bit behind with the documentation.
Set/export the environment COB_PRE_LOAD to the name
of the library -
COB_PRE_LOAD=FUBAR
Roger
----------------------------------------------------------------
Excellent. Thanks. How long has this been in the code? Is it in the Windows build or do I need an update? Obviously this is a runtime export variable. Correct?
Just asking, is it limited to a single DLL or do I can I specify muliple with a semicolon?
----------------------------------------------------------------
1) It is in the Win build.
2) Yes, runtime export variable
3) You can specify multiple libs with a colon
(Yep, that's not typical Win)
COB_PRE_LOAD=FOO:BAR
Roger
----------------------------------------------------------------
Subject: First Steps with Cobol & migration from Acucobol to OpenCobol
Hello to all.
My father-in-law has written more than 10 years ago a cobol program for his own company, using Acucobol running on a SCO unix server.
Now he asks my help to move to a different OS and upgrade the hw without rewrite all the code.
I suggest him Linux with SUSE 10.2.
I've no experience with cobol programming at all, so I start from zero.
I'll buy for sure some books as reference, but I'm sure some of my questions we'll be too low level for this forum.
Does somebody out there have already migrated from Acucobol to OpenCobol? Suggestions & tips ?
I've installed OpenCobol 0.33 under SUSE 10.2.
So, I've started following the online User manual and with "hello world" , just to check if everything works fine.
I'm using Kate as editor, it's ok or I need to use another one?
Copy & Paste this simple program and saved as helloworld.cob
compile it with cobc helloworld.cob with the following errors:
helloworld.cob:1: Warning: Invalid indicator 'e' at column 7
helloworld.cob:6: Warning: File not terminated by a newline
helloworld.cob:1: Error: syntax error, unexpected WORD, expecting PROGRAM_ID
If I do cobcrun helloworld I've got this :
libcob: Cannot find module 'helloworld'
Maybe because I've got some errors in the previous steps.
Maybe is something in the config file .... maybe is my poor knowledge, but for sure tomorrow I'll go to the bookstore.
After this I've open one father-in-law .CBL file, saved it as .cob and compile it, with the following results :
lireeuro.cob:35: Error: 'flag' cannot have PICTURE clause
lireeuro.cob:71: Error: 'cf' reserved word, but not supported yet
lireeuro.cob:78: Error: 'cf' reserved word, but not supported yet
lireeuro.cob: In paragraph 'RIC-CF':
lireeuro.cob:102: Error: 'window' undefined
lireeuro.cob:102: Error: syntax error, unexpected POSITION, expecting COLUMN
lireeuro.cob: In paragraph 'RCF2':
lireeuro.cob:108: Error: syntax error, unexpected POSITION, expecting COLUMN
lireeuro.cob:111: Error: syntax error, unexpected POSITION, expecting COLUMN
lireeuro.cob: In paragraph 'RLEC1':
lireeuro.cob:132: Error: syntax error, unexpected POSITION, expecting COLUMN
Besides my cobol knowledge, do you think this will be a "mission impossible" migration, or it can be done?
For sure some codes lines needs to be rewrite.
The first thing to understand is the new syntax ... I really need a cobol book, so I can help my father-in-law with the migration.
:-)
Thanks in advance for your reply.
eragon
----------------------------------------------------------------
I had a similar error with "position". I changed them all to "column" and my script compiled.
Seems you have more problems but its a start.[quote]
eragon wrote:
Hello to all.
My father-in-law has written more than 10 years ago a cobol program for his own company, using Acucobol running on a SCO unix server.
Now he asks my help to move to a different OS and upgrade the hw without rewrite all the code.
I suggest him Linux with SUSE 10.2.
I've no experience with cobol programming at all, so I start from zero.
I'll buy for sure some books as reference, but I'm sure some of my questions we'll be too low level for this forum.
Does somebody out there have already migrated from Acucobol to OpenCobol? Suggestions & tips ?
I've installed OpenCobol 0.33 under SUSE 10.2.
So, I've started following the online User manual and with "hello world" , just to check if everything works fine.
I'm using Kate as editor, it's ok or I need to use another one?
Copy & Paste this simple program and saved as helloworld.cob
compile it with cobc helloworld.cob with the following errors:
helloworld.cob:1: Warning: Invalid indicator 'e' at column 7
helloworld.cob:6: Warning: File not terminated by a newline
helloworld.cob:1: Error: syntax error, unexpected WORD, expecting PROGRAM_ID
If I do cobcrun helloworld I've got this :
libcob: Cannot find module 'helloworld'
Maybe because I've got some errors in the previous steps.
Maybe is something in the config file .... maybe is my poor knowledge, but for sure tomorrow I'll go to the bookstore.
After this I've open one father-in-law .CBL file, saved it as .cob and compile it, with the following results :
lireeuro.cob:35: Error: 'flag' cannot have PICTURE clause
lireeuro.cob:71: Error: 'cf' reserved word, but not supported yet
lireeuro.cob:78: Error: 'cf' reserved word, but not supported yet
lireeuro.cob: In paragraph 'RIC-CF':
lireeuro.cob:102: Error: 'window' undefined
lireeuro.cob:102: Error: syntax error, unexpected POSITION, expecting COLUMN
lireeuro.cob: In paragraph 'RCF2':
lireeuro.cob:108: Error: syntax error, unexpected POSITION, expecting COLUMN
lireeuro.cob:111: Error: syntax error, unexpected POSITION, expecting COLUMN
lireeuro.cob: In paragraph 'RLEC1':
lireeuro.cob:132: Error: syntax error, unexpected POSITION, expecting COLUMN
Besides my cobol knowledge, do you think this will be a "mission impossible" migration, or it can be done?
For sure some codes lines needs to be rewrite.
The first thing to understand is the new syntax ... I really need a cobol book, so I can help my father-in-law with the migration.
:-)
Thanks in advance for your reply.
eragon[/quote]
----------------------------------------------------------------
Subject: CobCurses Release 0.90 Beta Available (Screen Designer)
Website:
http://sourceforge.net/projects/cobcurses
This release is mostly about portability and bug fixes.
The two new features that were added include:
1. The Read-only field option
2. Limited mouse support (optional)
The project is now in beta status.
If you experience portability issues and/or bugs, please
report them or post to the CobCurses forums so that they
can be addressed.
Thanks, Warren.
Change Log:
[code]
VERSION 0.9 FEB 07, 2007 (Beta)
1. Expanded copy book SCREEN-FD.cob to allow for a
new option (READ-ONLY-OPTION).
2. SD002040.cob now supports on screen maintenance
of a 33.Read-Only Field option.
3. BGGEN now supports the necessary field initialization
to make the read-only fields automatically coloured
the same as the title.
4. Corrected SD002030.cob so that the title line in
the paint screen would be displayed correctly.
5. Numerous adjustments to cobcurses.c for portability
were made. A number of the issues were related to
Cobol parameter alignment issues. Type cleanup
was also done in the interest of portability.
6. Bug fixes to NC_MSG(). Now properly fills out the
entire status line if given a NULL pointer value.
7. Module genkeys.c now generates free format compatible
comment lines. It also now uses PIC 9(18) COMP-5 for
attribute values, to avoid value truncation at the
picture clause level. Now also checks if a given
platform exceeds PIC 9999 for colour or key code
assignments.
8. Now explicitly compiles with -std=cobol2002, so that
it will compile consistently on a given platform
where the defaults may be different.
9. Curses key definitions now stored in the data type
PIC 9(18) COMP-5 for value safety.
10. Corrected some COMP-5 data type and size issues
for greater portability.
11. Comment lines in generated or copybook definitions
now use ">" in column 6 to allow compiling in
programs using free format source code.
12. Bug fix in BGGEN. that was causing it to
generated corrupted lines without a comment
character. This was causing the compiler to
treat those lines as TITLE lines.
13. Makefile has been adjusted to use -x for the
OpenCobol 0.33 compiler release. You can now
change a comment to have it revert to -fmain
if necessary.
14. Preliminary mouse support has been added.
A mouse click within the field being edited
will move the cursor. When the cursor is in
an action field, a mouse click can choose the
field to edit now. There are some bugs in the
Field Maintenance Screen related to this.
Mouse events get sent to the new NC-MOUSE-EVENT
callback.
[/code]
Thanks:
Many thanks to Roger While for his invaluable
assistance in pointing out portability
issues and suggestions for improvement.
----------------------------------------------------------------
Sorry folks. For those that have downloaded release 0.90, you'll want to download the latest cobcurses.c from the CVS repository (browse or otherwise).
A bug snuck in there that will cause the Screen Designer to hang after saving changes to the scrren background (in the screen painter). The current version of cobcurses.c (1.23) corrects this problem.
Warren.
----------------------------------------------------------------
I think the 3270 mode is fairly stable now in CobCurses. In the next little while, I plan to come out with a 0.91 release.
How does 3270 mode work?
In 3270 mode, you do _not_ need to define any "field states" for the state machine. The numbering of the fields is not important, as long as they are unique and range from 1 to 80.
As you might expect, it resembles a mainframe 3270 session (though not exactly). When your application calls NC-3270-STATE-MACHINE, the user is able to visit any editable field and entering/editing any value he chooses. No validation is performed until he terminates the form.
The form is terminated when he presses ENTER or a function key (PF key). At that point, if you have declared any special editing requirements on a field (like numeric etc.) these are checked. If there are no errors, control returns to the calling application.
The exception to this rule is when you define a PF key to be exempt from validation. For example, you can declare that PF12 is exempt, allowing it to function as a "cancel" PF key. This allows the user to press PF12 to return to the calling application, regardless of the edit status of any input field.
This is definitely a simpler mode to work with, and much easier to program. The downside however, is that you will not be able to do interactive browsing of key fields etc.
Note that within a single application, you _can_ have some subroutines using 3270 mode, and some using the former "action mode", if that makes sense. Just be aware that you cannot mix the two modes within one subroutine however.
Note also, there are _no_ callbacks in 3270 mode.
The 3270 mode enhancements are currently only available in CVS. I'll be making a release file soon for those that wish to wait.
Enjoy, Warren.
----------------------------------------------------------------
Subject: error: cannot find -ldb
Hello,
new to opencobol and linux I need assitence. I'm using ubuntu 6.10 and opencobol version that comes with ubuntu. Trying to compile hello.cob ends in a error. Whats wrong?
rugen@computer:~/cobol$ cobc hello.cob
/usr/bin/ld: cannot find -ldb
collect2: ld returned 1 exit status
By the way, is there a installation description for dummies available?
Kind greetings, Rugen
----------------------------------------------------------------
sudo apt-get install libdb4.4 libdb4.4-dev
----------------------------------------------------------------
Hello,
after installing libdb4.4-dev (libdb4.4 was installed allready) running cobc hello.com was successfull. "Hello World!" I'm back to COBOL. ;)
Thank You.
----------------------------------------------------------------
Subject: OPEN COBOL: install in WINDOWS...
I'm not be able to install Open Cobol in windows... I read all the topics about but I didn't understand anything! Please help me... Thanks.
----------------------------------------------------------------
Open cobol is not directly instalable in windows for that you need emulator's which creates linux environment in windows .So you need emulator's such as [url=http://cygwin.com/]cygwin[/url]
----------------------------------------------------------------
That is not true.
Sergey Kashryin has done and maintains
a native Windows port.
Look down at other Win topics for the link.
That means there are 3 ways for Win -
Cygwin
MinGW
Native
Roger
----------------------------------------------------------------
Subject: Problem with EXIT PERFORM
Problem with EXIT PERFORM
Hello,
When we use EXIT PERFORM in an EVALUATE statement itself in a PERFORM statement, we have an error at compilation time.
Here is a source code that implements EXIT PERFORM the way we want :
* $Id: EXITPERF.cbl,v 1.0
IDENTIFICATION DIVISION.
PROGRAM-ID. EXITPERF.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
*
INPUT-OUTPUT SECTION.
FILE-CONTROL.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
77 VARTXT PIC X(018) VALUE "-10000 ".
77 NEGATIF PIC 9(001) VALUE ZEROES.
77 POS-VIRGULE PIC 9(001) VALUE ZEROES.
77 I PIC 9(003) VALUE ZEROES.
77 J PIC 9(003) VALUE ZEROES.
77 ERREUR PIC 9(001) VALUE ZEROES.
PROCEDURE DIVISION.
DEBUT.
INITIALIZE ERREUR I J NEGATIF POS-VIRGULE.
DISPLAY "Nombre=" VARTXT.
PERFORM WITH TEST AFTER VARYING I FROM 1 BY 1 UNTIL I >= 18
IF VARTXT(I:1) IS NUMERIC
ADD 1 TO J
END-IF
EVALUATE VARTXT(I:1)
WHEN "-" MOVE 1 TO NEGATIF
WHEN "," MOVE I TO POS-VIRGULE
EXIT PERFORM
WHEN " " EXIT PERFORM
WHEN OTHER CONTINUE
END-EVALUATE
END-PERFORM
DISPLAY "Nombre=" VARTXT ",NEGATIF=" NEGATIF ",POS-VIRGULE=" POS-VIRGULE ",LONG NB=" J.
FIN.
STOP RUN
.
So when it is compiled, we have the following error message :
$ cobc -free EXITPERF.cbl
/coriolisfs/Coriolisopc410/Tmp/cob17331_0.c: In function `EXITPERF_':
/coriolisfs/Coriolisopc410/Tmp/cob17331_0.c:139: label `l_14' used but not defined
This is the C file generated by cobc :
/* Generated from EXITPERF.cbl by cobc version 0.33 patch level 0 */
#define __USE_STRING_INLINES 1
#include
#include
#include
#include
#include
#define COB_SOURCE_FILE "EXITPERF.cbl"
#define COB_PACKAGE_VERSION "0.33"
#define COB_PATCH_LEVEL 0
/* function prototypes */
static int EXITPERF_ (const int);
int EXITPERF (void);
/* functions */
int
EXITPERF ()
{
return EXITPERF_ (0);
}
/* end functions */
static int
EXITPERF_ (const int entry)
{
#include "EXITPERF.c.h" /* local variables */
static int initialized = 0;
static cob_field *cob_user_parameters[COB_MAX_FIELD_PARAMS];
static cob_module module = { NULL, NULL, NULL, NULL, cob_user_parameters, 0, ',', '$', '.', 1, 1, 1, 0, 0};
/* perform frame stack */
int frame_index;
struct frame { int perform_through; void *return_address; } frame_stack[255];
/* Start of function code */
if (unlikely(entry < 0)) {
initialized = 0;
return 0;
}
module.next = cob_current_module;
cob_current_module = &module;
if (unlikely(initialized == 0))
{
if (!cob_initialized) {
cob_fatal_error (COB_FERROR_INITIALIZED);
}
cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL);
(*(int *) (b_2)) = 0;
(*(int *) (b_3)) = 0;
memcpy (b_5, "-10000", 6);
memset (b_5 + 6, 32, 12);
*(b_6) = 48;
*(b_7) = 48;
own_memset (b_8, 48, 3);
own_memset (b_9, 48, 3);
*(b_10) = 48;
initialized = 1;
}
/* initialize frame stack */
frame_index = 0;
frame_stack[0].perform_through = -1;
/* initialize number of call params */
(*(int *) (b_3)) = cob_call_params;
cob_save_call_params = cob_call_params;
goto l_11;
/* PROCEDURE DIVISION */
/* EXITPERF: */
l_11:;
/* DEBUT: */
/* EXITPERF.cbl:28: INITIALIZE */
{
*(unsigned char *)(b_10) = 48;
memset (b_8, 48, 3);
memset (b_9, 48, 3);
*(unsigned char *)(b_6) = 48;
*(unsigned char *)(b_7) = 48;
}
/* EXITPERF.cbl:30: DISPLAY */
{
cob_new_display (0, 1, 2, &c_19, &f_5);
}
/* EXITPERF.cbl:31: PERFORM */
{
own_memcpy (b_8, "001", 3);
while (1)
{
{
/* EXITPERF.cbl:32: IF */
{
if (cob_is_numeric ((f0.size = 1, f0.data = b_5 + (cob_get_numdisp (b_8, 3) - 1), f0.attr = &a_18, &f0)))
{
/* EXITPERF.cbl:33: ADD */
{
cob_add (&f_9, &c_22, 2);
}
}
}
/* EXITPERF.cbl:35: EVALUATE */
{
if (((int)(*(b_5 + (cob_get_numdisp (b_8, 3) - 1)) - 45) == 0))
{
/* EXITPERF.cbl:36: MOVE */
{
*(b_6) = 49;
}
}
else
if (((int)(*(b_5 + (cob_get_numdisp (b_8, 3) - 1)) - 44) == 0))
{
/* EXITPERF.cbl:37: MOVE */
{
cob_move (&f_8, &f_7);
}
/* EXITPERF.cbl:38: EXIT */
{
goto l_14;
}
}
else
if (((int)(*(b_5 + (cob_get_numdisp (b_8, 3) - 1)) - 32) == 0))
{
/* EXITPERF.cbl:39: EXIT */
{
goto l_16;
}
}
else
{
/* EXITPERF.cbl:40: CONTINUE */
{
;
}
}
}
}
if ((cob_cmp_numdisp (b_8, 3, 18) >= 0))
break;
cob_add (&f_8, &c_22, 4);
}
/* PERFORML-EXIT15: */
l_16:;
}
/* EXITPERF.cbl:43: DISPLAY */
{
cob_new_display (0, 1, 8, &c_19, &f_5, &c_23, &f_6, &c_24, &f_7, &c_25, &f_9);
}
/* FIN: */
/* EXITPERF.cbl:45: STOP */
{
cob_stop_run ((*(int *) (b_2)));
}
cob_current_module = cob_current_module->next;
return (*(int *) (b_2));
}
/* end function stuff */
This is the C.h file generated by cobc :
/* Generated from EXITPERF.cbl by cobc version 0.33 patch level 0 */
static unsigned char b_2[4]; /* RETURN-CODE */
static unsigned char b_3[4]; /* NUMBER-OF-CALL-PARAMETERS */
static unsigned char b_5[18]; /* VARTXT */
static unsigned char b_6[1]; /* NEGATIF */
static unsigned char b_7[1]; /* POS-VIRGULE */
static unsigned char b_8[3]; /* I */
static unsigned char b_9[3]; /* J */
static unsigned char b_10[1]; /* ERREUR */
/* attributes */
static cob_field_attr a_21 = {16, 1, 0, 0, NULL};
static cob_field_attr a_20 = {16, 3, 0, 0, NULL};
static cob_field_attr a_18 = {33, 0, 0, 0, NULL};
/* fields */
static cob_field f_6 = {1, b_6, &a_21}; /* NEGATIF */
static cob_field f_7 = {1, b_7, &a_21}; /* POS-VIRGULE */
static cob_field f_8 = {3, b_8, &a_20}; /* I */
static cob_field f_9 = {3, b_9, &a_20}; /* J */
static cob_field f_5 = {18, b_5, &a_18}; /* VARTXT */
/* constants */
static cob_field c_25 = {9, (unsigned char *)",LONG NB=", &a_18};
static cob_field c_24 = {13, (unsigned char *)",POS-VIRGULE=", &a_18};
static cob_field c_23 = {9, (unsigned char *)",NEGATIF=", &a_18};
static cob_field c_22 = {1, (unsigned char *)"1", &a_21};
static cob_field c_19 = {7, (unsigned char *)"Nombre=", &a_18};
/* cob fields */
cob_field f0;
/* ---------------------------------------------- */
It seems that the only label found at the end of the perform is the last exit perform label.
Thanks in advance for your help.
Eric Rasoa
label `l_14' used but not defined
----------------------------------------------------------------
Correct as stated.
This is perfectly legal code which
should work.
Will have a fix later today.
Will post when new tarball is available.
Roger
----------------------------------------------------------------
OK. Tarball updated (0.33).
Load from link at main page or directly here -
http://www.sim-basis.de/open-cobol-0.33.tar.gz
Roger
----------------------------------------------------------------
TY.
The problem is solved.
eraso :-)
----------------------------------------------------------------
Subject: cobol compile error
when i add author and date-compiled with cobol source code i got following error
unni@ubuntu:~/cobol$ cobc eval.cob
gcc: /tmp/cob5n1ArN.c: No such file or directory
gcc: no input files
-----------my program-----------
IDENTIFICATION DIVISION.
PROGRAM-ID. EVAL.
AUTHOR. UNNIKRISHNAN.
DATE-WRITTEN. 23/02/2007.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 VAR PIC 9(3).
PROCEDURE DIVISION.
MAIN.
ACCEPT VAR.
EVALUATE VAR
WHEN 1 DISPLAY 'VALUE IS ONE'
WHEN 2 DISPLAY 'VALUE IS TWO'
WHEN OTHER DISPLAY 'VALUE IS OTHER'
END-EVALUATE.
STOP RUN.
------------------------------------------------------
----------------------------------------------------------------
Compiles fine here :-)
(0.33)
(Assuming your source is free format)
roglinux:~ # cobc -free webf.cob
roglinux:~ # echo $?
0
Roger
----------------------------------------------------------------
Subject: REAL RECORD SIZE IN LINE SEQ FILE HANDLING
Hello,
I've a question about a problem i've met when trying to have the correct length of a "variable" record that is read from a file with fixed-length records (310 characters for example) :
...
SELECT FIXVAR ASSIGN TO "$DD_TMPDIR/FIXVAR"
ORGANIZATION LINE SEQUENTIAL
FILE STATUS FS-FIXVAR.
...
FIXVAR-T
RECORD IS VARYING IN SIZE FROM 1 TO 1000 DEPENDING ON LONGUEUR.
...
READ FIXVAR
NOT AT END
IF LONGUEUR NOT = 310
THEN
...
END-IF
...
after the read is done, the LONGUEUR variable is equal to 1000 and not to 310. What could be done to resolve this problem.
I Thank you in advance for your help.
Eric Rasoa
----------------------------------------------------------------
You can't. A fixed length record file can not
be defined as anything else.
ie. It can not be defined as "LINE SEQUENTIAL"
and it can not be defined with "RECORD VARYING".
This is exactly according to Cobol standard.
Roger
----------------------------------------------------------------
Subject: Problem with parameters
Hi,
I wanted to try some COBOL with OpenCOBOL for my next classtest :-) and ran into a problem :-?.
It seems like with 0.33 (downloaded and compiled today), the linkage section is either broken or I'm too dumb to use it correctly. (Which might be a cause of Net Express which we use at school?)
I'd like to use a program as a sub-program for another one but the parameters don't seem to work.
As I thought there might be a weird error in my code which I just cannot see, I took the easy "say.cob" example from the User Manual:
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. say.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
01 HELLO PIC X(6).
01 WORLD PIC X(6).
PROCEDURE DIVISION USING HELLO WORLD.
DISPLAY HELLO WORLD.
EXIT PROGRAM.
[/code]
However, it gets to nearly the same error as my program does:
[quote]
LC_ALL="en_GB" LANG="en_GB" cobc say.cob
/tmp/cob25515_0.c: In function 'say_':
/tmp/cob25515_0.c:95: error: 'b_4' undeclared (first use in this function)
/tmp/cob25515_0.c:95: error: (Each undeclared identifier is reported only once
/tmp/cob25515_0.c:95: error: for each function it appears in.)
[/quote]
That's the stuff it produced with 'LC_ALL="en_GB" LANG="en_GB" cobc -C say.cob'
say.c.h
[code]
/* Generated from say.cob by cobc version 0.33 patch level 0 */
static unsigned char b_1[4]; /* RETURN-CODE */
static unsigned char b_2[4]; /* SORT-RETURN */
static unsigned char b_3[4]; /* NUMBER-OF-CALL-PARAMETERS */
/* attributes */
static cob_field_attr a_1 = {33, 0, 0, 0, NULL};
/* local/external fields */
static cob_field f_6 = {6, NULL, &a_1}; /* WORLD */
static cob_field f_5 = {6, NULL, &a_1}; /* HELLO */
/* ---------------------------------------------- */
[/code]
say.c
[code]
/* Generated from say.cob by cobc version 0.33 patch level 0 */
#define __USE_STRING_INLINES 1
#include
#include
#include
#include
#include
#define COB_SOURCE_FILE "say.cob"
#define COB_PACKAGE_VERSION "0.33"
#define COB_PATCH_LEVEL 0
/* function prototypes */
static int say_ (const int, unsigned char *, unsigned char *);
int say (unsigned char *, unsigned char *);
/* functions */
int
say (unsigned char *b_5, unsigned char *b_6)
{
return say_ (0, b_5, b_6);
}
/* end functions */
static int
say_ (const int entry, unsigned char *b_5, unsigned char *b_6)
{
#include "say.c.h" /* local variables */
static int initialized = 0;
static cob_field *cob_user_parameters[COB_MAX_FIELD_PARAMS];
static cob_module module = { NULL, NULL, NULL, NULL, cob_user_parameters, 0, '.', '$', ',', 1, 1, 1, 0, 0};
/* LINKAGE SECTION */
/* perform frame stack */
int frame_index;
struct frame {
int perform_through;
void *return_address;
} frame_stack[255];
/* Start of function code */
if (unlikely(entry < 0)) {
if (!initialized) {
return 0;
}
initialized = 0;
return 0;
}
module.next = cob_current_module;
cob_current_module = &module;
if (unlikely(initialized == 0))
{
if (!cob_initialized) {
cob_fatal_error (COB_FERROR_INITIALIZED);
}
cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL);
cob_set_cancel ((const char *)"say", (void *)say, (void *)say_);
(*(int *) (b_1)) = 0;
(*(int *) (b_2)) = 0;
(*(int *) (b_3)) = 0;
initialized = 1;
}
/* initialize frame stack */
frame_index = 0;
frame_stack[0].perform_through = -1;
/* initialize number of call params */
(*(int *) (b_3)) = cob_call_params;
cob_save_call_params = cob_call_params;
goto l_2;
/* PROCEDURE DIVISION */
/* say: */
l_2:;
/* say.cob:9: DISPLAY */
{
[b]cob_new_display (0, 1, 2, (f_5.data = b_4, &f_5), (f_6.data = b_5, &f_6));[/b]
}
/* say.cob:10: EXIT */
{
goto exit_program;
}
exit_program:
cob_current_module = cob_current_module->next;
return (*(int *) (b_1));
}
/* end function stuff */
[/code]
(I highlighted the line which causes the error.)
Any ideas? :)
----------------------------------------------------------------
Yes, there was an error in the tarball that
was uploaded yesterday.
It has just now been fixed.
Redownload and all should be OK.
Roger
----------------------------------------------------------------
Hi,
thanks, problem seems to be solved. :)
Is there any reason why you don't really specify sub-versions? As far as I've seen so far, it's not really possible to understand the different 0.33 versions at all.
----------------------------------------------------------------
Well, the prerelease is provided as a courtesy
by me. Normally, you would have to hop over
to the OpenCOBOL SourceForge main project
and do a CVS checkout to get actual
status. To do a build from CVS code, you
would then need the extra development tools
as defined in the README (at the bottom).
The tarball creation is a feature of the
autoxxxx (autoconf, automake etc) created
Makefiles (actually created by "make dist",
which, depending on changes, would need the
extra dev tools).
Roger
----------------------------------------------------------------
Subject: problem (link oracle9i)
Greetings to all members.
Im just new to cobol.Working in asianux2.0.
How can I use opencobol0.33 to link oracle9i.
These are a part of my code.
12 WORKING-STORAGE SECTION.
13 EXEC SQL BEGIN DECLARE SECTION END-EXEC.
14 01 USERNAME PIC X(10).
15 01 PASSWORD PIC X(10).
16 01 DB-NAME PIC X(10).
17 01 DB-STRING PIC X(20).
18 EXEC SQL END DECLARE SECTION END-EXEC.
#cobc linkOracle2.cob
linkOracle2.cob:13: Error: Invalid level number 'EXEC'
this is the error.
What should I do? Im looking forward for your kind help
Regards
----------------------------------------------------------------
That is nothing to do with linking.
Pass your source code through the Oracle
Cobol Preprocessor (check your
Oracle documentation) and then try to compile.
EXEC is NOT Cobol standard, however
some Cobol implementations do support it.
OpenCOBOL does not.
Roger
----------------------------------------------------------------
Thank you very much.
----------------------------------------------------------------
Subject: Insatllation problem with MinGW-MSYS
Hi, in trying to install opnecpobol 0.33 under windows xp using the MinGW-MSYS ide and executing the configure script.
I just installed the libgmp in the environment without problems, and executed the opencobol ./configure --without-db couse i don't need the libdb functions. The configure goes ok, but executin the make, i obtain these errors:
"intrinsic.c: In function `cob_intr_locale_date':
intrinsic.c:2178: error: `indate' undeclared (first use in this function)
intrinsic.c:2178: error: (Each undeclared identifier is reported only once
intrinsic.c:2178: error: for each function it appears in.)
intrinsic.c:2183: error: `p' undeclared (first use in this function)
intrinsic.c:2185: error: `len' undeclared (first use in this function)
intrinsic.c:2185: warning: left-hand operand of comma expression has no effect
intrinsic.c:2194: error: `year' undeclared (first use in this function)
intrinsic.c:2199: error: `month' undeclared (first use in this function)
intrinsic.c:2203: error: `days' undeclared (first use in this function)
intrinsic.c: In function `cob_intr_locale_time':
intrinsic.c:2276: error: `indate' undeclared (first use in this function)
intrinsic.c:2281: error: `p' undeclared (first use in this function)
intrinsic.c:2283: error: `len' undeclared (first use in this function)
intrinsic.c:2283: warning: left-hand operand of comma expression has no effect
intrinsic.c:2292: error: `hours' undeclared (first use in this function)
intrinsic.c:2297: error: `minutes' undeclared (first use in this function)
intrinsic.c:2301: error: `seconds' undeclared (first use in this function)
intrinsic.c: In function `cob_intr_locale_date':
intrinsic.c:2185: warning: statement with no effect
intrinsic.c: In function `cob_intr_locale_time':
intrinsic.c:2283: warning: statement with no effect
make[2]: *** [libcob_la-intrinsic.lo] Error 1
make[2]: Leaving directory `/home/mc.god/open-cobol-0.33/libcob'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mc.god/open-cobol-0.33'
make: *** [all] Error 2"
Have you any idea about the cause of the problem?
Thanks :)
----------------------------------------------------------------
Yes, the Win coding for these functions was
not quite complete.
Should be OK now.
Redownload 0.33.
Roger
----------------------------------------------------------------
Yeah, now it's working good! But i've got another little problem...
After:
./configure --without-db
make
make check
make install
it copied cobc.exe under d:/msys/local/bin, and libgmp.dll.a under d:/msys/local/lib
When i try to launch cobc.exe, i says he can't locate the configuration file:
/usr/local/shared/opn-cobol/config/default.cfg
I tried to copy the config folder in this path and even evrywhere in the msys folder but it says always the same.
Did I miss something?
Thank You very much.
----------------------------------------------------------------
Are you sure the message says -
/usr/local/shared/opn-cobol/config/default.cfg
That should be -
/usr/local/shared/open-cobol/config/default.conf
Also, you can only call the compiler ("cobc")
from MSYS shell, NOT from native Win command.
Roger
----------------------------------------------------------------
Sorry, the string is exactly how you said:
/usr/local/shared/open-cobol/config/default.conf
i made some mistakes typing ^^;
And yes, i execute "cobc" from Msys shell.
----------------------------------------------------------------
OK.
Please redo the "make install"
and post output.
The install copies the config files to
the destination directory.
Also what version of MinGW and MSYS do
you have ?
(I will test MinGW later today or tomorrow myself)
Roger
----------------------------------------------------------------
Made "make install", here is the entire output:
_________________________________________________________
$ make install
make install-recursive
make[1]: Entering directory `/home/mc.god/open-cobol-0.33'
Making install in lib
make[2]: Entering directory `/home/mc.god/open-cobol-0.33/lib'
make[3]: Entering directory `/home/mc.god/open-cobol-0.33/lib'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/home/mc.god/open-cobol-0.33/lib'
make[2]: Leaving directory `/home/mc.god/open-cobol-0.33/lib'
Making install in libcob
make[2]: Entering directory `/home/mc.god/open-cobol-0.33/libcob'
make[3]: Entering directory `/home/mc.god/open-cobol-0.33/libcob'
test -z "/usr/local/lib" || mkdir -p -- "/usr/local/lib"
/bin/sh ../libtool --mode=install /bin/install -c 'libcob.la' '/usr/local/lib/libcob.la'
/bin/install -c .libs/libcob.dll.a /usr/local/lib/libcob.dll.a
base_file=`basename ${file}`
dlpath=`/bin/sh 2>&1 -c '. .libs/'${base_file}'i;echo $dlname'`
dldir=/usr/local/lib/`dirname $dlpath`
test -d $dldir || mkdir -p $dldir
/bin/install -c .libs/libcob-1.dll $dldir/libcob-1.dll
chmod a+x $dldir/libcob-1.dll
/bin/install -c .libs/libcob.lai /usr/local/lib/libcob.la
/bin/install -c .libs/libcob.a /usr/local/lib/libcob.a
chmod 644 /usr/local/lib/libcob.a
ranlib /usr/local/lib/libcob.a
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-LLIBDIR' linker flag
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/usr/local/include/libcob" || mkdir -p -- "/usr/local/include/libcob"
/bin/install -c -m 644 'byteswap.h' '/usr/local/include/libcob/byteswap.h'
/bin/install -c -m 644 'common.h' '/usr/local/include/libcob/common.h'
/bin/install -c -m 644 'move.h' '/usr/local/include/libcob/move.h'
/bin/install -c -m 644 'numeric.h' '/usr/local/include/libcob/numeric.h'
/bin/install -c -m 644 'exception.def' '/usr/local/include/libcob/exception.def'
/bin/install -c -m 644 'termio.h' '/usr/local/include/libcob/termio.h'
/bin/install -c -m 644 'fileio.h' '/usr/local/include/libcob/fileio.h'
/bin/install -c -m 644 'screenio.h' '/usr/local/include/libcob/screenio.h'
/bin/install -c -m 644 'strings.h' '/usr/local/include/libcob/strings.h'
/bin/install -c -m 644 'call.h' '/usr/local/include/libcob/call.h'
/bin/install -c -m 644 'intrinsic.h' '/usr/local/include/libcob/intrinsic.h'
/bin/install -c -m 644 'codegen.h' '/usr/local/include/libcob/codegen.h'
/bin/install -c -m 644 'system.def' '/usr/local/include/libcob/system.def'
make[3]: Leaving directory `/home/mc.god/open-cobol-0.33/libcob'
make[2]: Leaving directory `/home/mc.god/open-cobol-0.33/libcob'
Making install in cobc
make[2]: Entering directory `/home/mc.god/open-cobol-0.33/cobc'
make install-am
make[3]: Entering directory `/home/mc.god/open-cobol-0.33/cobc'
make[4]: Entering directory `/home/mc.god/open-cobol-0.33/cobc'
test -z "/usr/local/bin" || mkdir -p -- "/usr/local/bin"
/bin/sh ../libtool --mode=install /bin/install -c 'cobc.exe' '/usr/local/bin/cobc.exe'
/bin/install -c cobc.exe /usr/local/bin/cobc.exe
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/home/mc.god/open-cobol-0.33/cobc'
make[3]: Leaving directory `/home/mc.god/open-cobol-0.33/cobc'
make[2]: Leaving directory `/home/mc.god/open-cobol-0.33/cobc'
Making install in bin
make[2]: Entering directory `/home/mc.god/open-cobol-0.33/bin'
make[3]: Entering directory `/home/mc.god/open-cobol-0.33/bin'
test -z "/usr/local/bin" || mkdir -p -- "/usr/local/bin"
/bin/sh ../libtool --mode=install /bin/install -c 'cobcrun.exe' '/usr/local/bin/cobcrun.exe'
/bin/install -c .libs/cobcrun.exe /usr/local/bin/cobcrun.exe
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/home/mc.god/open-cobol-0.33/bin'
make[2]: Leaving directory `/home/mc.god/open-cobol-0.33/bin'
Making install in po
make[2]: Entering directory `/home/mc.god/open-cobol-0.33/po'
if test "open-cobol" = "gettext-tools"; then \
/bin/sh .././mkinstalldirs /usr/local/share/gettext/po; \
for file in Makefile.in.in remove-potcdate.sin Makevars.template; do \
/bin/install -c -m 644 ./$file \
/usr/local/share/gettext/po/$file; \
done; \
for file in Makevars; do \
rm -f /usr/local/share/gettext/po/$file; \
done; \
else \
: ; \
fi
make[2]: Leaving directory `/home/mc.god/open-cobol-0.33/po'
Making install in texi
make[2]: Entering directory `/home/mc.god/open-cobol-0.33/texi'
make[3]: Entering directory `/home/mc.god/open-cobol-0.33/texi'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/info" || mkdir -p -- "/usr/local/info"
/bin/install -c -m 644 './open-cobol.info' '/usr/local/info/open-cobol.info'
install-info --info-dir='/usr/local/info' '/usr/local/info/open-cobol.info'
make[3]: Leaving directory `/home/mc.god/open-cobol-0.33/texi'
make[2]: Leaving directory `/home/mc.god/open-cobol-0.33/texi'
Making install in config
make[2]: Entering directory `/home/mc.god/open-cobol-0.33/config'
make[3]: Entering directory `/home/mc.god/open-cobol-0.33/config'
make[3]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/share/open-cobol/config" || mkdir -p -- "/usr/local/share/open-cobol/config"
/bin/install -c -m 644 'default.conf' '/usr/local/share/open-cobol/config/default.conf'
/bin/install -c -m 644 'cobol85.conf' '/usr/local/share/open-cobol/config/cobol85.conf'
/bin/install -c -m 644 'cobol2002.conf' '/usr/local/share/open-cobol/config/cobol2002.conf'
/bin/install -c -m 644 'v023.conf' '/usr/local/share/open-cobol/config/v023.conf'
/bin/install -c -m 644 'mf.conf' '/usr/local/share/open-cobol/config/mf.conf'
/bin/install -c -m 644 'ibm.conf' '/usr/local/share/open-cobol/config/ibm.conf'
/bin/install -c -m 644 'mvs.conf' '/usr/local/share/open-cobol/config/mvs.conf'
/bin/install -c -m 644 'bs2000.conf' '/usr/local/share/open-cobol/config/bs2000.conf'
make[3]: Leaving directory `/home/mc.god/open-cobol-0.33/config'
make[2]: Leaving directory `/home/mc.god/open-cobol-0.33/config'
Making install in tests
make[2]: Entering directory `/home/mc.god/open-cobol-0.33/tests'
Making install in cobol85
make[3]: Entering directory `/home/mc.god/open-cobol-0.33/tests/cobol85'
make[4]: Entering directory `/home/mc.god/open-cobol-0.33/tests/cobol85'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/home/mc.god/open-cobol-0.33/tests/cobol85'
make[3]: Leaving directory `/home/mc.god/open-cobol-0.33/tests/cobol85'
make[3]: Entering directory `/home/mc.god/open-cobol-0.33/tests'
make[4]: Entering directory `/home/mc.god/open-cobol-0.33/tests'
make[4]: Nothing to be done for `install-exec-am'.
make[4]: Nothing to be done for `install-data-am'.
make[4]: Leaving directory `/home/mc.god/open-cobol-0.33/tests'
make[3]: Leaving directory `/home/mc.god/open-cobol-0.33/tests'
make[2]: Leaving directory `/home/mc.god/open-cobol-0.33/tests'
make[2]: Entering directory `/home/mc.god/open-cobol-0.33'
make[3]: Entering directory `/home/mc.god/open-cobol-0.33'
test -z "/usr/local/bin" || mkdir -p -- "/usr/local/bin"
/bin/install -c 'cob-config' '/usr/local/bin/cob-config'
test -z "/usr/local/include" || mkdir -p -- "/usr/local/include"
/bin/install -c -m 644 'libcob.h' '/usr/local/include/libcob.h'
make[3]: Leaving directory `/home/mc.god/open-cobol-0.33'
make[2]: Leaving directory `/home/mc.god/open-cobol-0.33'
make[1]: Leaving directory `/home/mc.god/open-cobol-0.33'
_______________________________________________________________
As you can see, the process created the config folder under the right path but it doesn't recognize it:
$ cobc
/usr/local/share/open-cobol/config/default.conf: No such file or directory
error: failed to load the initial config file
I'm using MinGW 5.1.3 with gcc 3.4.5, binutils 2.17, runtime 3.11 and MSYS 1.0.10. MinGW is installed in the mingw subfolder of MSYS, and the proper path is given in /etc/fstab
Thank You ^^
EDIT...
I'v tried onanother machine, getting exactly the same ^^;
----------------------------------------------------------------
Yep, I can reproduce this.
Weird, I do not remember having this
problem last year.
Until I can figure out what is going on, you
can do this workaround -
Assume you have MSYS in C:/msys/1.0
(change the path/name to wherever your MSYS is) -
In OC directory -
make distclean
./configure --datadir=C:/msys/1.0/local/share --without-db
and the rest as usual.
Roger
----------------------------------------------------------------
OK.
This should now be fixed.
Redownload 0.33 and do your normal
configure.
Roger
----------------------------------------------------------------
Thank you very much, I'm going to try and let you know asap ;)
----------------------------------------------------------------
Yeah! Now everything is working allright, opencobl ready to work ;)
Thank you!
----------------------------------------------------------------
:-)
To my mind, this is a bug in the
directory mapping within MSYS/MinGW.
However, a quick google revealed that
other projects were having the same
problem. I had to special case mingw
in the configure to get the real
directory name (using a command that
is only available with MSYS shell - "pwd -W")
Actually, this mingw test brought to light
another problem whereby one of the OC
tests was failing ("make check").
Also fixed.
Slaps self on the wrist and says -
"Repeat after me, I must do mingw ports
regularly" :-)
Roger
Roger
----------------------------------------------------------------
Wow, glad of being helpful, do your best! ^^
----------------------------------------------------------------
Hi,
I'm having what seems like a similar problem. In any event, I've been finding it tricky to ./configure the install under mingw-msys, because it's not finding libdb (which i've plastered all over the place in frustration now). Anyway, I tried --without-db, and lo and behold, I get to make. Unfortunately, it stops at a similar point to the original poster, though the stuff before the make[] stuff is slightly different.
*** Warning: This system can not link to static lib archive /mingw/lib//libgmp.l
a.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
gcc -shared .libs/libcob_la-common.o .libs/libcob_la-move.o .libs/libcob_la-num eric.o .libs/libcob_la-intrinsic.o .libs/libcob_la-termio.o .libs/libcob_la-file io.o .libs/libcob_la-screenio.o .libs/libcob_la-strings.o .libs/libcob_la-call.o -march=i686 -mtune=pentium4 -Wl,--export-all-symbols -Wl,--enable-auto-import -o .libs/libcob-1.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlink er .libs/libcob.dll.a
Creating library file: .libs/libcob.dll.a
.libs/libcob_la-numeric.o:numeric.c:(.text+0x1d8b): undefined reference to `__gmpz_init2'
... ... ... ... ...
.libs/libcob_la-numeric.o:numeric.c:(.text+0x329e): undefined reference to `__gmpz_cmp'
.libs/libcob_la-numeric.o:numeric.c:(.text+0x32ff): undefined reference to `__gmpz_cmp'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x496): undefined reference to `__gmpz_fdiv_ui'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x4b2): undefined reference to `__gmpz_sub_ui'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x1960): undefined reference to `__gmpz_fac_ui'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x1a9b): undefined reference to `__gmpz_get_d'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x1c5d): undefined reference to `__gmpz_get_d'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x1dfa): undefined reference to `__gmpz_get_d'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x1fdd): undefined reference to `__gmpz_get_d'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x21a3): undefined reference to `__gmpz_get_d'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x2369): more undefined references to `__gmpz_get_d' follow
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x3887): undefined reference to `__gmpz_set_ui'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x3c8e): undefined reference to `__gmpz_set_ui'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x3e9e): undefined reference to `__gmpz_set_ui'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x3f6b): undefined reference to `__gmpz_set_ui'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x3fc3): undefined reference to `__gmpz_set_ui'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x44cd): more undefined references to `__gmpz_set_ui' follow
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x49ac): undefined reference to `__gmpz_get_d'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x49e7): undefined reference to `__gmpz_get_d'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x4be2): undefined reference to `__gmpz_set_ui'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x4c14): undefined reference to `__gmpz_set_ui'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x4c50): undefined reference to `__gmpz_set'
.libs/libcob_la-intrinsic.o:intrinsic.c:(.text+0x4cd9): undefined reference to `__gmpz_set_ui'
collect2: ld returned 1 exit status
make[2]: *** [libcob.la] Error 1
make[2]: Leaving directory `/home/JKN/open-cobol-0.33/libcob'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/JKN/open-cobol-0.33'
make: *** [all] Error 2
Sorry about the mass of text. Anyway, installed libtool and gmp without problems, copied the bits from local/* to their equivalent directories in mingw to make sure stuff worked. It might actually be worth a shot having a complete 'how-to' guide for installing in mingw-msys, shouldn't be too large or hard to make. I'd do it myself, but unfortunately I'm more in a position to be needing it than creating it.
----------------------------------------------------------------
Nope, you did not install GMP correctly.
See, within GMP. ./configure --help
----------------------------------------------------------------
Subject: How to link oracle9i(useing opencobol0.33)
Im just new to cobol.Working in asianux2.0.
How can I use opencobol0.33 to link oracle9i.
There is only pro*cobol`s introduction in oracle doc.
I need some code about this.
Im looking forward for your kind help.
----------------------------------------------------------------
I state again, use and read the
documentation for the Oracle
Pro*COBOL Precompiler.
Contact Oracle for further information.
Roger
----------------------------------------------------------------
Thank you.
----------------------------------------------------------------
I hope this help You
My test environment
HP-UX 11.23 PA 64
Oracle 9.2.0.7 EE or SE (including programmer tools)
OpenCobol 0.33.0
Set envs.
ORACLE_HOME=; export ORACLE_HOME
SHLIB_PATH=$SHLIB_PATH:$ORACLE_HOME/lib32; export SHLIB_PATH
ORACLE_PATH=$ORACLE_HOME/bin; export ORACLE_PATH
PATH=$PATH:/usr/local/bin; export PATH
COB_LIBRARY_PATH=/usr/local/lib; export COB_LIBRARY_PATH
Compiling a "test" program (build dynamic method)
make -f $ORACLE_HOME/precomp/demo/procob2/demo_procob_32.mk \
build COBS="test.cob" EXE=test \
PCCFLAGS="sqlcheck=full userid=scott/tiger picx=varchar2 include=$PWD/../clib" \
COB=cobc COBFLAGS=-x -std=mf -fstatic-call -t test.lis COBGNTFLAGS=-m GNT=.sl
:-)
----------------------------------------------------------------
Thanks for posting this example :-)
I have a couple of questions regarding the
params to the make.
Can you send me a mail to my Sourceforge
OpenCOBOL mail address and we can discuss
this off of this list.
Thanks.
Roger
----------------------------------------------------------------
Subject: an editor for cobol in linux
can anybody suggest a syntax highlighting editor for cobol in linux
----------------------------------------------------------------
vim - www.vim.org
Curt
----------------------------------------------------------------
Subject: Environment variable in an assign statement
Hello,
In the cob_open function, the substitution of an environment variable (for AIX and LINUX) fails when the name of the variable contains an "_" character.
For instance :
SELECT BILAN ASSIGN TO "$DIR_ED/BILAN"
with
DIR_ED=/edition/0703
The substitution of the DIR_ED variable doesn't work.
What could be done about that.
Thanks in advance for your help.
eraso
----------------------------------------------------------------
Works fine here (0.33) -
IDENTIFICATION DIVISION.
PROGRAM-ID. prog.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT TEST-FILE ASSIGN "$TESTENV/TEST-FILE".
DATA DIVISION.
FILE SECTION.
FD TEST-FILE.
01 TEST-REC PIC X(10).
WORKING-STORAGE SECTION.
01 X PIC X(10).
PROCEDURE DIVISION.
OPEN OUTPUT TEST-FILE.
CLOSE TEST-FILE.
STOP RUN.
linux:~ # cobc -x prog.cob
linux:~ # export TESTENV=/tmp
linux:~ # ./prog
linux:~ # ls -l /tmp/TEST-FILE
-rw-r--r-- 1 root root 0 Mar 10 11:35 /tmp/TEST-FILE
----------------------------------------------------------------
Hello,
FYI or as a remind, in Unix or Linux, any variable name may contain any combination of alphanumeric character and underscore character.
I may insist but what if the environment variable is called TEST_ENV and not TESTENV. In this case the TEST_ENV variable is not recognized but the TESTENV variable will be by OpenCobol.
So what could be done for that TEST_ENV variable in OpenCobol ?
eraso
----------------------------------------------------------------
And why do you think that assign will
behave this way :-)
Coming from MF ? :-)
Why do you think that another Cobol
will do what you have already preprogrammed :-)
OK. I will look at this.
Roger
----------------------------------------------------------------
OK. This is fixed in the latest 0.33 tarball.
Download from link on home page.
Roger
----------------------------------------------------------------
Subject: Desync problem while reading sequential file
Hello,
With some programs treating sequential files, it appears that while reading records the stream is desynchronized.
So by testing putting a ftell just after the SEEK_INIT statement, the stream is not anymore desynchronized.
What is your opinion about that.
eraso
Platform : Linux RH EL 4 AS/VMWare.
----------------------------------------------------------------
I am sorry, but I do not understand what you
are saying. What do you mean "desynchronized" ?
Can you post an example.
Roger
----------------------------------------------------------------
Subject: Downloaded open-cobol-0.30-1.i386.rpm Linux AS4. Hello World does not work..Please Help..
Dear all,
I am using Red Hat Linux AS 4.0 and have downloaded the package open-cobol-0.30-1.i386.rpm
On double-clicking the RPM package. Linux has auto-installed the RPM. I am able to use the cobc compiler.
However my first program- Hello World, as given on this site does not seem to work.
I get the following error message:
# cobc hello.cob
gcc: /tmp/cobRETwvb.c: No such file or directory
gcc: no input files
I have very little idea what may be wrong. Please help....
----------------------------------------------------------------
I tried the following. And it worked.
# cobc -free hello.cob
# cobc hello.cob
gcc: /tmp/cobVGQmXm.c: No such file or directory
gcc: no input files
#./hello.cob
HELLO WORLD!
Still could not understand, why gcc complains-No such file or directory
Regards
----------------------------------------------------------------
Subject: Win32 Compilation - 'cl'
Hi,
Just ran into a bit of a problem trying to compile a test program using the win32 binaries provided at: http://www.kiska.net/opencobol/
Using the simple 'hello world' demo program from the first bit of the User Manual, named HW.cob, I try the following command and get the subesquent response:
C:\OpenCobol>cobc -v -o C:\OpenCobol\hw.exe C:\OpenCobol\HW.cob
preprocessing C:\OpenCobol\HW.cob into C:\DOCUME~1\JKN\LOKALE~1\Temp\cob50.cob
translating C:\DOCUME~1\JKN\LOKALE~1\Temp\cob50.cob into C:\DOCUME~1\JKN\LOKALE~
1\Temp\cob51.c
cl -I c:/OpenCobol /MD /LD /FeC:\OpenCobol\hw.exe /FoC:\OpenCobol\hw.exe C:\DOC
UME~1\JKN\LOKALE~1\Temp\cob51.c c:/OpenCobol/libcob.lib c:/OpenCobol/gmp.lib
cl gjenkjennes ikke som en intern eller ekstern kommando,
kjrbart program eller satsvis fil.
That last bit is simply translated: 'cl is not recognized as an internal or external command, executable file', what i'm guessing would be the equivalent of 'bad command or file name'. In other words, I need to figure out what 'cl' is, where it comes from, etc.
With the win32 install provided, also comes vcredist_x86.exe, which I have installed (or as far as I can tell I've installed it).
Any ideas?
----------------------------------------------------------------
OC produces C code which requires
a C compiler.
:-)
----------------------------------------------------------------
I ended up getting Visual 2005 Express, and then having to manually edit 'path' in the command prompt so that it would be seen. Probably some nastiness on this machine, problem solved anyway.
----------------------------------------------------------------
Subject: Installation Problem with OpenCobol on *Ubuntu Linux
Hello,
I tried to install OpenCobol on *Ubuntu but i've the following problem:
In Compilation phase it don't worked and it blocks in output i had the following:
[quote]checking for C compiler default output file name... a.out[/quote]
Why? Which is the problem? With Slackware, Mandriva and Vector Linux it works well.
Thanks
----------------------------------------------------------------
You have given nothng to work on.
As I have repeatedly said on this list,
more info is better than no info.
Post all relevant details.
Including :
Ubuntu revision
gcc version
config.log
and anything else that may be useful.
eg. Is this the latest OC 0.33 tarball ?
Roger
----------------------------------------------------------------
Excuse me for the little information given. Now i try to remedy!!
Ubuntu distribution ver 6.10
GCC ver. 4.x. I have tried to install the version 3.x but with this version it had the same problems.
Now i don't have the config.log file to disposition since I am on an other computer.
However i think that is a problem of the distribution Ubuntu. What do you think about?
Thanks
----------------------------------------------------------------
Soryy, but with so little information,
I can not help.
I need at least the config.log.
Can you compile a simple C program ?
Roger
----------------------------------------------------------------
That's the config.log files!!!
Thanks
Bye bye
Gabry
CONFIG-OPENCOBOL.LOG
[code]This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by OpenCOBOL configure 0.32, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ./configure --prefix=/opt/local/opencobol
## --------- ##
## Platform. ##
## --------- ##
hostname = gabry-laptop
uname -m = i686
uname -r = 2.6.17-10-generic
uname -s = Linux
uname -v = #2 SMP Fri Oct 13 18:45:35 UTC 2006
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/bin/X11
PATH: /usr/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1583: checking for a BSD-compatible install
configure:1638: result: /usr/bin/install -c
configure:1649: checking whether build environment is sane
configure:1692: result: yes
configure:1749: checking for gawk
configure:1778: result: no
configure:1749: checking for mawk
configure:1765: found /usr/bin/mawk
configure:1775: result: mawk
configure:1785: checking whether make sets $(MAKE)
configure:1805: result: yes
configure:1969: checking whether to enable maintainer-specific portions of Makefiles
configure:1978: result: no
configure:2032: checking for gcc
configure:2048: found /usr/bin/gcc
configure:2058: result: gcc
configure:2164: checking for style of include used by make
configure:2192: result: GNU
configure:2263: checking for gcc
configure:2279: found /usr/bin/gcc
configure:2289: result: gcc
configure:2533: checking for C compiler version
configure:2536: gcc --version &5
gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2539: $? = 0
configure:2541: gcc -v &5
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
configure:2544: $? = 0
configure:2546: gcc -V &5
gcc: '-V' option must have argument
configure:2549: $? = 1
configure:2572: checking for C compiler default output file name
configure:2575: gcc conftest.c >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:2578: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.32"
| #define PACKAGE_STRING "OpenCOBOL 0.32"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.32"
| #define COB_DEBUG 1
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2617: error: C compiler cannot create executables
See `config.log' for more details.
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_F77_set=
ac_cv_env_F77_value=
ac_cv_env_FFLAGS_set=
ac_cv_env_FFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=mawk
ac_cv_prog_COB_CC=gcc
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run aclocal-1.8'
ALLOCA=''
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run tar'
AR=''
AS=''
AUTOCONF='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run autoconf'
AUTOHEADER='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run autoheader'
AUTOMAKE='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run automake-1.8'
AWK='mawk'
CC='gcc'
CCDEPMODE=''
CFLAGS=''
COBCRUN_SHARED_FALSE=''
COBCRUN_SHARED_TRUE=''
COBC_CFLAGS=''
COBC_LIBS=''
COB_CC='gcc'
COB_CFLAGS=''
COB_CONFIG_DIR=''
COB_EXPORT_DYN=''
COB_LIBRARY_PATH=''
COB_LIBS=''
COB_MODULE_EXT=''
COB_PIC_FLAGS=''
COB_SHARED_OPT=''
COB_STRIP_CMD=''
CPP=''
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
DLLTOOL=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
F77=''
FFLAGS=''
GMSGFMT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
INTLLIBS=''
LDFLAGS=''
LIBCOB_CFLAGS=''
LIBCOB_LIBS='-lm'
LIBICONV=''
LIBINTL=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBICONV=''
LTLIBINTL=''
LTLIBOBJS=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run makeinfo'
MKINSTALLDIRS=''
MSGFMT=''
MSGMERGE=''
OBJDUMP=''
OBJEXT=''
PACKAGE='open-cobol'
PACKAGE_BUGREPORT='open-cobol-list@lists.sourceforge.net'
PACKAGE_NAME='OpenCOBOL'
PACKAGE_STRING='OpenCOBOL 0.32'
PACKAGE_TARNAME='open-cobol'
PACKAGE_VERSION='0.32'
PATH_SEPARATOR=':'
POSUB=''
RANLIB=''
SET_MAKE=''
SHELL='/bin/bash'
STRIP=''
USE_NLS=''
VERSION='0.32'
XGETTEXT=''
ac_ct_AR=''
ac_ct_AS=''
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_ct_DLLTOOL=''
ac_ct_F77=''
ac_ct_OBJDUMP=''
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include='include'
am__leading_dot='.'
am__quote=''
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${prefix}/share'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='mkdir -p -- .'
oldincludedir='/usr/include'
prefix='/opt/local/opencobol'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define COB_DEBUG 1
#define PACKAGE "open-cobol"
#define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
#define PACKAGE_NAME "OpenCOBOL"
#define PACKAGE_STRING "OpenCOBOL 0.32"
#define PACKAGE_TARNAME "open-cobol"
#define PACKAGE_VERSION "0.32"
#define VERSION "0.32"
configure: exit 77[/code]
CONFIG-m4.LOG
[code]This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GNU M4 configure 1.4.8, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = gabry-laptop
uname -m = i686
uname -r = 2.6.17-10-generic
uname -s = Linux
uname -v = #2 SMP Fri Oct 13 18:45:35 UTC 2006
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/bin/X11
PATH: /usr/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1868: checking for a BSD-compatible install
configure:1924: result: /usr/bin/install -c
configure:1935: checking whether build environment is sane
configure:1978: result: yes
configure:2006: checking for a thread-safe mkdir -p
configure:2045: result: /bin/mkdir -p
configure:2058: checking for gawk
configure:2088: result: no
configure:2058: checking for mawk
configure:2074: found /usr/bin/mawk
configure:2085: result: mawk
configure:2096: checking whether make sets $(MAKE)
configure:2117: result: yes
configure:2320: checking build system type
configure:2338: result: i686-pc-linux-gnulibc1
configure:2360: checking host system type
configure:2375: result: i686-pc-linux-gnulibc1
configure:2445: checking for gcc
configure:2461: found /usr/bin/gcc
configure:2472: result: gcc
configure:2710: checking for C compiler version
configure:2717: gcc --version >&5
gcc (GCC) 3.3.6 (Debian 1:3.3.6-15)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2720: $? = 0
configure:2727: gcc -v >&5
Reading specs from /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/specs
Configured with: ../src/configure -v --enable-languages=c,c++ --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug i486-linux-gnu
Thread model: posix
gcc version 3.3.6 (Debian 1:3.3.6-15)
configure:2730: $? = 0
configure:2737: gcc -V >&5
gcc: `-V' option must have argument
configure:2740: $? = 1
configure:2763: checking for C compiler default output file name
configure:2790: gcc conftest.c >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:2793: $? = 1
configure:2831: result:
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU M4"
| #define PACKAGE_TARNAME "m4"
| #define PACKAGE_VERSION "1.4.8"
| #define PACKAGE_STRING "GNU M4 1.4.8"
| #define PACKAGE_BUGREPORT "bug-m4@gnu.org"
| #define PACKAGE "m4"
| #define VERSION "1.4.8"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2838: error: C compiler cannot create executables
See `config.log' for more details.
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=i686-pc-linux-gnulibc1
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i686-pc-linux-gnulibc1
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=mawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
ABSOLUTE_STDINT_H=''
ABSOLUTE_SYS_STAT_H=''
ACLOCAL='${SHELL} /home/gabry/Desktop/OpenCobolSource/m4-1.4.8/missing --run aclocal-1.10'
ALLOCA=''
ALLOCA_H=''
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /home/gabry/Desktop/OpenCobolSource/m4-1.4.8/missing --run tar'
AUTOCONF='${SHELL} /home/gabry/Desktop/OpenCobolSource/m4-1.4.8/missing --run autoconf'
AUTOHEADER='${SHELL} /home/gabry/Desktop/OpenCobolSource/m4-1.4.8/missing --run autoheader'
AUTOMAKE='${SHELL} /home/gabry/Desktop/OpenCobolSource/m4-1.4.8/missing --run automake-1.10'
AWK='mawk'
BITSIZEOF_PTRDIFF_T=''
BITSIZEOF_SIG_ATOMIC_T=''
BITSIZEOF_SIZE_T=''
BITSIZEOF_WCHAR_T=''
BITSIZEOF_WINT_T=''
CC='gcc'
CCDEPMODE=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EOVERFLOW=''
EXEEXT=''
GETOPT_H=''
GL_COND_LIBTOOL_FALSE=''
GL_COND_LIBTOOL_TRUE=''
GREP=''
HAVE_INTTYPES_H=''
HAVE_LONG_LONG_INT=''
HAVE_SIGNED_SIG_ATOMIC_T=''
HAVE_SIGNED_WCHAR_T=''
HAVE_SIGNED_WINT_T=''
HAVE_STDINT_H=''
HAVE_SYS_BITYPES_H=''
HAVE_SYS_INTTYPES_H=''
HAVE_SYS_TYPES_H=''
HAVE_UNSIGNED_LONG_LONG_INT=''
HAVE_WCHAR_H=''
HAVE__BOOL=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LDFLAGS=''
LIBM4_LIBDEPS=''
LIBM4_LTLIBDEPS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
M4_LIBOBJS=''
M4_LTLIBOBJS=''
MAKEINFO='${SHELL} /home/gabry/Desktop/OpenCobolSource/m4-1.4.8/missing --run makeinfo'
OBJEXT=''
PACKAGE='m4'
PACKAGE_BUGREPORT='bug-m4@gnu.org'
PACKAGE_NAME='GNU M4'
PACKAGE_STRING='GNU M4 1.4.8'
PACKAGE_TARNAME='m4'
PACKAGE_VERSION='1.4.8'
PATH_SEPARATOR=':'
PTRDIFF_T_SUFFIX=''
RANLIB=''
SET_MAKE=''
SHELL='/bin/bash'
SIG_ATOMIC_T_SUFFIX=''
SIZE_T_SUFFIX=''
STACKOVF_FALSE=''
STACKOVF_TRUE=''
STDBOOL_H=''
STDINT_H=''
STRIP=''
SYS_STAT_H=''
UNISTD_H=''
VERSION='1.4.8'
WCHAR_T_SUFFIX=''
WINT_T_SUFFIX=''
ac_ct_CC='gcc'
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnulibc1'
build_alias=''
build_cpu='i686'
build_os='linux-gnulibc1'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='i686-pc-linux-gnulibc1'
host_alias=''
host_cpu='i686'
host_os='linux-gnulibc1'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='$(SHELL) /home/gabry/Desktop/OpenCobolSource/m4-1.4.8/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='/bin/mkdir -p'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define PACKAGE_NAME "GNU M4"
#define PACKAGE_TARNAME "m4"
#define PACKAGE_VERSION "1.4.8"
#define PACKAGE_STRING "GNU M4 1.4.8"
#define PACKAGE_BUGREPORT "bug-m4@gnu.org"
#define PACKAGE "m4"
#define VERSION "1.4.8"
configure: exit 77[/code]
config-gmp.log
[code]This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by GNU MP configure 4.2.1, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = gabry-laptop
uname -m = i686
uname -r = 2.6.17-10-generic
uname -s = Linux
uname -v = #2 SMP Fri Oct 13 18:45:35 UTC 2006
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/bin/X11
PATH: /usr/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1658: checking build system type
configure:1676: result: i686-pc-linux-gnulibc1
configure:1684: checking host system type
configure:1698: result: i686-pc-linux-gnulibc1
configure:1721: checking for a BSD-compatible install
configure:1776: result: /usr/bin/install -c
configure:1787: checking whether build environment is sane
configure:1830: result: yes
configure:1887: checking for gawk
configure:1916: result: no
configure:1887: checking for mawk
configure:1903: found /usr/bin/mawk
configure:1913: result: mawk
configure:1923: checking whether make sets $(MAKE)
configure:1943: result: yes
configure:2109: checking whether to enable maintainer-specific portions of Makefiles
configure:2118: result: no
User:
ABI=
CC=
CFLAGS=(unset)
CPPFLAGS=(unset)
MPN_PATH=
GMP:
abilist=32
cclist=gcc icc
configure:3776: gcc 2>&1 | grep xlc >/dev/null
configure:3779: $? = 1
configure:3833: checking compiler gcc -m32 -O2 -fomit-frame-pointer
Test compile:
configure:3847: gcc -m32 -O2 -fomit-frame-pointer conftest.c >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:3850: $? = 1
failed program was:
int main () { return 0; }
configure:4856: result: no
configure:3833: checking compiler gcc -O2 -fomit-frame-pointer
Test compile:
configure:3847: gcc -O2 -fomit-frame-pointer conftest.c >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:3850: $? = 1
failed program was:
int main () { return 0; }
configure:4856: result: no
configure:3754: icc -c conftest.c >&5
./configure: line 3755: icc: command not found
configure:3757: $? = 127
configure:3776: icc 2>&1 | grep xlc >/dev/null
configure:3779: $? = 1
configure:3833: checking compiler icc -no-gcc
Test compile:
configure:3847: icc -no-gcc conftest.c >&5
./configure: line 3848: icc: command not found
configure:3850: $? = 127
failed program was:
int main () { return 0; }
configure:4856: result: no
configure:5094: error: could not find a working compiler, see config.log for details
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=i686-pc-linux-gnulibc1
ac_cv_build_alias=i686-pc-linux-gnulibc1
ac_cv_env_ABI_set=
ac_cv_env_ABI_value=
ac_cv_env_CC_FOR_BUILD_set=
ac_cv_env_CC_FOR_BUILD_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_FOR_BUILD_set=
ac_cv_env_CPP_FOR_BUILD_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_M4_set=
ac_cv_env_M4_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i686-pc-linux-gnulibc1
ac_cv_host_alias=i686-pc-linux-gnulibc1
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=mawk
ac_cv_prog_make_make_set=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
ABI=''
ACLOCAL='${SHELL} /home/gabry/Desktop/OpenCobolSource/gmp-4.2.1/missing --run aclocal-1.8'
AMTAR='${SHELL} /home/gabry/Desktop/OpenCobolSource/gmp-4.2.1/missing --run tar'
ANSI2KNR=''
AR=''
AS=''
AUTOCONF='${SHELL} /home/gabry/Desktop/OpenCobolSource/gmp-4.2.1/missing --run autoconf'
AUTOHEADER='${SHELL} /home/gabry/Desktop/OpenCobolSource/gmp-4.2.1/missing --run autoheader'
AUTOMAKE='${SHELL} /home/gabry/Desktop/OpenCobolSource/gmp-4.2.1/missing --run automake-1.8'
AWK='mawk'
BITS_PER_MP_LIMB=''
CALLING_CONVENTIONS_OBJS='x86call.lo x86check$U.lo'
CC=''
CCAS=''
CC_FOR_BUILD=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CPP_FOR_BUILD=''
CXX=''
CXXCPP=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFN_LONG_LONG_LIMB=''
DEFS=''
DLLTOOL=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENABLE_STATIC_FALSE=''
ENABLE_STATIC_TRUE=''
EXEEXT=''
EXEEXT_FOR_BUILD=''
GMP_LDFLAGS=''
GMP_NAIL_BITS='0'
HAVE_CLOCK_01=''
HAVE_CPUTIME_01=''
HAVE_GETRUSAGE_01=''
HAVE_GETTIMEOFDAY_01=''
HAVE_HOST_CPU_FAMILY_power='0'
HAVE_HOST_CPU_FAMILY_powerpc='0'
HAVE_SIGACTION_01=''
HAVE_SIGALTSTACK_01=''
HAVE_SIGSTACK_01=''
HAVE_STACK_T_01=''
HAVE_SYS_RESOURCE_H_01=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
LDFLAGS=''
LEX=''
LEXLIB=''
LEX_OUTPUT_ROOT=''
LIBCURSES=''
LIBGMPXX_LDFLAGS=''
LIBGMP_DLL=''
LIBGMP_LDFLAGS=''
LIBM=''
LIBM_FOR_BUILD=''
LIBOBJS=''
LIBREADLINE=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBOBJS=''
M4=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL} /home/gabry/Desktop/OpenCobolSource/gmp-4.2.1/missing --run makeinfo'
OBJDUMP=''
OBJEXT=''
PACKAGE='gmp'
PACKAGE_BUGREPORT='gmp-bugs@swox.com'
PACKAGE_NAME='GNU MP'
PACKAGE_STRING='GNU MP 4.2.1'
PACKAGE_TARNAME='gmp'
PACKAGE_VERSION='4.2.1'
PATH_SEPARATOR=':'
RANLIB=''
SET_MAKE=''
SHELL='/bin/bash'
SPEED_CYCLECOUNTER_OBJ='pentium.lo'
STRIP=''
TAL_OBJECT=''
TUNE_SQR_OBJ=''
U=''
U_FOR_BUILD=''
VERSION='4.2.1'
WANT_CXX_FALSE=''
WANT_CXX_TRUE=''
WANT_MPBSD_FALSE=''
WANT_MPBSD_TRUE='#'
WITH_READLINE_01=''
YACC=''
ac_ct_AR=''
ac_ct_AS=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_DLLTOOL=''
ac_ct_OBJDUMP=''
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__leading_dot='.'
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnulibc1'
build_alias=''
build_cpu='i686'
build_os='linux-gnulibc1'
build_vendor='pc'
datadir='${prefix}/share'
exec_prefix='NONE'
gmp_srclinks=''
host='i686-pc-linux-gnulibc1'
host_alias=''
host_cpu='i686'
host_os='linux-gnulibc1'
host_vendor='pc'
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/home/gabry/Desktop/OpenCobolSource/gmp-4.2.1/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='mkdir -p -- .'
mpn_objects=''
mpn_objs_in_libgmp=''
mpn_objs_in_libmp=''
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define HAVE_HOST_CPU_i686 1
#define PACKAGE "gmp"
#define PACKAGE_BUGREPORT "gmp-bugs@swox.com"
#define PACKAGE_NAME "GNU MP"
#define PACKAGE_STRING "GNU MP 4.2.1"
#define PACKAGE_TARNAME "gmp"
#define PACKAGE_VERSION "4.2.1"
#define VERSION "4.2.1"
#define WANT_FFT 1
configure: exit 1[/code]
config.ncurses.log
[code]This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.52.20061216. Invocation command line was
$ ./configure --prefix=/opt/local/ncurses
## ---------- ##
## Platform. ##
## ---------- ##
hostname = gabry-laptop
uname -m = i686
uname -r = 2.6.17-10-generic
uname -s = Linux
uname -v = #2 SMP Fri Oct 13 18:45:35 UTC 2006
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games
## ------------ ##
## Core tests. ##
## ------------ ##
configure:1080: PATH=".;."; conftest.sh
./configure: 1087: conftest.sh: not found
configure:1083: $? = 127
configure:1096: checking for egrep
configure:1106: result: grep -E
configure:1120: result: Configuring NCURSES 5.6 ABI 5 (Fri Mar 16 22:46:40 CET 2007)
configure:1225: checking build system type
configure:1243: result: i686-pc-linux-gnulibc1
configure:1250: checking host system type
configure:1264: result: i686-pc-linux-gnulibc1
configure:1272: checking target system type
configure:1286: result: i686-pc-linux-gnulibc1
configure:1317: result: Configuring for linux-gnulibc1
configure:1341: checking for prefix
configure:1353: result: /opt/local/ncurses
configure:1429: checking for gcc
configure:1444: found /usr/bin/gcc
configure:1452: result: gcc
configure:1680: checking for C compiler version
configure:1683: gcc --version &5
gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:1686: $? = 0
configure:1688: gcc -v &5
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
configure:1691: $? = 0
configure:1693: gcc -V &5
gcc: '-V' option must have argument
configure:1696: $? = 1
configure:1716: checking for C compiler default output
configure:1719: gcc conftest.c >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
configure:1722: $? = 1
configure: failed program was:
#line 1700 "configure"
#include "confdefs.h"
int
main ()
{
;
return 0;
}
configure:1745: error: C compiler cannot create executables
## ----------------- ##
## Cache variables. ##
## ----------------- ##
ac_cv_build='i686-pc-linux-gnulibc1'
ac_cv_build_alias='i686-pc-linux-gnulibc1'
ac_cv_env_CC_set=''
ac_cv_env_CC_value=''
ac_cv_env_CFLAGS_set=''
ac_cv_env_CFLAGS_value=''
ac_cv_env_CPPFLAGS_set=''
ac_cv_env_CPPFLAGS_value=''
ac_cv_env_CPP_set=''
ac_cv_env_CPP_value=''
ac_cv_env_CXXCPP_set=''
ac_cv_env_CXXCPP_value=''
ac_cv_env_CXXFLAGS_set=''
ac_cv_env_CXXFLAGS_value=''
ac_cv_env_CXX_set=''
ac_cv_env_CXX_value=''
ac_cv_env_LDFLAGS_set=''
ac_cv_env_LDFLAGS_value=''
ac_cv_env_build_alias_set=''
ac_cv_env_build_alias_value=''
ac_cv_env_host_alias_set=''
ac_cv_env_host_alias_value=''
ac_cv_env_target_alias_set=''
ac_cv_env_target_alias_value=''
ac_cv_host='i686-pc-linux-gnulibc1'
ac_cv_host_alias='i686-pc-linux-gnulibc1'
ac_cv_prog_ac_ct_CC='gcc'
ac_cv_prog_egrep='grep -E'
ac_cv_target='i686-pc-linux-gnulibc1'
ac_cv_target_alias='i686-pc-linux-gnulibc1'
cf_cv_abi_version='5'
cf_cv_rel_version='5.6'
cf_cv_system_name='linux-gnulibc1'
cf_cv_timestamp='Fri Mar 16 22:46:40 CET 2007'
## ------------ ##
## confdefs.h. ##
## ------------ ##
#define SYSTEM_NAME "linux-gnulibc1"
configure: exit 77[/code]
Excuse me for the long texts!!! :pint:
----------------------------------------------------------------
configure:2572: checking for C compiler default output file name
configure:2575: gcc conftest.c >&5
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
OK. Here is your problem.
Your development tools installation is screwed up.
Not an OC problem.
----------------------------------------------------------------
OK simrw,
i've installed the meta package build-essential and now it build, compile the packages.
Then I've build, compile and install without problems the packages follows: m4-x.x.x, gmp-x.x.x, libtool-x.x.x, Berkley db (db-x.x.x) and ncurses.
But when i do ./configure for build the opencobol-0.32 it has the follow result (config.log):
[code]This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by OpenCOBOL configure 0.32, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = gabry-laptop
uname -m = i686
uname -r = 2.6.17-10-generic
uname -s = Linux
uname -v = #2 SMP Fri Oct 13 18:45:35 UTC 2006
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/bin/X11
PATH: /usr/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1583: checking for a BSD-compatible install
configure:1638: result: /usr/bin/install -c
configure:1649: checking whether build environment is sane
configure:1692: result: yes
configure:1749: checking for gawk
configure:1778: result: no
configure:1749: checking for mawk
configure:1765: found /usr/bin/mawk
configure:1775: result: mawk
configure:1785: checking whether make sets $(MAKE)
configure:1805: result: yes
configure:1969: checking whether to enable maintainer-specific portions of Makefiles
configure:1978: result: no
configure:2032: checking for gcc
configure:2048: found /usr/bin/gcc
configure:2058: result: gcc
configure:2164: checking for style of include used by make
configure:2192: result: GNU
configure:2263: checking for gcc
configure:2279: found /usr/bin/gcc
configure:2289: result: gcc
configure:2533: checking for C compiler version
configure:2536: gcc --version &5
gcc (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2539: $? = 0
configure:2541: gcc -v &5
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
configure:2544: $? = 0
configure:2546: gcc -V &5
gcc: '-V' option must have argument
configure:2549: $? = 1
configure:2572: checking for C compiler default output file name
configure:2575: gcc conftest.c >&5
configure:2578: $? = 0
configure:2624: result: a.out
configure:2629: checking whether the C compiler works
configure:2635: ./a.out
configure:2638: $? = 0
configure:2655: result: yes
configure:2662: checking whether we are cross compiling
configure:2664: result: no
configure:2667: checking for suffix of executables
configure:2669: gcc -o conftest conftest.c >&5
configure:2672: $? = 0
configure:2697: result:
configure:2703: checking for suffix of object files
configure:2724: gcc -c conftest.c >&5
configure:2727: $? = 0
configure:2749: result: o
configure:2753: checking whether we are using the GNU C compiler
configure:2777: gcc -c conftest.c >&5
configure:2783: $? = 0
configure:2787: test -z
|| test ! -s conftest.err
configure:2790: $? = 0
configure:2793: test -s conftest.o
configure:2796: $? = 0
configure:2809: result: yes
configure:2815: checking whether gcc accepts -g
configure:2836: gcc -c -g conftest.c >&5
configure:2842: $? = 0
configure:2846: test -z
|| test ! -s conftest.err
configure:2849: $? = 0
configure:2852: test -s conftest.o
configure:2855: $? = 0
configure:2866: result: yes
configure:2883: checking for gcc option to accept ANSI C
configure:2953: gcc -c -g -O2 conftest.c >&5
configure:2959: $? = 0
configure:2963: test -z
|| test ! -s conftest.err
configure:2966: $? = 0
configure:2969: test -s conftest.o
configure:2972: $? = 0
configure:2990: result: none needed
configure:3008: gcc -c -g -O2 conftest.c >&5
conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me'
configure:3014: $? = 1
configure: failed program was:
| #ifndef __cplusplus
| choke me
| #endif
configure:3149: checking dependency style of gcc
configure:3234: result: gcc3
configure:3252: checking for getopt_long_only
configure:3309: gcc -o conftest -g -O2 conftest.c >&5
configure:3315: $? = 0
configure:3319: test -z
|| test ! -s conftest.err
configure:3322: $? = 0
configure:3325: test -s conftest
configure:3328: $? = 0
configure:3340: result: yes
configure:3366: checking for regcomp in -lregex
configure:3396: gcc -o conftest -g -O2 conftest.c -lregex >&5
/usr/bin/ld: cannot find -lregex
collect2: ld returned 1 exit status
configure:3402: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.32"
| #define PACKAGE_STRING "OpenCOBOL 0.32"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.32"
| #define COB_DEBUG 1
| /* end confdefs.h. */
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char regcomp ();
| int
| main ()
| {
| regcomp ();
| ;
| return 0;
| }
configure:3428: result: no
configure:3442: checking how to run the C preprocessor
configure:3477: gcc -E conftest.c
configure:3483: $? = 0
configure:3515: gcc -E conftest.c
conftest.c:12:28: error: ac_nonexistent.h: No such file or directory
configure:3521: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.32"
| #define PACKAGE_STRING "OpenCOBOL 0.32"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.32"
| #define COB_DEBUG 1
| /* end confdefs.h. */
| #include
configure:3560: result: gcc -E
configure:3584: gcc -E conftest.c
configure:3590: $? = 0
configure:3622: gcc -E conftest.c
conftest.c:12:28: error: ac_nonexistent.h: No such file or directory
configure:3628: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.32"
| #define PACKAGE_STRING "OpenCOBOL 0.32"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.32"
| #define COB_DEBUG 1
| /* end confdefs.h. */
| #include
configure:3672: checking for egrep
configure:3682: result: grep -E
configure:3687: checking for ANSI C header files
configure:3712: gcc -c -g -O2 conftest.c >&5
configure:3718: $? = 0
configure:3722: test -z
|| test ! -s conftest.err
configure:3725: $? = 0
configure:3728: test -s conftest.o
configure:3731: $? = 0
configure:3820: gcc -o conftest -g -O2 conftest.c >&5
conftest.c: In function 'main':
conftest.c:29: warning: incompatible implicit declaration of built-in function 'exit'
configure:3823: $? = 0
configure:3825: ./conftest
configure:3828: $? = 0
configure:3843: result: yes
configure:3867: checking for sys/types.h
configure:3883: gcc -c -g -O2 conftest.c >&5
configure:3889: $? = 0
configure:3893: test -z
|| test ! -s conftest.err
configure:3896: $? = 0
configure:3899: test -s conftest.o
configure:3902: $? = 0
configure:3913: result: yes
configure:3867: checking for sys/stat.h
configure:3883: gcc -c -g -O2 conftest.c >&5
configure:3889: $? = 0
configure:3893: test -z
|| test ! -s conftest.err
configure:3896: $? = 0
configure:3899: test -s conftest.o
configure:3902: $? = 0
configure:3913: result: yes
configure:3867: checking for stdlib.h
configure:3883: gcc -c -g -O2 conftest.c >&5
configure:3889: $? = 0
configure:3893: test -z
|| test ! -s conftest.err
configure:3896: $? = 0
configure:3899: test -s conftest.o
configure:3902: $? = 0
configure:3913: result: yes
configure:3867: checking for string.h
configure:3883: gcc -c -g -O2 conftest.c >&5
configure:3889: $? = 0
configure:3893: test -z
|| test ! -s conftest.err
configure:3896: $? = 0
configure:3899: test -s conftest.o
configure:3902: $? = 0
configure:3913: result: yes
configure:3867: checking for memory.h
configure:3883: gcc -c -g -O2 conftest.c >&5
configure:3889: $? = 0
configure:3893: test -z
|| test ! -s conftest.err
configure:3896: $? = 0
configure:3899: test -s conftest.o
configure:3902: $? = 0
configure:3913: result: yes
configure:3867: checking for strings.h
configure:3883: gcc -c -g -O2 conftest.c >&5
configure:3889: $? = 0
configure:3893: test -z
|| test ! -s conftest.err
configure:3896: $? = 0
configure:3899: test -s conftest.o
configure:3902: $? = 0
configure:3913: result: yes
configure:3867: checking for inttypes.h
configure:3883: gcc -c -g -O2 conftest.c >&5
configure:3889: $? = 0
configure:3893: test -z
|| test ! -s conftest.err
configure:3896: $? = 0
configure:3899: test -s conftest.o
configure:3902: $? = 0
configure:3913: result: yes
configure:3867: checking for stdint.h
configure:3883: gcc -c -g -O2 conftest.c >&5
configure:3889: $? = 0
configure:3893: test -z
|| test ! -s conftest.err
configure:3896: $? = 0
configure:3899: test -s conftest.o
configure:3902: $? = 0
configure:3913: result: yes
configure:3867: checking for unistd.h
configure:3883: gcc -c -g -O2 conftest.c >&5
configure:3889: $? = 0
configure:3893: test -z
|| test ! -s conftest.err
configure:3896: $? = 0
configure:3899: test -s conftest.o
configure:3902: $? = 0
configure:3913: result: yes
configure:3929: checking for dbopen
configure:3986: gcc -o conftest -g -O2 conftest.c >&5
/tmp/ccOXHHuy.o: In function `main':
/home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/conftest.c:61: undefined reference to `dbopen'
/tmp/ccOXHHuy.o:(.data+0x0): undefined reference to `dbopen'
collect2: ld returned 1 exit status
configure:3992: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.32"
| #define PACKAGE_STRING "OpenCOBOL 0.32"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.32"
| #define COB_DEBUG 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| /* Define dbopen to an innocuous variant, in case declares dbopen.
| For example, HP-UX 11i declares gettimeofday. */
| #define dbopen innocuous_dbopen
|
| /* System header to define __stub macros and hopefully few prototypes,
| which can conflict with char dbopen (); below.
| Prefer to if __STDC__ is defined, since
| exists even on freestanding compilers. */
|
| #ifdef __STDC__
| # include
| #else
| # include
| #endif
|
| #undef dbopen
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| {
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char dbopen ();
| /* The GNU C library defines this for functions which it implements
| to always fail with ENOSYS. Some functions are actually named
| something starting with __ and the normal name is an alias. */
| #if defined (__stub_dbopen) || defined (__stub___dbopen)
| choke me
| #else
| char (*f) () = dbopen;
| #endif
| #ifdef __cplusplus
| }
| #endif
|
| int
| main ()
| {
| return f != dbopen;
| ;
| return 0;
| }
configure:4017: result: no
configure:4504: checking gmp.h usability
configure:4516: gcc -c -g -O2 conftest.c >&5
configure:4522: $? = 0
configure:4526: test -z
|| test ! -s conftest.err
configure:4529: $? = 0
configure:4532: test -s conftest.o
configure:4535: $? = 0
configure:4545: result: yes
configure:4549: checking gmp.h presence
configure:4559: gcc -E conftest.c
configure:4565: $? = 0
configure:4585: result: yes
configure:4620: checking for gmp.h
configure:4627: result: yes
configure:4645: checking for __gmp_rand in -lgmp
configure:4675: gcc -o conftest -g -O2 conftest.c -lgmp >&5
/tmp/cc9Umoej.o: In function `main':
/home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/conftest.c:34: undefined reference to `__gmp_rand'
collect2: ld returned 1 exit status
configure:4681: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "0.32"
| #define PACKAGE_STRING "OpenCOBOL 0.32"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "0.32"
| #define COB_DEBUG 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_GMP_H 1
| /* end confdefs.h. */
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char __gmp_rand ();
| int
| main ()
| {
| __gmp_rand ();
| ;
| return 0;
| }
configure:4707: result: no
configure:4717: error: GMP 3 or later is required
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_F77_set=
ac_cv_env_F77_value=
ac_cv_env_FFLAGS_set=
ac_cv_env_FFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=
ac_cv_func_dbopen=no
ac_cv_func_getopt_long_only=yes
ac_cv_header_gmp_h=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_lib_gmp___gmp_rand=no
ac_cv_lib_regex_regcomp=no
ac_cv_objext=o
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=mawk
ac_cv_prog_COB_CC=gcc
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=
ac_cv_prog_egrep='grep -E'
ac_cv_prog_make_make_set=yes
am_cv_CC_dependencies_compiler_type=gcc3
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run aclocal-1.8'
ALLOCA=''
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run tar'
AR=''
AS=''
AUTOCONF='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run autoconf'
AUTOHEADER='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run autoheader'
AUTOMAKE='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run automake-1.8'
AWK='mawk'
CC='gcc'
CCDEPMODE='depmode=gcc3'
CFLAGS='-g -O2'
COBCRUN_SHARED_FALSE=''
COBCRUN_SHARED_TRUE=''
COBC_CFLAGS=''
COBC_LIBS=''
COB_CC='gcc'
COB_CFLAGS=''
COB_CONFIG_DIR=''
COB_EXPORT_DYN=''
COB_LIBRARY_PATH=''
COB_LIBS=''
COB_MODULE_EXT=''
COB_PIC_FLAGS=''
COB_SHARED_OPT=''
COB_STRIP_CMD=''
CPP='gcc -E'
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
DLLTOOL=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='grep -E'
EXEEXT=''
F77=''
FFLAGS=''
GMSGFMT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
INTLLIBS=''
LDFLAGS=''
LIBCOB_CFLAGS=''
LIBCOB_LIBS='-lm'
LIBICONV=''
LIBINTL=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBICONV=''
LTLIBINTL=''
LTLIBOBJS=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL} /home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/missing --run makeinfo'
MKINSTALLDIRS=''
MSGFMT=''
MSGMERGE=''
OBJDUMP=''
OBJEXT='o'
PACKAGE='open-cobol'
PACKAGE_BUGREPORT='open-cobol-list@lists.sourceforge.net'
PACKAGE_NAME='OpenCOBOL'
PACKAGE_STRING='OpenCOBOL 0.32'
PACKAGE_TARNAME='open-cobol'
PACKAGE_VERSION='0.32'
PATH_SEPARATOR=':'
POSUB=''
RANLIB=''
SET_MAKE=''
SHELL='/bin/bash'
STRIP=''
USE_NLS=''
VERSION='0.32'
XGETTEXT=''
ac_ct_AR=''
ac_ct_AS=''
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_ct_DLLTOOL=''
ac_ct_F77=''
ac_ct_OBJDUMP=''
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include='include'
am__leading_dot='.'
am__quote=''
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${prefix}/share'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/home/gabry/Desktop/OpenCobolSource/open-cobol-0.32/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='mkdir -p -- .'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define COB_DEBUG 1
#define HAVE_GMP_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define PACKAGE "open-cobol"
#define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
#define PACKAGE_NAME "OpenCOBOL"
#define PACKAGE_STRING "OpenCOBOL 0.32"
#define PACKAGE_TARNAME "open-cobol"
#define PACKAGE_VERSION "0.32"
#define STDC_HEADERS 1
#define VERSION "0.32"
configure: exit 1
[/code]
or in general that gmp3 or sup. is request. But i've installed it without errors!!Where is the problem?
Thank you them
----------------------------------------------------------------
Why did you build/make the gmp, BDB, etc. packages
yourself ? (You probably did not specify installation
directories)
Every Linux comes with precompiled/installable
packages for these prerequisites.
Install the stuff from the Ubuntu repository.
(Runtime AND development where seperate)
And please use the 0.33 prerelease.
----------------------------------------------------------------
Excuse me, but i don't know you!!!
I've execute the classic commads follows for the package's installation (libraries external required: gmp, DDB, ncurses, libtool): ./configure, make, make install.
For default it has installed the packages in /usr/local/lib or /usr/lib.
I hope that openCobol founds here the libraries requires or no?
Them, i don't know when you tell me: "..Every Linux comes with precompiled/installable
packages for these prerequisites.
Install the stuff from the Ubuntu repository.
(Runtime AND development where seperate)..."
I've build, compile and install the libraries external but why i need of the precompiled/installable
packages?
Can you explained better please?
Thanks!!
----------------------------------------------------------------
> For default it has installed the packages in /usr/local/lib or /usr/lib.
Not true for BDB except if you have specified
a --prefix to the configure.
Excerpt from 0.33 README :
-----------------
OpenCOBOL requires the following external libraries to be installed:
** 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 !!
----------------------
Further excerpt from 0.33 README :
----------------------
** 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 and add /usr/local/lib to the file.
Rerun "ldconfig".
----------------------
This last also applies if you build/install other
packages.
Roger
----------------------------------------------------------------
Ok simrw!!!
All the problems have been resolved!!! :-D
Now OC works perfectly.
I've re-installed Berkley DB with --prefix=/usr/local and i've added the path /usr/local/lib in /etc/ld.so.conf and run ldconfig.
Then i've installed OC-0.33 without problems also on Ubuntu!!
Thank you very much
I ask you a last demand:
When i try to compiling hello.cob example con cobc hello.cob:
[code]---- hello.cob -------------------------
* Sample COBOL program
IDENTIFICATION DIVISION.
PROGRAM-ID. hello.
PROCEDURE DIVISION.
DISPLAY "Hello World!".
STOP RUN.
----------------------------------------[/code]
I obtain turned out following:
[code]hello.cob:1: Warning: Invalid indicator 'e' at column 7
hello.cob:1: Error: syntax error, unexpected WORD, expecting PROGRAM_ID[/code]
Where do i mistake?
Still thank you very much!!
----------------------------------------------------------------
---- hello.cob -------------------------
----------------------------------------
Take out the above 2 lines from the source code :-)
Note that the '*' on the comment line should be
at column 7 and that the following lines should
start at column 8. (That's standard fixed-format
Cobol)
Then -
cobc -x hello.cob
./hello
or -
cobc hello.cob (equivalent to cobc -m hello.cob)
cobcrun hello
Roger
----------------------------------------------------------------
I have Ubuntu also. I was on v6.10 and had installed v.32 of OC from the repositories. It worked great. Now I have done a completely fresh installed on a wiped drive to v7.04 of Ubuntu, partly to try my hand and installing v.33 of OC from source. I've never done that before with any program. It worked splendid. I had a few hitches due to not being sudo (not realizing I needed to be...) but once I got everything figured out I was able to compile programs fine.
At first I just did cobc codefile.cob and it produced .so files. (Will learn more later I gather those are library files). Then in the news I saw the -x option, so I tried and it worked fine, I got a nice executable from my code. Love it.
Also I ran the tests/cobol85 test as instructed. I did a diff as the test stated. I got no differences. I assume that is a good thing? Or is this a test we run over and over?
Also from what I read, is the screen section now implemented? Lastly I realize there is probably a way in all of these files for me to tell what is and what isnt implemented yet, but I've no idea where to start looking. Any suggestions are appreciated. (I can wait patiently, I realize yall are very busy).
Thanks kindly and best regards.
----------------------------------------------------------------
Subject: newbie looking to find out where to start-Windows needing to use COBOL
Hi
Just looking to replace a copy of MSCOBOL that has become both outdated and lost!
I am looking to edit flat files to produce rearranged flat files. I am assuming this product will do the job.
It appears I need the COBOL download and a couple of other libraries--am assuming that all the COBOL downloads and ensuing executable(s) go in the same subdirectory. If so, I would like to proceed.
I also read where this application appears to take the COBOL code and execute C instructions, is that a correct read?
Enough questions for now. I am glad to have found this site.
Thanks
Joe
----------------------------------------------------------------
OpenCobol tranlsates cobol into c, this is right. If you want to use Opencobol with a Windows environment you need extra software, I advise Cygwin. Just download the 0.33 prerelease and follow the instructions that can be found in rhe readme file.
----------------------------------------------------------------
Subject: Generating listing file.
Hello:
I've been hacking on the 0.33 version of the compiler and have added a program listing capability. The -t option does something other than reflect the source. And added a -T option for a wide format listing (instead of 80 columns).
My question is where is the symbol table documented as I'd like to add a listing of the user symbols, etc. to the listing? And can I follow the TREE structures for this data?
Thanks...
----------------------------------------------------------------
Basic starting point is cobc/tree.h which
defines all the tree structures.
Your starting point should be current_program
(defined in cobc.c) which contains pointers
to tree lists (eg. file_list, reference_list
etc.)
current_program is tree type cb_program defined
at ca. line 1063 in tree.h.
Hope that helps.
----------------------------------------------------------------
Subject: Power PC
I am thinking about moving some old IBM 370 COBOL Code onto a Power PC. I am planning on using the Open Source COBOL Compiler for doing this. Any suggestions?
Bob
----------------------------------------------------------------
Go for it !
Get the 0.33 prerelease and peruse
the README for install instructions :-)
(0.32 is broken on PPC)
As you are coming from IBM, you will want to
start out with compile option -std=mvs
Roger
----------------------------------------------------------------
Subject: Compliation Problem : lncurses
Hi everyone !
I'm working here on a Debian computer (2.6.18-3-686) and i've installed Open-Cobol via [code]apt-get install open-cobol[/code]Everythig goes righ untill I want to compilate a simple program. The Konsole returns this error :[code]# cobc hworld.cob
/usr/bin/ld: ne peut trouver -lncurses
collect2: ld returned 1 exit status[/code]
Can someone help me to solve this problem ? I think I have ton install that program from the apt, but a [code]apt-cache search lncurses[/code] returns nothing :-(
thanks to you !
----------------------------------------------------------------
I would run the command:
cobc -verbose hworld.cob
The -verbose option shows what flags are passed to the C
compiler and to the linker. Doing this will not automaticly
solve your problem but it may give you a good place to look.
Bob
----------------------------------------------------------------
I suppose you have to install ncurses, not lncurses
----------------------------------------------------------------
Indeed, but the question is who packaged
this ?
AFAIK, apt should resolve dependencies.
This would mean that the packaging is wrong.
Play safe and build from source using the
0.33 prerelease.
Do not forget to read the README :-)
Roger
----------------------------------------------------------------
Ok thanks to you ...
Sorry for the long time not respondig, I was on Holliday, far away ... :-D
I'll try to install the 0.33 prerelease with all specified packages in the Readme as soon I've a lot of time ...
----------------------------------------------------------------
Are you use Debian GNU/Linux?
apt-get install libncurses5-dev
Wait for answer... :-D :-D
----------------------------------------------------------------
Subject: pb with debugging tools
Hello,
Thanks for OC; but I got some prob when trying debugging tools. Here's the trace (OC 0.33)
$:less /proc/version
Linux version 2.6.17-2-k7 (Debian 2.6.17-9) (waldi@debian.org) (gcc version 4.1.2 20060901 (prerelease) (Debian 4.1.1-13)) #1 SMP Wed Sep 13 17:18:46 UTC 2006
$:less er.cob
identification division.
program-id. er.
data division.
working-storage section.
77 err pic 99.
procedure division.
1.
D Display "DEbug"
move "AAAA" to err.
display "err = " err
add 1 to err
display "err2 = " err.
2.
stop run.
$:cobc -x -debug er.cob
$:er
err = AA
err2 = AA
In the doc:
"The compiler option -debug can be used during the development of your programs. It enables all run-time error checking, such as subscript boundary checks and numeric data checks, and displays run-time errors with source locations."
How works -fdebugging-line (I tried D line,as above, but no output)?
Tx for help
Leo
----------------------------------------------------------------
Yes, correct on both counts.
The numeric checks for ADD/SUBTRACT with -debug
were missing.
The -fdebugging-line should activate debugging
lines (fixed-format - "D" in column 7)
Both fixed in the 0.33 prerelease tarball.
Redownload from link on home page or direct here :
http://www.sim-basis.de/open-cobol-0.33.tar.gz
Roger
----------------------------------------------------------------
Thanks Roger; both points are OK now.
Another request: which options work with DISPLAY?
I tried DISPLAY ... WITH BLINK, or WITH REVERSE-VIDEO, ...
(ala MF) and got a compile error. Positionning (AT LINE ..) works but LINE and COLUMN are both mandatory.
Leo
----------------------------------------------------------------
Re: LINE/COLUMN
Yes, if one is specified then the other need not
be specified.
Fixed in current tarball.
This gives 4 variants -
AT LINE y (COLUMN assumed 1)
AT COLUMN x (LINE assumed 1)
AT LINE y COLUMN x
AT COLUMN x LINE y
The compiler should accept the WITH attributes
although it does not do anything with them.
eg.
DISPLAY xxx AT LINE 3 WITH BLINK.
Note that there is only the most rudimentary
runtime support for screen I/O.
This is a TODO item and is targeted for 0.34
Roger
----------------------------------------------------------------
Subject: Problems with make / openCobol in Cygwin
Hi All,
today I tried to install openCobol under Cygwin. The configure-Script works fine, but my makefile is producing an error. It says:
intrinsic.c: In function `cob_intr_current_date':
intrinsic.c:753: error: storage size of 'tmb' isn't known
intrinsic.c:775: warning: implicit declaration of function `_ftime'
intrinsic.c:753: warning: unused variable `tmb'
make[2]: *** [libcob_la-intrinsic.lo] Error 1
Then the make-process ends and I am not able to install openCobol. I don't know what to do to solve this problem.
I would be very thankfull if someone can help me.
Thanks in advance
Chris
----------------------------------------------------------------
Whoa, slowly here, that code does not get compiled
unless _WIN32 is set, which it is NOT under Cygwin.
The configure/make must be done under the Cygwin
bash shell.
----------------------------------------------------------------
Actually on one Cygwin installation I have
managed to reproduce this.
Tracking it down now.
Roger
----------------------------------------------------------------
Ah, yes, I see the problem.
I will put up a new tarball later today.
(Will post when ready)
Fix is :
Edit libcob/intrinsic.c
Line 750 -
#ifdef _WIN32
Change to -
#if defined(_WIN32) && !defined(__CYGWIN__)
Line 774 -
#ifdef _WIN32
Change to -
#if defined(_WIN32) && !defined(__CYGWIN__)
Problem is weird. We normally only include the
windows.h file if _WIN32 is defined. Specifically
in intrinsic.c however we also include it for
__CYGWIN__. Problem is that the windows.h file implicitely
sets _WIN32.
Why do we need this for Cygwin? - So that we can use
the native Win functions for LOCALE support as although
Cygwin pretends to have LOCALE support, it doesn't actually. Geez.
Roger
----------------------------------------------------------------
OK. 0.33 tarball has been updated.
Roger
----------------------------------------------------------------
Thank you for your replies. I'll give it a try tomorrow!!
----------------------------------------------------------------
Subject: OpenCobol in OS X 10.4 (intel)
I'm trying to compile OpenCobol 0.33 in Tiger but get the following errors in ./configure --with-db
/usr/local/lib/libgmp.a(mp_bpl.o) definition of common ___gmp_junk (size 16)
/usr/bin/libtool: internal link edit command failed
make[2]: *** [libcob.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
I installed gmp using Fink.
Any ideas?
----------------------------------------------------------------
Sure, GMP is borked :-)
Nothing to do with OC :-)
Roger
----------------------------------------------------------------
According to the GMP home site -
http://www.swox.com/gmp
and going through the mailing lists,
Intel Mac is not currently supported.
Complain on that list or via Apple :-)
Roger
----------------------------------------------------------------
:-(
Ok then, I guess I'll have to wait for a new version.
Now, do you know any COBOL compiler for OS X?
Thanks for your answer!
----------------------------------------------------------------
You might want to try this to get GMP going -
http://gmplib.org/list-archives/gmp-discuss/2006-July/002430.html
Roger
----------------------------------------------------------------
Subject: windows and opencobol + cygwin
Hi another win compilation problem... ;o(
have installed cygwin 4.2.1 and when I want to install opencobol or gmp following error:
error during gmp compilation:
line 37: $'\r': command not found
line 45: syntax error near unexpected token 'elif'
line 45: 'elif test -n "${BASH_VERSION+set}" && (set -o posix) >/de'/null 2>&1; then
the same I'm getting when I want to install opencobol...
probably am doing something veeeery wrong
please help...
----------------------------------------------------------------
No idea what Cygwin 4.2.1 is :-)
According to Cygwin site, cuurent
release is 1.5.24-2.
Cygwin has all the necessary prerequisites
for OC.
After reading the OC README :-),
Cygwin provides ALL necessary packages.
If you are not versed with Cygwin, then
read the Cygwin introductory documentation.
Use the 0.33 prerelease, this has been
tested under cuurent/previous Cygwin.
Roger
----------------------------------------------------------------
Subject: Error compiling Towers of Hanoi
Hi,
I installed opencobol on OS X from Fink today. Version 0.32.
I tried compiling the Towers of Hanoi program from:
http://www.kernelthread.com/hanoi/html/cob.html
It fails with this:
marvin-2:~/tmp sandyd$ cobc hanoi.cbl
hanoi.cbl: In paragraph 'DO-HANOI':
hanoi.cbl:84: syntax error, unexpected WORD
hanoi.cbl:89: 'GET-DISKS' undefined
hanoi.cbl:40: 'GET-DISKS' undefined
hanoi.cbl:54: 'MOVE-DISK' undefined
hanoi.cbl:73: 'MOVE-DISK' undefined
The program appears to meet IBM's specification of the COBOL grammar.
It gets past the "syntax error, unexpected WORD" if I insert a line before the MOVE-DISK paragraph that contains only a period, and then the whole thing compiles if I insert another line like that before the GET-DISKS paragraph.
Is this expected behaviour?
----------------------------------------------------------------
Yes.
The syntax is illegal (in any Cobol).
A paragraph MUST be terminated with a period.
That applies to DO-HANOI and MOVE-DISK.
And although the author links to
OpenCOBOL, he obviously never compiled
that source :-)
Roger
----------------------------------------------------------------
Thanks for the quick reply Roger.
----------------------------------------------------------------
;-)
Roger
----------------------------------------------------------------
The original program has been changed.
I contacted the original person.
This has since been changed :-)
Reload and try :-)
Roger
----------------------------------------------------------------
Subject: Hi
Hi. I'm Jon. I like programming, and I've been interested in COBOL because my teachers talked about it a lot. I think it'll be fun learning it, but I needed a compiler.
I don't have all the money in the world, and I don't want to support companies who don't give out free stuff for educational purposes (Fujitsu's free COBOL version is not a good thing either, because it's hard to make it work on XP, and I had to dig up a copy of Windows NT 199x) because I think they're greedy. That's why I got OpenCOBOL.
I downloaded everything that is necessary, and a boat load of documentation. I'll try to follow everything given my limited intelligence and time :oops: . I hope it's okay to ask you guys for help, if I'm really stuck in a rut.
----------------------------------------------------------------
Sure.
Everybody is free to post as he/she wants :-)
Recommend you download the 0.33 prerelease and
carefully read the README.
If you get problems, do not be afraid to post.
Roger
----------------------------------------------------------------
Subject: COBOL to C question
First off just let me say that I am new to COBOL. Since nobody in the company that I am contracted to knows COBOL and I am the low guy on the Totem pole I have been tasked with converting some COBOL programs to C. I am looking into OpenCOBOL as a way to do this conversion. I was just wondering if anyone has any information as far as performance hits, conversion accuracy, helpful hints, or any pitfalls that I should be aware of before I start the conversion. I have searched the website but I didn't find anything, I may have missed it though. I am just looking for any information that may save me some headaches in the future. Thanks.
----------------------------------------------------------------
Yes, I can understand the problem.
There is nothing that I know of on the
market that will do what you want.
Yes, OC generates C code, but it is
NOT "maintainable". It is dependant
on OC release/version and is practically
non-informative.
Do NOT go with any COBOL->C way.
It will NOT work ultimately.
Instead, maybe think, I have a free Cobol
compiler :-)
THAT reduces budgets :-)
It does not make sense to try to convert
legacy Cobol progs to any other language.
Roger
----------------------------------------------------------------
Thank you for your quick response.
I agree with you as well, in all my experiences with converting one program language to another I have not seen any software that will accomplish it successfully.
In the past couple days I have been creating some test COBOL programs and have found that as I am becoming more familiar with the language the more I like it.
I am not sure if it will be an option to keep the programs in the Cobol language or not. I have a feeling that they are going to force this Cobol->C conversion. Regardless, I think I will continue to learn Cobol.
----------------------------------------------------------------
Subject: Runtime Segmentation Fault.
Hi there,
I am first time user of OpenCobol.
Problem: I have 2 COBOL programs say Cob1.cob and Cob2.cob
I am dynamically calling Cob2 from Cob1 using a call statement, both the programs are compiled individually.
cobc Cob1.cob & cobc Cob2.cob I have set the variable as COB_LIBRARY_PATH=. both the program programs are compiled in the same folder. When I execute the Cob1.cob it gives me a runtime error as Segmentation Fault.
Tried the cobc -m Cob2.cob as well. No luck.
Can you tell me If I am doing something wrong.
My Environment:
Fedora Core 5,
Kernel Version: 2.6.20-1.2316.fc5
COBOL Version:
cobc (OpenCOBOL) 0.32
Copyright (C) 2001-2004 Keisuke Nishida
GCC Version:
gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Thanks in advance,
Giri :-)
----------------------------------------------------------------
Firstly, move up to the 0.33 prerelease.
(Link from home page)
(Don't forget to read the README)
Note that in 0.33, the default option
if non specified is -m ie. Create a module.
Then -
cobc -x cob1.cob
cobc -m cob2.cob
./cob1
Alternatively -
cobc -m cob1.cob
cobc -m cob2.cob
cobcrun cob1
Roger
----------------------------------------------------------------
Subject: errors in doing make check (cygwin)
Sorry, I can't help you here.
This is not an OC problem.
This is a Cygwin/Windows problem.
(I regularly do Cygwin checks on the
0.33 prerelease)
Roger
----------------------------------------------------------------
Hi! I'm running cygwin and compiling my first cobol-programs works fine.
But there were some errors during install (only in make check) with windows-errors. I think there are some tricky issues in the make check routine, maybe you know what these are about:
Always the same Windows Error: SH caused an error by an invalid side in module CYGWIN1.DLL
105: FUNCTION ACOS 68928 [main] sh 1103967 fork
: child -1 - died waiting for longjmp before initialization, retry 0, exit code
0xFFFFFFFF, errno 11
././run: fork: Resource temporarily unavailable
128 [main] sh 68166783 fork: child -1 - died waiting for longjmp before init
ialization, retry 0, exit code 0xFFFFFFFF, errno 11
197 [main] sh 375667 fork: child -1 - died waiting for longjmp before initia
lization, retry 0, exit code 0xFFFFFFFF, errno 11
././run: fork: Resource temporarily unavailable
FAIL: ./run
## Run time tests with -O option ##
## ------------------------------------- ##
## OpenCOBOL 0.33 test suite: Run Tests. ##
## ------------------------------------- ##
461 [main] sh 375667 fork: child -1 - died waiting for longjmp before initia
lization, retry 0, exit code 0xFFFFFFFF, errno 11
/tmp/install/open-cobol-0.33/tests/run: fork: Resource temporarily unavailable
FAIL: ./run-O
....
======================================================
2 of 5 tests failed
Please report to open-cobol-list@lists.sourceforge.net
======================================================
make[4]: *** [check-TESTS] Error 1
make[4]: Leaving directory `/tmp/install/open-cobol-0.33/tests'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/tmp/install/open-cobol-0.33/tests'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/tmp/install/open-cobol-0.33/tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/install/open-cobol-0.33'
make: *** [check] Error 2
----------------------------------------------------------------
Subject: screen section bug and attributes and colors
hello i'm ANdrea
i was trying to implement some screen section
attributes and colors in the opencobol libcob
and i discovered a bug that prevent screen
section attributes to work.
i list the corrections i have made to perser.c of
cobc (that generates from parser.y) as reported
by the diff utility.
I have implemented some code to the screenio.c
module of libcob to handle some screen section
attributes and colors.
if you tell me where to send the modified version
of the file i will send it to you
sincerely
Andrea
5953c5953
< current_field->screen_flag |= COB_SCREEN_COLUMN_ABS;
---
> current_field->screen_flag |= ~COB_SCREEN_COLUMN_ABS;
5961c5961
< current_field->screen_flag |= COB_SCREEN_COLUMN_PLUS;
---
> current_field->screen_flag |= ~COB_SCREEN_COLUMN_PLUS;
5969c5969
< current_field->screen_flag |= COB_SCREEN_COLUMN_MINUS;
---
> current_field->screen_flag |= ~COB_SCREEN_COLUMN_MINUS;
----------------------------------------------------------------
The parser stuff has been fixed in the
development tarball of 0.33 to be found here:
http://www.sim-basis.de/develop/open-cobol-0.33.tar.gz
Rebase your screenio changes against above tarball.
The address to send to can be found out by going
to the OpenCOBOL project over at SourceForge,
finding a mail from me in the mailing list and
clicking on my name.
Roger
----------------------------------------------------------------
Subject: AN IDEA FOR SQL SUPPORT IN OPENCOBOL
hello everybody from Andrea
perhaps i'm crazy but i was thinking about
an idea to support SQL in opencobol and i
would like to hear your comments
the idea is to use the cobol syntax
used for accessing sequential files
to access SQL "pseudo files" which
in reality will be sql connections
to a sql database server
we could declare a sql pseudo file by
using a new pseudo file namimg syntax:
for example we could wrtite:
SELECT PSEUDO-FILE ASSIGN 'SQL://dbdriver/servername/database/username/password/options'
organization is sequential.
than we could declare some buffers to comunicate
with the sql server:
FD PSEUDO-FILE.
01 PSEUDO-FILE-SQL-COMMAND pic (100)
value "select * from tablename".
01 PSEUDO-FILE-RESULT-ROW.
02 FIELD1 ....
02 FIELD2 ...
...........
02 FIELDN ...
to open the connection to sql database:
OPEN PSEUDO-FILE I-O
to issue a query to the database:
WRITE PSEUDO-FILE FROM PSEUDO-FILE-SQL-COMMAND
to read a row from the resultset
READ PSEUDO-FILE INTO PSEUDO-FILE-RESULT-ROW
AT END .....
to close the connection to the database:
CLOSE PSEUDO-FILE
the advantages would be:
1) No new syntax to learn
2) no disruption of cobol syntax and standards
3) no sql preprocessor to use and learn
4) extensibility to more database server types
i know it's a little dirty idea , but .. ;-)
Andrea
----------------------------------------------------------------
Thanks for a very thoughtful and considered contribution!
This is not a yay or nay vote for your suggestion but a caveat based on 35+ years of programming experience most of which involved COBOL. I've used practically all of the COBOL compilers from IBM, Honeywell, and Bull, and others. A big part of the very foundation of COBOL is standardization. I've converted literally thousands of programs from one vendor's COBOL to that of another. What always made this feasible was standardization. What always caused problems was a vendor's failure to adhere to the standard. Many times this was called "extensions to the standard" by the manufacturer or vendor. Some times the "extensions" later became part of the standard. Often, however, the extensions were merely failure to follow the industry standard.
If we (OpenCOBOL developers and users) want to attract converts from other platforms (hardware and software) then we must be very careful about following the standards and about introducing "extensions" or non-standard constructs. Most mainframe programmers, and many pc programmers, that use COBOL are familar with embedded SQL in programs (for instance, the gazillion or so DB2 programmers). They may be reluctant to convert to a compiler that has implemented embedded SQL in a non-standard fashion.
Food for thought....
Regards,
Alec 8-)
----------------------------------------------------------------
Have you tried this solution ?
I get 'File doest not exist'[quote]
----------------------------------------------------------------
hi
it was only an idea for a possible future implementation
but currently it is not implemented so it does not work !
bye
----------------------------------------------------------------
I think it is not a bad idea. Embebed SQL must be kept for compatibility, but new cobol compiler need better features.
An SQL dataset may be created via a SQL cursor and asociate it with a dynamic access file.
----------------------------------------------------------------
Many years ago, I did embedded SQL against Adabas. It used a syntax of EXEC SQL kind of like the CICS syntax. You were able to create cursors, and fetch into (or select directly into) working storage variables.
----------------------------------------------------------------
That is the standard way.
Each database brings its own preprocesor which translates the EXEC SQL into propietary API call.
I used two of them: Pro*Cobol (Oracle) and gpre (Interbase).
Regards.
----------------------------------------------------------------
Embedded SQL with DB2 and the DB2 preprocessor (db2 prep)works fine with OpenCobol, too.
Cheers,
Juergen
----------------------------------------------------------------
Subject: Unsatisfied code symbol
I am new to OpenCOBOL. I thought that my installation of OpenCOBOL was successful, I didn't notice any errors and I have been able to successfully compile and execute a number of COBOL scripts. Lately I have been recieving the following error when I try and execute a script that is utilizing a MULTIPLY command.
/usr/lib/pa20_64/dld.sl: Unsatisfied code symbol "cob_decimal_set_int" in load module './cob1.sl'.
Hopefully you can shed some light on this because the only thing that I can think of doing is to install everything again to see if it fixes the issue (which i would rather not do if I can help it).
OS: HP-UX PA8700 2.3 B.11.11. U
OpenCOBOL: version .33
GMP version 4.2.1
Thanks for the help.
----------------------------------------------------------------
Sorry for wasting your time, I was able to figure it out and it works fine now.
Sorry again.
----------------------------------------------------------------
Subject: Problem with comp-types --> all comp-types seem to be the same
Let me first give the summary: I need a comp-type with big endian as byte-order.
According to simrw [quote]by simrw on 2007/1/8 14:18:07
Re: Big-endian
Generate COMP-5 items or
handle byte-swap
(Depending on compile opts .-) )
Roger[/quote]
different comp-types should have different Byte-Order. This is also part of one of my test programs for oc and it seems that it does not work. Here is my test program:
[code] IDENTIFICATION DIVISION.
PROGRAM-ID. CMPTST.
****************************************************************
* *
* PROGRAM FOR TESTING DIFFERENT COMP-TYPES IN OC *
* *
****************************************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNIX.
OBJECT-COMPUTER. UNIX.
SPECIAL-NAMES. DECIMAL-POINT IS COMMA.
*----------------------------------------------------------------
INPUT-OUTPUT SECTION.
*
FILE-CONTROL.
SELECT CMP ASSIGN TO "CMPFILE"
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS CMP-STATUS.
SELECT CMP4 ASSIGN TO "CMP4FILE"
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS CMP4-STATUS.
SELECT CMP5 ASSIGN TO "CMP5FILE"
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS CMP5-STATUS.
SELECT CMPX ASSIGN TO "CMPXFILE"
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS CMPX-STATUS.
*----------------------------------------------------------------
DATA DIVISION.
FILE SECTION.
FD CMP.
01 CMP-REC.
03 CMP-ENTRY PIC X(300).
FD CMP4.
01 CMP4-REC.
03 CMP4-ENTRY PIC X(300).
FD CMP5.
01 CMP5-REC.
03 CMP5-ENTRY PIC X(300).
FD CMPX.
01 CMPX-REC.
03 CMPX-ENTRY PIC X(300).
*----------------------------------------------------------------
WORKING-STORAGE SECTION.
*
01 CMP-STATUS PIC X(02).
01 CMP4-STATUS pic X(02).
01 CMP5-STATUS pic X(02).
01 CMPX-STATUS PIC X(02).
*
01 testvar-nc pic 99 COMP value zero.
*
01 testvar-ncx redefines testvar-nc.
02 testvar-ncx-a pic x.
02 testvar-ncx-b pic x.
*
01 testvar-n4c pic 99 COMP-4 value zero.
*
01 testvar-n4cx redefines testvar-n4c.
02 testvar-n4cx-a pic x.
02 testvar-n4cx-b pic x.
*
01 testvar-n5c pic 99 COMP-5 value zero.
*
01 testvar-n5cx redefines testvar-n5c.
02 testvar-n5cx-a pic x.
02 testvar-n5cx-b pic x.
*
01 testvar-nxc pic 99 COMP-X value zero.
*
01 testvar-nxcx redefines testvar-nxc.
02 testvar-nxcx-a pic x.
02 testvar-nxcx-b pic x.
*
*--------------------------------------------------------------
*--------------------------------------------------------------
PROCEDURE DIVISION.
MAIN SECTION.
00.
open output CMP
open output CMP4
open output CMP5
open output CMPX
*
move 4 to testvar-nc, testvar-n4c,
testvar-n5c, testvar-nxc
*
move '4' to CMP-ENTRY, CMP4-ENTRY,
CMP5-ENTRY, CMPX-ENTRY
perform rec-write
*
move testvar-nc to CMP-ENTRY
move testvar-n4c to CMP4-ENTRY
move testvar-n5c to CMP5-ENTRY
move testvar-nxc to CMPX-ENTRY
perform rec-write
*
move testvar-ncx to CMP-ENTRY
move testvar-n4cx to CMP4-ENTRY
move testvar-n5cx to CMP5-ENTRY
move testvar-nxcx to CMPX-ENTRY
perform rec-write
*
move testvar-ncx-a to CMP-ENTRY
move testvar-n4cx-a to CMP4-ENTRY
move testvar-n5cx-a to CMP5-ENTRY
move testvar-nxcx-a to CMPX-ENTRY
perform rec-write
*
move testvar-ncx-b to CMP-ENTRY
move testvar-n4cx-b to CMP4-ENTRY
move testvar-n5cx-b to CMP5-ENTRY
move testvar-nxcx-b to CMPX-ENTRY
perform rec-write
*
close CMP
close CMP4
close CMP5
close CMPX
*
stop run
*
continue.
ex. exit program.
*--------------------------------------------------------------
rec-write section.
00.
write CMP-REC
write CMP4-REC
write CMP5-REC
write CMPX-REC
*
continue.
ex. exit.
*--------------------------------------------------------------
*-- End of CMPTST -------------------------------------------[/code]
Compiling with "cobc CMPTST.CBL" and running with "cobcrun CMPTST" generates four files. Viewing all four with an hex editor shows that these are identical files:[quote]340A 3034 0A04 000A 040A 000A[/quote]: Shouldn't at least one file be [quote]340A 3034 0A00 040A 000A 040A[/quote]?
According to the [url=http://supportline.microfocus.com/documentation/books/nx50/lhclan.htm#u943]microfocus documentation[/url] the outcome should be different, too.
I've compiled this program using a Linux machine (Intel) and urgently need the file (without swapping the bytes manually) like the one I quoted (generated by ACU with pic 99 comp.). Are there some compiler options for that?
Greetings,
human.
----------------------------------------------------------------
Example is completely invalid.
(Following apllies to whatever compiler
you are using, OC, MF, ACU, etc)
You should first understand how binary
fields are allocated.
Depending on the PIC clause and compile
options, you will get a differing number
of bytes allocated for binary fields.
In OC, this is controlled by the "-std="
option (or lack of).
How this affects binary allocation is documented
in config/default.conf under parameter "binary-size".
In eg. MF, the default mode can allocate
any value from 1 to 8 bytes depending on PIC.
However, per compile option (MF - IBMCOMP,
OC - -std=ibm, mvs, bs2000), this switches
to so-called "word-stoarge mode". ie.
allocation is restricted to 2, 4 and 8 bytes.
So, per default, your PIC 99 COMP(-n) fields
are 1 byte (unless influenced by options).
Try this -
IDENTIFICATION DIVISION.
PROGRAM-ID. CMPTST.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 testvar-nc pic 9(4) COMP value 4.
01 testvar-ncx redefines testvar-nc.
02 testvar-ncx-a pic 99 comp.
02 testvar-ncx-b pic 99 comp.
*
01 testvar-n4c pic 9(4) COMP-4 value 4.
01 testvar-n4cx redefines testvar-n4c.
02 testvar-n4cx-a pic 99 comp.
02 testvar-n4cx-b pic 99 comp.
*
01 testvar-n5c pic 9(4) COMP-5 value 4.
01 testvar-n5cx redefines testvar-n5c.
02 testvar-n5cx-a pic 99 comp.
02 testvar-n5cx-b pic 99 comp.
*
01 testvar-nxc pic 9(4) COMP-X value 4.
01 testvar-nxcx redefines testvar-nxc.
02 testvar-nxcx-a pic 99 comp.
02 testvar-nxcx-b pic 99 comp.
*
PROCEDURE DIVISION.
MAIN SECTION.
00.
display "COMP".
display "Byte 1 " testvar-ncx-a
" Byte 2 " testvar-ncx-b.
display "COMP-4".
display "Byte 1 " testvar-n4cx-a
" Byte 2 " testvar-n4cx-b.
display "COMP-5".
display "Byte 1 " testvar-n5cx-a
" Byte 2 " testvar-n5cx-b.
display "COMP-X".
display "Byte 1 " testvar-nxcx-a
" Byte 2 " testvar-nxcx-b.
stop run.
*NOTE* This will only run correctly in "byte-storage mode".
ie. In OC, per default or NOT using "-std=ibm, mvs, bs2000).
In MF, with NOT specifying IBMCOMP.
Strictly speaking, the testvar-nxxx fields
should be defined as USAGE BINARY-CHAR UNSIGNED
(No PIC clause). This is the 2002 standard.
However, MF/ACU (depending on version) do not allow
a mix of 2002/non-2002 syntax.
Note that 2002 (and 85) standards do not define
any COMP-x variants.
Result of above prog with OC -
# cobc -x cmptst2.cob
# ./cmptst2
COMP
Byte 1 00 Byte 2 04
COMP-4
Byte 1 00 Byte 2 04
COMP-5
Byte 1 04 Byte 2 00
COMP-X
Byte 1 00 Byte 2 04
Result with MF -
# cob -u cmptst2.cob
# cobrun ./cmptst2
COMP
Byte 1 00 Byte 2 04
COMP-4
Byte 1 00 Byte 2 04
COMP-5
Byte 1 04 Byte 2 00
COMP-X
Byte 1 00 Byte 2 04
All perfectly OK and as expected.
In other words -
COMP (aka BINARY) is always big endian.
COMP-5 (aka BINARY-CHAR/SHORT/LONG/DOUBLE)
is machine dependent and maybe either
little or big endian.
Roger
----------------------------------------------------------------
Subject: WANT TO KNOW HOW TO INSTALL OPENCOBOL
HELLO ALL.
I studied COBOL years ago and want to get back into it. I am new to OpenCOBOL and need to understand how to install it.
I was not able to understand the user manual explaining how to extract the .tar gz file. But I used WinZIP and fortunately it was able to unzip and extract the file.
Now I have a bunch of files in a folder and still have no idea how to use it. I can not open hardly any of the files with any program that I have and nothing looks like an execute or setup file. How and I supposed to install the COBOL compiler ?
Also, once I install the compiler I need a manual on how to actually use it.
I greatly appreciate whatever help you can give I have been thoroughly confused.
Thanks,
Stormy.
----------------------------------------------------------------
OC works only with an unix environment. Use an unix Machine / Virtual Machine or, as I suppose, CygWin to compile in an unix environment. Please have a look at the other topics and read the [url=http://www.opencobol.org/modules/xoopsfaq/index.php?cat_id=1]FAQ[/url] about that.
----------------------------------------------------------------
Subject: syntax error
Hi,
I am new to COBOL and I have a little problem.This is my code
[code] IDENTIFICATION DIVISION.
PROGRAM-ID. ex1a.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT inputfile ASSIGN TO "input.dat"
organization is line sequential.
SELECT outputfile ASSIGN TO "output.dat"
organization is line sequential.
SELECT sortfile ASSIGN TO disk.
DATA DIVISION.
FILE SECTION.
FD inputfile block contains 100 records.
01 inputrec pic x(24).
FD outputfile block contains 100 records.
01 outputrec pic x(24).
SD sortfile.
01 sortrec.
03 city pix x(20).
03 postalcode pic 9(4).
PROCEDURE DIVISION.
MAIN.
SORT sortfile ON DESCENDING KEY postalcode
USING inputfile
GIVING outputfile
STOP RUN.[/code]
As you can see it is not a very difficult program (just an exercise for school). But when I try to compile it with openCOBOL (cobc ex1a.cob) it gives a syntax error:
[code]syntax error, unexpected WORD, expecting EXTERNAL or GLOBAL[/code]
But I can't see what I'm doing wrong... Could somebody help me?
Thank you very much!
----------------------------------------------------------------
I just spotted my error, I wrote 'pix' instead of 'pic'. So never mind this topic.
----------------------------------------------------------------
Subject: program execution hangs when executed via ssh
Whenever I try to execute a compiled program via ssh the program hangs. Even the simple hello.cbl hangs when I execute via ssh.
example:
ssh user@server1 /home/user/hello
The process will hang, yet if I execute the same program on the server directly, it runs without a problem.
Any thoughts or solutions?
Thanks
Michael
----------------------------------------------------------------
I found the problem. When ssh'ing into the server, the path /usr/local/bin was not included, and thus cygcob-1.dll could not be found. By creating a simple wrapper script to set the path prior to program execution solved the problem.
----------------------------------------------------------------
Subject: Compile warning; c warning?
Hi, when I compile the following code, I get the compiler output:
[code]
/tmp/cobpyX3Ix.c: In function ‘Course$2DRecords_’:
/tmp/cobpyX3Ix.c:37: warning: initialization from incompatible pointer type
[/code]
If anyone could tell me how to fix this, it would great.
Since this is a warning, I have the impression that it might not be influencing the functionality of my COBOL program. Could anyone confirm this?
test.cbl
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. Course-Records.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT course-file
ASSIGN TO "COURSE.DAT"
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD course-file.
01 course-record.
10 cr-course-number PIC X(8).
PROCEDURE DIVISION.
000-main.
DISPLAY "This program generates a data file."
OPEN OUTPUT course-file
CLOSE course-file.
STOP RUN.
[/code]
----------------------------------------------------------------
Please use the 0.33 prerelease.
Roger
----------------------------------------------------------------
I updated to 0.33 prerelease and no longer get those messages on compile.
However, now with 0.33 I get the following message when I run the binary:
[code]
Segmentation fault (core dumped)
[/code]
FYI: I am on Ubuntu 7.04.
What would be causing this problem? I imagine you would like the core dump, where do I get this?
Thanks,
Jeffrey
----------------------------------------------------------------
To follow up on my previous post, I tried to compile and run the following 'simple' Hello World program. The pogram compiles without any errors, but I get another segmentation fault error on run-time.
Here is the code for the program:
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. Hello-World.
PROCEDURE DIVISION.
000-main.
DISPLAY "Hello World."
STOP RUN.
[/code]
Any help in solving this problem is appreciated.
Thanks,
Jeffrey
----------------------------------------------------------------
And HOW did you compile it?
Note that default options have changed
between 0.32 and 0.33.
cobc --help will show you options
and defaults.
Under 0.33, to compile an executable -
cobc -x hello.cob
./hello
Or you can do -
cobc -m hello.cob
cobcrun hello
Note the "-m" is optional as creating
a loadable module is default.
Roger
----------------------------------------------------------------
Okay, I was using default options and now that I specify
[code]
cobc -x hello_world.cbl -o hello_world.bin
./hello_world.bin
[/code]
I get different results; I now get
[code]
./hello_world.bin: error while loading shared libraries: libcob.so.1: cannot open shared object file: No such file or directory
[/code]
What does this mean?
Thanks,
Jeffrey
----------------------------------------------------------------
What it means is read the README :-)
Roger
----------------------------------------------------------------
I imagine you are talking about ld.so.conf? I thought I completed that step; maybe I misunderstood? The contents of my /etc/ld.so.conf file is:
[code]
include /etc/ld.so.conf.d/*.conf
include /usr/local/lib
[/code]
After adding the last line, I ran sudo ldconfig, but it doesn't seem to help.
Is it in fact ld.so.conf you are talking about? Did I make the changes to the ld.so.conf file properly?
Thanks,
Jeffrey
----------------------------------------------------------------
I have no idea :-)
Consult your Ubuntu doc :-)
(Why any distro allows execution from
/usr/loc/bin but does not inspect
/usr/local/lib is beyond me)
Actually, looking at it logically
(and not knowing Ubuntu) your change
does not seem correct :-)
How can you include a file that does not exist :-)
Hint :-)
Roger
----------------------------------------------------------------
Eureka!! I got it working! Thanks for your help Roger.
Turns out the second line of /etc/ld.so.conf needs to be as follows:
[code]
include /etc/ld.so.conf.d/*.conf
/usr/local/lib/
[/code]
As you said, it doesn't make much sense that this is not set by default considering how /usr/local/bin/ is. Go figure.
Thanks again for the help!
P.S. I now have WRITE access to files (when I started this topic, my program created a file but could not write to it). I guess that warning did influence my programs after all!
----------------------------------------------------------------
:-)
That's what I like.
Somebody that can react to
the basics.
I must tell you about something that
happened to me recently.
Somebody came to me and said -
My monitor has some peculiar shadows.
Hmm. What do you mean.
Well, the monitor has funny logos
on the display.
Oh. OK. What is your monitor?
- Blah
And did you read the documention?
Erm - No.
What do you see exactly?
Hmm, A thing that says 1280 x 1024
Enough said?
If you haven't got it by now, the
person had not removed the protective
layer on the display!
So much for reading the doc.
Roger
----------------------------------------------------------------
Yes, it is easy to get to excited and skip docs. In this case, I did read the README but the note was talking about Red Hat and Fedora (and possibly other ditros)... I thought Ubuntu would have avoided that.... Maybe if the note would include a typical error, such as the one I had, I would have been able to figure this out for myself.
Either way, thanks for the help.
Jeffrey :-P
----------------------------------------------------------------
Actually, this is very valid.
OK. Will review the README.
However, what various distros do
is of course something of guesswork.
It also depends on security aspects.
The default as done should
(with respect to the README) satisfy
most people.
Roger
----------------------------------------------------------------
I think that one of the great things in
life is to say "I was wrong".
I have done it many times with respect to
Cobol standards on other forums.
Many times I have contibuted to the cobol
forum and the last post on the forum
for cobol has resulted in a
revision of the 2002 standard.
People respect that and I am sure you
will be a respected forum contributor.
Thanks
Roger
----------------------------------------------------------------
Subject: Not Issue
Please consider the following COBOL Program:
IDENTIFICATION DIVISION.
PROGRAM-ID. Not1.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 QVAR PIC X VALUE SPACES.
88 Q232-PAPER VALUE 'P'.
88 Q232-ALT-MEDIA VALUE 'A'.
88 Q232-PAPER-ALT-MEDIA VALUE 'Z'.
PROCEDURE DIVISION.
DISPLAY 'FII2AI20: before EVALUATE TRUE'
MOVE 'A' TO QVAR.
EVALUATE TRUE
WHEN NOT Q232-PAPER AND NOT Q232-ALT-MEDIA
DISPLAY 'CASE 1'
WHEN OTHER
DISPLAY 'OTHER'
END-EVALUATE
GOBACK.
When run on the IBM mainframe, it displays: OTHER. When I compile this with the Open Source COBOL Compiler (with -std=mvs) and run this under Unix/Linux I get ‘CASE 1’. I believe that the issue is with the precedence of the NOT operator. Please consider the first WHEN clause in the above program. The IBM mainframe COBOL Compiler assumes that the user (programmer) meant:
WHEN (NOT Q232-PAPER) AND (NOT Q232-ALT-MEDIA)
But the Open Source COBOL Compiler assumes that the programmer meant:
WHEN NOT (Q232-PAPER AND (NOT Q232-ALT-MEDIA))
I am attempting to modify the Open Source COBOL so that it has the same behavior as the IBM COBOL Compiler. To accomplish this task, I wrote the following two functions:
int
cb_inc_pri()
{
expr_prio['!'] -= 1;
}
int
cb_dec_pri()
{
expr_prio['!'] += 1;
}
When the parser (parser.y) sees the token WHEN, of a when clause of an evaluate statement in calls the routine cb_inc_pri. When it is done parsing the clause, it calls cb_dec_pri. However, this change failed to solve my problem.
I am also thinking that in the statement:
IF X NOT = Y
That is, “NOT =†should be treated as one token not two tokens. Not sure if this is relevant to my issue or not.
I am hoping that somebody who has a strong understanding of the source code can tell me what I am missing and how I can modify the compiler to get the behavior I desire.
Bob Sherry
----------------------------------------------------------------
And the winner is .. OC ! :-)
The WHEN clause of the EVALUATE statement
has a very specific syntax.
This is true in the 85 standard as well
as the 2002 standard.
Part of the rules for evaluation (sic) -
6. If the selection object is identifier-2, literal-2, arithmetic-expression-2, or boolean-expression-2, the
pair is considered to be a conditional expression of the following form:
selection-subject [NOT] = selection-object
where 'NOT' is present if it is present in the selection object. The result of the analysis is the truth
value of the resulting conditional expression.
Summary -
WHEN NOT expr1 AND NOT expr2
is bracketed thus
WHEN NOT (expr1 AND NOT expr2)
and then (as it should be) interpreted as
if subj NOT = (expr1 AND NOT expr2)
As per the rules above.
After all, MF, ACU and OC can't all be wrong :-)
You can, of course, bracket the condition -
WHEN (NOT expr1 AND NOT expr2)
Roger
----------------------------------------------------------------
Roger,
I compiled and ran the above exampe with the Micro Focus COBOL Compiler and I found that it matched the results of the main frame. The version of Micro Focus I am using is: 1.313. I also have Service Pack 2 of the compiler installed. I did this on a machine running Linux.
Bob Sherry
----------------------------------------------------------------
Please carefully ready my reply.
OC is doing the correct thing.
(According to 85 /2002 rules)
(Check your results using MF 2.2 or 4)
Roger
----------------------------------------------------------------
Roger,
The version of Micro Focus that I am using is current. I am guessing that you are using a Windows version of the Micro Focus Compiler. Is this true? Also, when you compile your program, what compiler options are you using? The only option I am using is -x.
I now have modified my version of the Open Source COBOL Compiler to bind the NOT operator the same way the IBM Mainframe Compiler treats it. You are correct when you say that this is consistent with the 85/2002 rules. However, I think it would be nice if OC worked like the IBM Mainframe Compiler when -std=mvs was specified. I would be happy to send you these changes and/or include them in the official version of the Compiler if you wanted me to.
Thanks
Bob Sherry
----------------------------------------------------------------
Actually, this gets more and more interesting :-)
It's more complicated than it seems.
I was NOT actually 100% correct with the
rules interpretation. The binding of the NOT
to the WHEN is dependent on the evaluate subject
type. Eeeek. TRUE does NOT fall into this category.
Therefore OC is doing the wrong thing :-(
Has been fixed in 0.33.
Download from link here on the home
page.
Roger
----------------------------------------------------------------
Subject: error (STATUS=30)
hi,
when I open I-O a file I have this error
libcob: Permanent file error (STATUS=30) File : ......
the file was created in another system
what means ?
there is a list of errors ?
thank you
----------------------------------------------------------------
The first thing that came to mind was a permissions issue. That is, do you have permission to write the file. My second thought is that this is an index file. The format used by the Open Source COBOL Compiler for indexed files is different than that used by other COBOL compilers. If this is the case, you may want to recreate the file using the Open Source COBOL Compiler. I hope this helps.
Bob Sherry
----------------------------------------------------------------
the file is:
SELECT OPTIONAL PODISTI-FILE
ASSIGN TO "PODISTI.DAT"
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS PODISTI-KEY.
can you suggest me how migrate the file using the Open Source COBOL Compiler ?
----------------------------------------------------------------
Unload to a sequential file
and reload into the new environment.
This is normal as there is
ZERO compatibility between IS files.
(And not even normal files)
(Quite easy, prog reads sequentially
on subject system and writes (fixed)
records. Object system reads sequential
records and writes to object system)
Perfectly normal data migration.
Roger
----------------------------------------------------------------
If I understand....
I can read that file using:
...
ACCESS SEQUENTIAL
...
??
----------------------------------------------------------------
Please, need more help.
Here, the same problem. FARTIC.DAT is an indexed file that comes from DOS / RM-Cobol.
This would be the code in Open Cobol:
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FARTIC
ASSIGN TO 'FARTIC.DAT'
* ASSIGN TO RANDOM 'FARTIC.DAT' (on RM-Cobol)
ORGANIZATION INDEXED
ACCESS SEQUENTIAL
RECORD KEYART.
Is there any other solution beside 'converting' the file ?
----------------------------------------------------------------
Indexed Sequential files are NOT,
repeat NOT, compatible between Cobol
systems.
(And, depending on system, maybe not even
variable length record files)
You MUST unload the I/S data to a record
sequential file on the source system
and load this sequential file back
on the object system.
Schematically -
Source system -
READ NEXT MYISAM
WRITE MYFIXEDRECORD
Object System -
READ MYFIXEDRECORD
WRITE MYNEWISAM
Roger
----------------------------------------------------------------
All clear !! :-D
thanks
----------------------------------------------------------------
Subject: cobcurses-0.92.tar.gz Now Available
Hi Everyone:
This release has been long in coming, but some major
changes took place over the last 6 months for this
project. Many thanks to Roger While in working through
a number of issues, especially HPUX OC issues connected
with CobCurses.
The largest aspect of this release was the incorporation
of the GNU autoconf/automake system. So now you should
be able to do:
$ ./configure
$ make
$ make install
ignoring some special configuration options.
This particular release should compile and install out
of the box for Cygwin and all Intel Linux distributions.
You may have varying success on other UNIX systems.
You must however, have a very recent Open-Cobol 0.33
installed, that supports the new -b compiler option.
The good news for HPUX-11 users is that CobCurses should
compile and install successfully (please follow the
special documentation for installing on HPUX). It might
also install on HPUX-10.x, but I have not tested this,
and would be interested in hearing of experiences.
The documentation is now ALL online. This was another
major effort, but I think it will serve everyone best in
the long run. The sourceforge.net people now support
a project wiki. So you will find all CobCurses documentation
now at:
http://cobcurses.wiki.sourceforge.net
Look for file downloads at:
http://sourceforge.net/project/showfiles.php?group_id=186285
for the source distribution file:
cobcurses-0.92.tar.gz
=====================================
What is CobCurses?
CobCurses is a package for use with the Open-Cobol
compiler. It provides the COBOL programmer the ability
to program screens in Open-Cobol, without SCREENS SECTION
support in the compiler. The project includes a Screen
Designer and code generator to make development of
screens easier for COBOL programmers.
----------------------------------------------------------------
Thanks, thanks, thanks !!
I've run the 3270test sample telnet-ing from a PuTTY terminal on XP and works perfectly. On the other side there was a Debian Linux.
----------------------------------------------------------------
Hey, I am glad people are using it. A lot of effort has gone
into it, since the skunk-works start it had in January!
Check the wiki site for updates since the current
release (0.92). It will show the work in progress
and what has been fixed (yes, there are bugs ;-)
Information about the upcoming release can be found
directly here (Release 0.93):
http://cobcurses.wiki.sourceforge.net/ChangeLog+Release+0.93
Overall documentation can be found here:
http://cobcurses.wiki.sourceforge.net
or just:
http://cobcurses.sourceforge.net (this redirects to the
wiki URL above)
I have a number of things on the wish list for the future
of this package. For example, I want to build a menu
process so that application "suites" can be built.
But this is complicated by the need for a security
mechanism on a menu item by menu item basis. This
requires some careful planning on my part. A date
field type is also needed, perhaps with a pop-up
calendar picker.
Stay tuned! Also please report any bugs that you find.
I am happy to eliminate them.
Release 0.93 may be out this weekend, if I get time for it.
Thanks, Warren.
----------------------------------------------------------------
Subject: GOBACK and STOP RUN ?
As per COBOL standards,
GOBACK is used in a program to exit back to the last environment. If the last environment is shell it should exit to shell providing the return status, closing the code/thread / runtime.
STOP RUN is used to exit the COBOL code, here also you can set the return-code to provide it to the last environment closing the runtime.
Both the cases run time environment should behave similarly or same.
But it is not happening, I think it is reloading the program again and then exiting to the environment.
When I run it with GOBACK I get an extra line, where as STOP RUN output comes out correct.
I am pasting the program below:
---------------------------------------------------------
IDENTIFICATION DIVISION.
PROGRAM-ID. filehndl.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT xfile ASSIGN TO ws-xfile
ORGANIZATION IS LINE SEQUENTIAL
file status is fs-xfile.
DATA DIVISION.
FILE SECTION.
FD xfile.
01 xrecord pic x(80).
WORKING-STORAGE SECTION.
01 WS-XFILE PIC X(100) VALUE
'./src/filehndl.cob'.
01 FS-XFILE PIC XX.
*********************************************************
PROCEDURE DIVISION.
000-main.
perform 1000-init-proc.
perform 2000-proc until fs-xfile not = '00'.
perform 9000-term-para.
GOBACK.
*********************************************************
1000-init-proc.
open input xfile.
IF FS-XFILE = '00'
READ XFILE
END-IF
CONTINUE.
*********************************************************
2000-PROC.
DISPLAY XRECORD.
READ XFILE.
CONTINUE.
*********************************************************
9000-TERM-PARA.
CLOSE XFILE.
*********************************************************
Compilation:
cobc -x src/filehndl.cob
Execution:
./filehndl
Environment.
FC5
Cobol Version 0.33
Any suggestions?
----------------------------------------------------------------
This was fixed on June 16.
Redownload and install 0.33.
Roger
----------------------------------------------------------------
Subject: Duplicate Data Names
While I admit, the following program fragment is not an ideal piece of COBOL code, it does go through the IBM Mainframe Compiler. However, it does not go though the Open Source COBOL Compiler. That is, cobc, generates an error message because the variable name: VARIABLE1 is defined in two places. Here is the code:
IDENTIFICATION DIVISION.
PROGRAM-ID. t11.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 K525-AII-DRVR-RSTRT-DATA.
03 VARIABLE1 PIC X(8) VALUE SPACES.
03 K525-FRMT-FILE-ARRAY.
06 K525-FRMT-FILE-ARRAY-ROW
OCCURS 6 TIMES
ASCENDING KEY IS VARIABLE1.
09 VARIABLE1 PIC X(8) VALUE SPACES.
09 OTHER-DATA-ITEM PIC S9(5).
PROCEDURE DIVISION.
GOBACK.
I would like to modify the COBOL Compiler so that it does accept the above code. I am hoping that somebody on this forum can give me some guidance on the best way to do this.
Bob Sherry
----------------------------------------------------------------
If I am interpreting the (2002 and I believe the 85) standard correctly, this should not compile.
(See 8.4.1.1, 2002)
The KEY clause creates an implicit reference
to VARIABLE1.
However, if you change the ASCENDING statement to -
ASCENDING KEY IS VARIABLE1 OF K525-FRMT-FILE-ARRAY-ROW.
then OC will compile it.
Roger
----------------------------------------------------------------
Roger,
I am not saying that my example was "standard" COBOL. I am saying that my example represents COBOL code that will compile on an IBM mainframe and it will compile when using the Micro Focus compiler. As such that it would be nice if OC could compile it as written. Do you have any guidance I how I can modify OC so that it will compile the above code when -std=mvs? Also, I would be happy to send to my changes to fix the above issue.
Bob Sherry
----------------------------------------------------------------
OC is correct.The implicit reference
is there.
Whether (x compiler) checks is not
relevant.
In fact your hypothetical construct
is not usable in code in the
PROCEDURE DIV.
Try DISPLAY'ing your first
VARIABLE1 :-) (The one at level 03)
No matter how qualified :-)
How about you putting your thoughts
towards missing 2002 features in OC? :-)
Roger
----------------------------------------------------------------
Roger,
I realize that you do a lot of free work to support OC and I thank you. Our interest in OC is for moving old COBOL code off the IBM mainframe. Therefore, I do not have time adding the latest features of COBOL to OC.
However, we have added some optimizations to OC and I would be happy to make them available. Would you like me to do this?
Bob Sherry
----------------------------------------------------------------
And what has your reply to do with the
original question ?
The prog is an artificial construct that
has nothing to do with real life.
If you have a problem , post the
the source code.
Re. Optmizations -
Resync against current 0.33 and post
with an explanation.
Roger
----------------------------------------------------------------
Subject: Getting Started
I've downloaded everything I need to get started but I can't install anything. Even the install icon is unassigned. What am I missing?
----------------------------------------------------------------
Please have a look at the other topics and read the FAQ about that. Read also Install Guide and User Manual on the left menu in the documentation item.
----------------------------------------------------------------
Hi,
Without more information nobody will be able to help you.
----------------------------------------------------------------
Good question. I am just looking to get started amd I am not sure what to download and in what order to download it.
What have you done, so far?
----------------------------------------------------------------
A good place to start is with the README
with any software.
Roger
----------------------------------------------------------------
Subject: ¿Bug? PIC 9(08) HIGH-VALUES
The testing program:
WORKING-STORAGE SECTION.
01 KEY1-06 PIC 9(06).
01 KEY2-06 PIC 9(06).
01 KEY1-08 PIC 9(08).
01 KEY2-08 PIC 9(08).
PROCEDURE DIVISION.
MOVE 1 TO KEY1-06 KEY1-08
MOVE HIGH-VALUES TO KEY2-06 KEY2-08
DISPLAY 'KEY1-06 ' KEY1-06 ' KEY2-06 ' KEY2-06
IF ( KEY1-06 > KEY2-06 )
DISPLAY 'PROBLEM WITH PIC 9(06)'
DISPLAY '1 GREATHER THAN HIGH-VALUES'
ELSE
DISPLAY 'ALL OK'
END-IF.
DISPLAY 'KEY1-08 ' KEY1-08 ' KEY2-08 ' KEY2-08
IF ( KEY1-08 > KEY2-08 )
DISPLAY 'PROBLEM WITH PIC 9(08)'
DISPLAY '1 GREATHER THAN HIGH-VALUES'
ELSE
DISPLAY 'ALL OK'
END-IF.
*********************
The OUTPUT:
KEY1-06 000001 KEY2-06 ������
ALL OK
KEY1-08 00000001 KEY2-08 ��������
PROBLEM WITH PIC 9(08)
1 GREATHER THAN HIGH-VALUES
*********************
The execution was on:
uname -a
Linux chulo-desktop 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686 GNU/Linux
cobc -version
cobc (OpenCOBOL) 0.33.0
Copyright (C) 2001-2007 Keisuke Nishida
Copyright (C) 2007 Roger While
Thanks for any help with this problem.
Excuse my bad english, sorry.
Bye.
----------------------------------------------------------------
Hmmm.
Here is what Microfocus makes of this -
roglinux:~ # cob -u high.cob
12 MOVE HIGH-VALUES TO KEY2-06 KEY2-08
*1026-E*************************** **
** Source literal is non-numeric - substituting zero
** Source literal is non-numeric - substituting zero
*1026-E*********************************** **
** Source literal is non-numeric - substituting zero
roglinux:~ # cobrun high
KEY1-06 000001 KEY2-06 000000
PROBLEM WITH PIC 9(06)
1 GREATHER THAN HIGH-VALUES
KEY1-08 00000001 KEY2-08 00000000
PROBLEM WITH PIC 9(08)
1 GREATHER THAN HIGH-VALUES
I know what the problem is, I do not know
if we should follow MF here.
Let me think about it.
More later on this.
---
Nobody, I repeat NOBODY, has to excuse bad
english here. Write it as you can.
(If only something like -
"Not work", followed by example code)
Just post as you can.
(But please with a reasonable subject)
Roger
----------------------------------------------------------------
If on MVS I move the figurative constant HIGH-VALUES (or HIGH-VALUE) to a numeric field, and then I compare it with any other numeric field different of HIGH-VALUES, I get that the first field its greater.
I haven't a copy of MF compiler, why the compiler moves ZEROS to the field? HIGH-VALUES is not a valid value for a numeric field?
I use very often, that MOVE to stop the process of the program.
Something like:
READ FILE1
AT END
MOVE HIGH-VALUES TO KEY1.
.... then I compare:
IF KEY2 > KEY1
PERFORM READ-FILE1
...
So when i get AT END on a file, the program skip the read of that file.
Thanks for your reply.
----------------------------------------------------------------
Per standard, the only figurative constant that you
can move to a numeric data item is
ZERO (ZEROS, ZEROES).
Anything else is implementor defined with
possibly undefined behaviour.
In the case of HIGH-VALUES, the implementor may
choose to move the maximum valid value into the
numeric data item. ie. In your case all '9'. You then
have a problem if your file contains a key with
all '9'.
The same applies to LOW-VALUES. The implementor
may choose to move the minimum valid value into
the data item. ie. All '0'.
The safest way is to use an end-of-file indicator
in working-storage.
Roger
----------------------------------------------------------------
For the original problem, a fix
has been applied. Please redownload.
However, there is still a possible
problem with illegal values in display fields
which I am investigating.
This, in no way, changes what I said in
my previous post.
If a program manages to get invalid
contents into a field, then the results
are undefined.
Roger
----------------------------------------------------------------
Subject: Lines limited to 72 characters?
I'm trying to write some simple programs in Ubuntu Linux using just a text editor, Joe, but I am unable to compile anything with lines longer than 72 characters. Programs with lines less than or equal to 72 characters work fine. Any ideas as to why?
----------------------------------------------------------------
Well, I've found my own answer. For any other extreme COBOL newbies out there, here's the answer I found in the wiki:
[quote]
Source Format
OpenCOBOL supports both fixed and free source format.
The default format is the fixed format. This can be explicitly overwritten by one of the following options:
-free
Free format.
-fixed
Fixed format.
[/quote]
So, COBOL can either compile in FIXED or FREE mode. FIXED means the code must be a fixed width, with each line starting at column 7 and ending at column 72. Since the default is FIXED, one must explicitly specify if their code is in the FREE format, e.g.:
cobc -x -free MyCode.cob
Also, any comments (lines beginning with *) must have the * at column 1 in FREE mode.
It's great when I answer my own question! :-D
----------------------------------------------------------------
Not quite true :-)
Fixed format allows longer lines,
however, the syntax must then conform.
If you want comment lines to be accepted
regardless of fixed/free then you must code
exactly as follows -
columns 1-6 spaces,
column 7 a '*' and column 8 a '>'.
Such comments will compile regardless of fixed/free.
Roger
----------------------------------------------------------------
Subject: July 27, 2007: cobcurses-0.93.tar.gz Available
Major features of this release are:
- New sdbackup/sdload backup and recovery commands
- Enhanced sdgenerate command
- A Generate screen from within the Screen Designer
- Additional support API for loading spreadsheet *.CSV files
- Additional support API for COBOL associative arrays
- Enhanced COBCURSES-INIT-PATHNAME CALLable routine
- NC-DRAW-SCREEN now checks minimum column/line/colour-pair
requirements for your screen.
- Various bug fixes
The full details are found here:
http://cobcurses.wiki.sourceforge.net/
This is the best release yet! If you are experiencing
any build problems or bugs, don't be shy -- report them
in the forum for it:
http://sourceforge.net/forum/forum.php?forum_id=651454
----
CobCurses is a package to make it possible to create screen
based programs on open platforms that support a curses(3X)
or ncurses(3X) library. CobCurses not only provides a
binding to curses, but provides a Screen Designer
to make it easier to build interactive COBOL screens.
Enjoy, Warren.
----------------------------------------------------------------
Nuts! I knew I'd forget something.. Here's a direct
link to the downloads page:
http://sourceforge.net/project/showfiles.php?group_id=186285
Warren.
----------------------------------------------------------------
I had originally intended to include this fix in the
0.93 release, but it got forgotten. It is not a critical
patch unless you are deleting many records within the
sdesign screen.
This patch corrects the deficiency where sdesign was
failing to clean up records associated with the main
screen record that was deleted. Previously, if you
deleted a screen, the field definitions, the screen
background and all field state records would remain
in the database.
To apply the patch, simply:
1. Download it
2. gunzip it
3. cd cobcurses-0.93/src
4. patch -p0 "configure: error: GMP 3 or later is required"
What's happening? ;(
cat config.log
...
It was created by OpenCOBOL configure 0.32, which was
generated by GNU Autoconf 2.59. Invocation command line was ...
O/S:
SuSE Linux 9.3
i686
i386
GNU/Linux
:-o
Then I installed 0.33 version and configure responded ok but make stopped with errors as noted below.
I replaced configure in 0.32 with that of 0.33 but the same, so I commented the lines that check GMP in 0.32 configure and it ended ok, so make, but make check returned error on file operations :
59: First READ on empty SEQUENTIAL INDEXED file FAILED (misc.at:796)
60: REWRITE a RELATIVE file with RANDAM access ok
61: SORT: table sort ok
62: SORT nonexistent file FAILED (misc.at:907)
make errors 0.33 or 0.32:
gcc -DHAVE_CONFIG_H -I. -I. -I.. -DSUPER_OPTIMIZE -I.. -O2 -march=i686 -mcpu=pentium4 -finline-functions -fomit-frame-pointer -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -MT libcob_la-fileio.lo -MD -MP -MF .deps/libcob_la-fileio.Tpo -c fileio.c -fPIC -DPIC -o .libs/libcob_la-fileio.o
fileio.c:300: error: syntax error before "DB"
fileio.c:300: warning: no semicolon at end of struct or union
fileio.c:301: warning: type defaults to `int' in declaration of `key'
fileio.c:301: warning: data definition has no type or storage class
fileio.c:302: error: syntax error before "data"
fileio.c:302: warning: type defaults to `int' in declaration of `data'
fileio.c:302: warning: data definition has no type or storage class
fileio.c:316: error: syntax error before '}' token
fileio.c: In function `cob_sync':
fileio.c:481: error: dereferencing pointer to incomplete type
fileio.c:488: error: dereferencing pointer to incomplete type
fileio.c: In function `indexed_open':
fileio.c:1456: error: invalid application of `sizeof' to an incomplete type
fileio.c:1505: error: dereferencing pointer to incomplete type
fileio.c:1505: error: `DB' undeclared (first use in this function)
fileio.c:1505: error: (Each undeclared identifier is reported only once
fileio.c:1505: error: for each function it appears in.)
fileio.c:1505: error: syntax error before ')' token
fileio.c:1510: error: dereferencing pointer to incomplete type
fileio.c:1511: error: dereferencing pointer to incomplete type
fileio.c:1512: error: dereferencing pointer to incomplete type
fileio.c:1521: error: `BTREEINFO' undeclared (first use in this function)
fileio.c:1521: error: syntax error before "info"
fileio.c:1554: error: `info' undeclared (first use in this function)
fileio.c:1556: error: `R_DUP' undeclared (first use in this function)
fileio.c:1567: error: dereferencing pointer to incomplete type
fileio.c:1567: warning: implicit declaration of function `dbopen'
fileio.c:1567: error: `DB_BTREE' undeclared (first use in this function)
fileio.c:1568: error: dereferencing pointer to incomplete type
fileio.c:1574: error: dereferencing pointer to incomplete type
fileio.c:1574: error: dereferencing pointer to incomplete type
fileio.c:1581: error: dereferencing pointer to incomplete type
fileio.c:1582: error: dereferencing pointer to incomplete type
fileio.c:1583: error: dereferencing pointer to incomplete type
fileio.c:1595: error: dereferencing pointer to incomplete type
fileio.c:1596: error: dereferencing pointer to incomplete type
fileio.c:1599: error: dereferencing pointer to incomplete type
fileio.c:1601: error: dereferencing pointer to incomplete type
fileio.c:1602: error: dereferencing pointer to incomplete type
fileio.c:1604: error: `DBT' undeclared (first use in this function)
fileio.c:1604: error: dereferencing pointer to incomplete type
fileio.c:1604: error: dereferencing pointer to incomplete type
fileio.c:1604: error: dereferencing pointer to incomplete type
fileio.c:1605: error: dereferencing pointer to incomplete type
fileio.c:1605: error: dereferencing pointer to incomplete type
fileio.c:1605: error: dereferencing pointer to incomplete type
fileio.c:1621: error: dereferencing pointer to incomplete type
fileio.c:1621: error: dereferencing pointer to incomplete type
fileio.c:1621: error: dereferencing pointer to incomplete type
fileio.c:1621: error: dereferencing pointer to incomplete type
fileio.c:1621: error: dereferencing pointer to incomplete type
fileio.c:1621: error: dereferencing pointer to incomplete type
fileio.c:1621: error: `R_FIRST' undeclared (first use in this function)
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1624: error: dereferencing pointer to incomplete type
fileio.c:1626: error: dereferencing pointer to incomplete type
fileio.c: In function `indexed_close':
fileio.c:1651: error: dereferencing pointer to incomplete type
fileio.c:1652: error: dereferencing pointer to incomplete type
fileio.c:1652: error: dereferencing pointer to incomplete type
fileio.c:1654: error: dereferencing pointer to incomplete type
fileio.c:1655: error: dereferencing pointer to incomplete type
fileio.c:1658: error: dereferencing pointer to incomplete type
fileio.c:1659: error: dereferencing pointer to incomplete type
fileio.c:1661: error: dereferencing pointer to incomplete type
fileio.c:1662: error: dereferencing pointer to incomplete type
fileio.c:1663: error: dereferencing pointer to incomplete type
fileio.c:1664: error: dereferencing pointer to incomplete type
fileio.c:1665: error: dereferencing pointer to incomplete type
fileio.c: In function `indexed_start_internal':
fileio.c:1690: error: dereferencing pointer to incomplete type
fileio.c:1690: error: dereferencing pointer to incomplete type
fileio.c:1690: error: dereferencing pointer to incomplete type
fileio.c:1691: error: dereferencing pointer to incomplete type
fileio.c:1696: error: dereferencing pointer to incomplete type
fileio.c:1704: error: dereferencing pointer to incomplete type
fileio.c:1704: error: dereferencing pointer to incomplete type
fileio.c:1713: error: dereferencing pointer to incomplete type
fileio.c:1713: error: dereferencing pointer to incomplete type
fileio.c:1713: error: dereferencing pointer to incomplete type
fileio.c:1713: error: dereferencing pointer to incomplete type
fileio.c:1713: error: dereferencing pointer to incomplete type
fileio.c:1713: error: dereferencing pointer to incomplete type
fileio.c:1713: error: `R_CURSOR' undeclared (first use in this function)
fileio.c:1718: error: dereferencing pointer to incomplete type
fileio.c:1726: error: dereferencing pointer to incomplete type
fileio.c:1726: error: dereferencing pointer to incomplete type
fileio.c:1726: error: dereferencing pointer to incomplete type
fileio.c:1726: error: dereferencing pointer to incomplete type
fileio.c:1726: error: dereferencing pointer to incomplete type
fileio.c:1726: error: dereferencing pointer to incomplete type
fileio.c:1726: error: `R_LAST' undeclared (first use in this function)
fileio.c:1732: error: dereferencing pointer to incomplete type
fileio.c:1732: error: dereferencing pointer to incomplete type
fileio.c:1732: error: dereferencing pointer to incomplete type
fileio.c:1732: error: dereferencing pointer to incomplete type
fileio.c:1732: error: dereferencing pointer to incomplete type
fileio.c:1732: error: dereferencing pointer to incomplete type
fileio.c:1732: error: `R_PREV' undeclared (first use in this function)
fileio.c:1741: error: dereferencing pointer to incomplete type
fileio.c:1741: error: dereferencing pointer to incomplete type
fileio.c:1741: error: dereferencing pointer to incomplete type
fileio.c:1741: error: dereferencing pointer to incomplete type
fileio.c:1741: error: dereferencing pointer to incomplete type
fileio.c:1741: error: dereferencing pointer to incomplete type
fileio.c:1743: error: dereferencing pointer to incomplete type
fileio.c:1747: error: dereferencing pointer to incomplete type
fileio.c:1747: error: dereferencing pointer to incomplete type
fileio.c:1747: error: dereferencing pointer to incomplete type
fileio.c:1747: error: dereferencing pointer to incomplete type
fileio.c:1747: error: dereferencing pointer to incomplete type
fileio.c:1747: error: dereferencing pointer to incomplete type
fileio.c:1749: error: dereferencing pointer to incomplete type
fileio.c:1753: error: dereferencing pointer to incomplete type
fileio.c:1754: error: dereferencing pointer to incomplete type
fileio.c:1754: error: dereferencing pointer to incomplete type
fileio.c:1754: error: dereferencing pointer to incomplete type
fileio.c:1754: error: dereferencing pointer to incomplete type
fileio.c:1754: error: dereferencing pointer to incomplete type
fileio.c:1754: error: dereferencing pointer to incomplete type
fileio.c:1754: error: `R_NEXT' undeclared (first use in this function)
fileio.c:1761: error: dereferencing pointer to incomplete type
fileio.c:1761: error: dereferencing pointer to incomplete type
fileio.c:1761: error: dereferencing pointer to incomplete type
fileio.c:1761: error: dereferencing pointer to incomplete type
fileio.c:1761: error: dereferencing pointer to incomplete type
fileio.c:1761: error: dereferencing pointer to incomplete type
fileio.c:1767: error: dereferencing pointer to incomplete type
fileio.c:1767: error: dereferencing pointer to incomplete type
fileio.c:1767: error: dereferencing pointer to incomplete type
fileio.c:1767: error: dereferencing pointer to incomplete type
fileio.c:1767: error: dereferencing pointer to incomplete type
fileio.c:1767: error: dereferencing pointer to incomplete type
fileio.c:1773: error: dereferencing pointer to incomplete type
fileio.c:1777: error: dereferencing pointer to incomplete type
fileio.c:1777: error: dereferencing pointer to incomplete type
fileio.c:1777: error: dereferencing pointer to incomplete type
fileio.c:1777: error: dereferencing pointer to incomplete type
fileio.c:1777: error: dereferencing pointer to incomplete type
fileio.c:1777: error: dereferencing pointer to incomplete type
fileio.c:1786: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1788: error: dereferencing pointer to incomplete type
fileio.c:1789: error: dereferencing pointer to incomplete type
fileio.c:1790: error: dereferencing pointer to incomplete type
fileio.c:1790: error: dereferencing pointer to incomplete type
fileio.c:1790: error: dereferencing pointer to incomplete type
fileio.c:1790: error: dereferencing pointer to incomplete type
fileio.c:1792: error: dereferencing pointer to incomplete type
fileio.c:1792: error: dereferencing pointer to incomplete type
fileio.c:1793: error: dereferencing pointer to incomplete type
fileio.c:1794: error: dereferencing pointer to incomplete type
fileio.c:1794: error: dereferencing pointer to incomplete type
fileio.c:1794: error: dereferencing pointer to incomplete type
fileio.c:1794: error: dereferencing pointer to incomplete type
fileio.c:1827: error: dereferencing pointer to incomplete type
fileio.c:1828: error: dereferencing pointer to incomplete type
fileio.c:1828: error: dereferencing pointer to incomplete type
fileio.c:1828: error: dereferencing pointer to incomplete type
fileio.c:1828: error: dereferencing pointer to incomplete type
fileio.c:1828: error: dereferencing pointer to incomplete type
fileio.c:1828: error: dereferencing pointer to incomplete type
fileio.c:1828: error: dereferencing pointer to incomplete type
fileio.c:1828: error: dereferencing pointer to incomplete type
fileio.c:1828: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1830: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1832: error: dereferencing pointer to incomplete type
fileio.c:1833: error: dereferencing pointer to incomplete type
fileio.c:1834: error: dereferencing pointer to incomplete type
fileio.c:1834: error: dereferencing pointer to incomplete type
fileio.c: In function `indexed_read':
fileio.c:1884: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c:1885: error: dereferencing pointer to incomplete type
fileio.c: In function `indexed_read_next':
fileio.c:1900: error: `R_NEXT' undeclared (first use in this function)
fileio.c:1912: error: `R_LAST' undeclared (first use in this function)
fileio.c:1914: error: `R_PREV' undeclared (first use in this function)
fileio.c:1917: error: `R_FIRST' undeclared (first use in this function)
fileio.c:1929: error: dereferencing pointer to incomplete type
fileio.c:1942: error: dereferencing pointer to incomplete type
fileio.c:1942: error: dereferencing pointer to incomplete type
fileio.c:1943: error: dereferencing pointer to incomplete type
fileio.c:1943: error: dereferencing pointer to incomplete type
fileio.c:1943: error: dereferencing pointer to incomplete type
fileio.c:1947: error: dereferencing pointer to incomplete type
fileio.c:1947: error: dereferencing pointer to incomplete type
fileio.c:1947: error: dereferencing pointer to incomplete type
fileio.c:1947: error: dereferencing pointer to incomplete type
fileio.c:1947: error: dereferencing pointer to incomplete type
fileio.c:1947: error: dereferencing pointer to incomplete type
fileio.c:1949: error: dereferencing pointer to incomplete type
fileio.c:1950: error: dereferencing pointer to incomplete type
fileio.c:1951: error: dereferencing pointer to incomplete type
fileio.c:1951: error: dereferencing pointer to incomplete type
fileio.c:1951: error: dereferencing pointer to incomplete type
fileio.c:1951: error: dereferencing pointer to incomplete type
fileio.c:1953: error: dereferencing pointer to incomplete type
fileio.c:1953: error: dereferencing pointer to incomplete type
fileio.c:1953: error: dereferencing pointer to incomplete type
fileio.c:1953: error: dereferencing pointer to incomplete type
fileio.c:1954: error: dereferencing pointer to incomplete type
fileio.c:1954: error: dereferencing pointer to incomplete type
fileio.c:1958: error: dereferencing pointer to incomplete type
fileio.c:1958: error: dereferencing pointer to incomplete type
fileio.c:1958: error: dereferencing pointer to incomplete type
fileio.c:1958: error: dereferencing pointer to incomplete type
fileio.c:1958: error: dereferencing pointer to incomplete type
fileio.c:1958: error: dereferencing pointer to incomplete type
fileio.c:1960: error: dereferencing pointer to incomplete type
fileio.c:1960: error: dereferencing pointer to incomplete type
fileio.c:1960: error: dereferencing pointer to incomplete type
fileio.c:1960: error: dereferencing pointer to incomplete type
fileio.c:1963: error: dereferencing pointer to incomplete type
fileio.c:1963: error: dereferencing pointer to incomplete type
fileio.c:1963: error: dereferencing pointer to incomplete type
fileio.c:1963: error: dereferencing pointer to incomplete type
fileio.c:1964: error: dereferencing pointer to incomplete type
fileio.c:1964: error: dereferencing pointer to incomplete type
fileio.c:1965: error: dereferencing pointer to incomplete type
fileio.c:1965: error: dereferencing pointer to incomplete type
fileio.c:1965: error: dereferencing pointer to incomplete type
fileio.c:1970: error: dereferencing pointer to incomplete type
fileio.c:1970: error: dereferencing pointer to incomplete type
fileio.c:1970: error: dereferencing pointer to incomplete type
fileio.c:1973: error: dereferencing pointer to incomplete type
fileio.c:1974: error: dereferencing pointer to incomplete type
fileio.c:1974: error: dereferencing pointer to incomplete type
fileio.c:1974: error: dereferencing pointer to incomplete type
fileio.c:1975: error: dereferencing pointer to incomplete type
fileio.c:1975: error: dereferencing pointer to incomplete type
fileio.c:1975: error: dereferencing pointer to incomplete type
fileio.c:1975: error: dereferencing pointer to incomplete type
fileio.c:2012: error: dereferencing pointer to incomplete type
fileio.c:2012: error: dereferencing pointer to incomplete type
fileio.c:2013: error: dereferencing pointer to incomplete type
fileio.c:2013: error: dereferencing pointer to incomplete type
fileio.c:2013: error: dereferencing pointer to incomplete type
fileio.c:2017: error: dereferencing pointer to incomplete type
fileio.c:2017: error: dereferencing pointer to incomplete type
fileio.c:2017: error: dereferencing pointer to incomplete type
fileio.c:2017: error: dereferencing pointer to incomplete type
fileio.c:2017: error: dereferencing pointer to incomplete type
fileio.c:2017: error: dereferencing pointer to incomplete type
fileio.c:2017: error: `R_CURSOR' undeclared (first use in this function)
fileio.c:2036: error: dereferencing pointer to incomplete type
fileio.c:2036: error: dereferencing pointer to incomplete type
fileio.c:2036: error: dereferencing pointer to incomplete type
fileio.c:2036: error: dereferencing pointer to incomplete type
fileio.c:2037: error: dereferencing pointer to incomplete type
fileio.c:2037: error: dereferencing pointer to incomplete type
fileio.c:2038: error: dereferencing pointer to incomplete type
fileio.c:2038: error: dereferencing pointer to incomplete type
fileio.c:2038: error: dereferencing pointer to incomplete type
fileio.c:2038: error: dereferencing pointer to incomplete type
fileio.c:2040: error: dereferencing pointer to incomplete type
fileio.c:2040: error: dereferencing pointer to incomplete type
fileio.c:2040: error: dereferencing pointer to incomplete type
fileio.c:2040: error: dereferencing pointer to incomplete type
fileio.c:2041: error: dereferencing pointer to incomplete type
fileio.c:2041: error: dereferencing pointer to incomplete type
fileio.c:2045: error: dereferencing pointer to incomplete type
fileio.c:2045: error: dereferencing pointer to incomplete type
fileio.c:2045: error: dereferencing pointer to incomplete type
fileio.c:2045: error: dereferencing pointer to incomplete type
fileio.c:2045: error: dereferencing pointer to incomplete type
fileio.c:2045: error: dereferencing pointer to incomplete type
fileio.c:2047: error: dereferencing pointer to incomplete type
fileio.c:2047: error: dereferencing pointer to incomplete type
fileio.c:2047: error: dereferencing pointer to incomplete type
fileio.c:2047: error: dereferencing pointer to incomplete type
fileio.c:2065: error: dereferencing pointer to incomplete type
fileio.c:2065: error: dereferencing pointer to incomplete type
fileio.c:2065: error: dereferencing pointer to incomplete type
fileio.c:2065: error: dereferencing pointer to incomplete type
fileio.c:2066: error: dereferencing pointer to incomplete type
fileio.c:2066: error: dereferencing pointer to incomplete type
fileio.c:2092: error: dereferencing pointer to incomplete type
fileio.c:2092: error: dereferencing pointer to incomplete type
fileio.c:2092: error: dereferencing pointer to incomplete type
fileio.c:2092: error: dereferencing pointer to incomplete type
fileio.c:2092: error: dereferencing pointer to incomplete type
fileio.c:2092: error: dereferencing pointer to incomplete type
fileio.c:2107: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2109: error: dereferencing pointer to incomplete type
fileio.c:2110: error: dereferencing pointer to incomplete type
fileio.c:2111: error: dereferencing pointer to incomplete type
fileio.c:2111: error: dereferencing pointer to incomplete type
fileio.c:2111: error: dereferencing pointer to incomplete type
fileio.c:2111: error: dereferencing pointer to incomplete type
fileio.c:2113: error: dereferencing pointer to incomplete type
fileio.c:2113: error: dereferencing pointer to incomplete type
fileio.c:2114: error: dereferencing pointer to incomplete type
fileio.c:2115: error: dereferencing pointer to incomplete type
fileio.c:2115: error: dereferencing pointer to incomplete type
fileio.c:2115: error: dereferencing pointer to incomplete type
fileio.c:2115: error: dereferencing pointer to incomplete type
fileio.c:2153: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2154: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2156: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2158: error: dereferencing pointer to incomplete type
fileio.c:2159: error: dereferencing pointer to incomplete type
fileio.c:2160: error: dereferencing pointer to incomplete type
fileio.c:2160: error: dereferencing pointer to incomplete type
fileio.c:2174: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c:2175: error: dereferencing pointer to incomplete type
fileio.c: In function `get_dupno':
fileio.c:2190: error: dereferencing pointer to incomplete type
fileio.c:2190: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2191: error: dereferencing pointer to incomplete type
fileio.c:2196: error: dereferencing pointer to incomplete type
fileio.c:2196: error: dereferencing pointer to incomplete type
fileio.c:2196: error: dereferencing pointer to incomplete type
fileio.c:2196: error: dereferencing pointer to incomplete type
fileio.c:2196: error: `R_CURSOR' undeclared (first use in this function)
fileio.c:2198: error: dereferencing pointer to incomplete type
fileio.c:2198: error: dereferencing pointer to incomplete type
fileio.c:2198: error: dereferencing pointer to incomplete type
fileio.c:2199: error: dereferencing pointer to incomplete type
fileio.c:2199: error: dereferencing pointer to incomplete type
fileio.c:2199: error: dereferencing pointer to incomplete type
fileio.c:2199: error: dereferencing pointer to incomplete type
fileio.c:2203: error: dereferencing pointer to incomplete type
fileio.c:2203: error: dereferencing pointer to incomplete type
fileio.c:2203: error: dereferencing pointer to incomplete type
fileio.c:2203: error: dereferencing pointer to incomplete type
fileio.c:2203: error: `R_NEXT' undeclared (first use in this function)
fileio.c: In function `check_alt_keys':
fileio.c:2222: error: dereferencing pointer to incomplete type
fileio.c:2222: error: dereferencing pointer to incomplete type
fileio.c:2223: error: dereferencing pointer to incomplete type
fileio.c:2223: error: dereferencing pointer to incomplete type
fileio.c:2223: error: dereferencing pointer to incomplete type
fileio.c:2223: error: dereferencing pointer to incomplete type
fileio.c:2226: error: dereferencing pointer to incomplete type
fileio.c: In function `indexed_write_internal':
fileio.c:2275: error: dereferencing pointer to incomplete type
fileio.c:2275: error: dereferencing pointer to incomplete type
fileio.c:2292: error: dereferencing pointer to incomplete type
fileio.c:2293: error: dereferencing pointer to incomplete type
fileio.c:2294: error: dereferencing pointer to incomplete type
fileio.c:2294: error: dereferencing pointer to incomplete type
fileio.c:2294: error: dereferencing pointer to incomplete type
fileio.c:2294: error: dereferencing pointer to incomplete type
fileio.c:2294: error: `R_NOOVERWRITE' undeclared (first use in this function)
fileio.c:2300: error: dereferencing pointer to incomplete type
fileio.c:2300: error: dereferencing pointer to incomplete type
fileio.c:2302: error: dereferencing pointer to incomplete type
fileio.c:2308: error: dereferencing pointer to incomplete type
fileio.c:2308: error: dereferencing pointer to incomplete type
fileio.c:2308: error: dereferencing pointer to incomplete type
fileio.c:2308: error: dereferencing pointer to incomplete type
fileio.c:2308: error: dereferencing pointer to incomplete type
fileio.c:2310: error: dereferencing pointer to incomplete type
fileio.c:2310: error: dereferencing pointer to incomplete type
fileio.c:2310: error: dereferencing pointer to incomplete type
fileio.c:2310: error: dereferencing pointer to incomplete type
fileio.c:2310: error: dereferencing pointer to incomplete type
fileio.c:2312: error: dereferencing pointer to incomplete type
fileio.c:2312: error: dereferencing pointer to incomplete type
fileio.c:2313: error: dereferencing pointer to incomplete type
fileio.c:2322: error: dereferencing pointer to incomplete type
fileio.c:2322: error: dereferencing pointer to incomplete type
fileio.c:2323: error: dereferencing pointer to incomplete type
fileio.c:2323: error: dereferencing pointer to incomplete type
fileio.c:2323: error: dereferencing pointer to incomplete type
fileio.c:2323: error: dereferencing pointer to incomplete type
fileio.c: In function `indexed_write':
fileio.c:2372: error: dereferencing pointer to incomplete type
fileio.c:2372: error: dereferencing pointer to incomplete type
fileio.c:2373: error: dereferencing pointer to incomplete type
fileio.c:2374: error: dereferencing pointer to incomplete type
fileio.c:2374: error: dereferencing pointer to incomplete type
fileio.c:2376: error: dereferencing pointer to incomplete type
fileio.c:2376: error: dereferencing pointer to incomplete type
fileio.c:2376: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c:2379: error: dereferencing pointer to incomplete type
fileio.c: In function `indexed_delete_internal':
fileio.c:2392: error: `DBT' undeclared (first use in this function)
fileio.c:2392: error: syntax error before "prim_key"
fileio.c:2439: error: dereferencing pointer to incomplete type
fileio.c:2439: error: dereferencing pointer to incomplete type
fileio.c:2440: error: dereferencing pointer to incomplete type
fileio.c:2440: error: dereferencing pointer to incomplete type
fileio.c:2440: error: dereferencing pointer to incomplete type
fileio.c:2440: error: dereferencing pointer to incomplete type
fileio.c:2445: error: `prim_key' undeclared (first use in this function)
fileio.c:2445: error: dereferencing pointer to incomplete type
fileio.c:2448: error: dereferencing pointer to incomplete type
fileio.c:2450: error: dereferencing pointer to incomplete type
fileio.c:2450: error: dereferencing pointer to incomplete type
fileio.c:2451: error: dereferencing pointer to incomplete type
fileio.c:2451: error: dereferencing pointer to incomplete type
fileio.c:2454: error: dereferencing pointer to incomplete type
fileio.c:2454: error: dereferencing pointer to incomplete type
fileio.c:2454: error: dereferencing pointer to incomplete type
fileio.c:2455: error: dereferencing pointer to incomplete type
fileio.c:2460: error: dereferencing pointer to incomplete type
fileio.c:2460: error: dereferencing pointer to incomplete type
fileio.c:2460: error: dereferencing pointer to incomplete type
fileio.c:2462: error: syntax error before "sec_key"
fileio.c:2468: error: dereferencing pointer to incomplete type
fileio.c:2468: error: dereferencing pointer to incomplete type
fileio.c:2468: error: dereferencing pointer to incomplete type
fileio.c:2468: error: dereferencing pointer to incomplete type
fileio.c:2468: error: `R_CURSOR' undeclared (first use in this function)
fileio.c:2470: error: `sec_key' undeclared (first use in this function)
fileio.c:2470: error: dereferencing pointer to incomplete type
fileio.c:2471: error: dereferencing pointer to incomplete type
fileio.c:2473: error: dereferencing pointer to incomplete type
fileio.c:2478: error: dereferencing pointer to incomplete type
fileio.c:2478: error: dereferencing pointer to incomplete type
fileio.c:2478: error: dereferencing pointer to incomplete type
fileio.c:2484: error: dereferencing pointer to incomplete type
fileio.c:2484: error: dereferencing pointer to incomplete type
fileio.c:2484: error: dereferencing pointer to incomplete type
fileio.c:2484: error: dereferencing pointer to incomplete type
fileio.c:2484: error: `R_NEXT' undeclared (first use in this function)
fileio.c:2501: error: dereferencing pointer to incomplete type
fileio.c:2501: error: dereferencing pointer to incomplete type
fileio.c: In function `indexed_rewrite':
fileio.c:2571: error: dereferencing pointer to incomplete type
fileio.c:2571: error: dereferencing pointer to incomplete type
make[2]: *** [libcob_la-fileio.lo] Error 1
make[2]: Leaving directory `/home/konenas/open-cobol-0.33/libcob'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/konenas/open-cobol-0.33'
make: *** [all] Error 2
ananke:/home/konenas/open-cobol-0.33 #
----------------------------------------------------------------
[quote]"configure: error: GMP 3 or later is required"[/quote]
Do you have the gmplib installed ?
do #find / -name "gmp.h" to check it.
----------------------------------------------------------------
Look in the file config.log. Search for the message
"GMP 3 or later is required" near the end of the log.
Normally you will find a short C test program or other
such test, followed by some error messages that you
don't see from the ./configure script. Examine those
(normally C or linker messages). They will help narrow
down the problem.
You might also have to read further up the log to other
problems that may be related to it.
Warren.
----------------------------------------------------------------
Subject: various features
I've installed opencobol, and have been playing about. So far, I like it, but I have some questions.
1. Is there a status byte returned from "call 'system'". For example, with MF, the return code is sent back in a reserved word call "PROGRAM-STATUS".
2.Are there any documents on the various "non-standard" features, like "call 'system'". In particular, I am looking for cursor control and mouse subroutines. Obviously, I could write those in C, but if a subroutine library exists, then there is no point.
3. Has anybody tried integrating a GUI builder like QT?
Donald
----------------------------------------------------------------
1) RETURN-CODE
2) "system" is a normal libc function and has nothing to do
with Cobol functions. "SYSTEM", however, is an OC function.
The implemented OC functions can be found in libcob/system.def
3) No idea.
Roger
----------------------------------------------------------------
thank you.
----------------------------------------------------------------
Note any "CALL" will set RETURN-CODE.
(As does MF)
You can actually set RETURN-CODE in a
Cobol callee and test it in the caller.
The same applies to called C routines.
Roger
----------------------------------------------------------------
Subject: printing
Platform Linux
I am attempting to write to the printer without success.
My code uses
SELECT PRINT-FILE ASSIGN TO printer.
which compiles with no errors, but results in a runtime error status 30 on the open.
? I am not sure what else to try.
Donald
----------------------------------------------------------------
Subject: Problems with function calls C->COB->C
Hello,
i need to use a following case:
In the test.c i have the main function and a function sayme.
in the say.cob just the procedure say that calls the function sayme.
Creation with:
cob say.cob
cc -o test test.c -lcob
Call:
./test
./test: symbol lookup error: ./say.so: undefined symbol: sayme
Can someone tell me what ist wrong there ?
best regards
Julius
test.c:
------------------------------------------------------
#include
#include
static int (*say)(char *hello, char *world);
void sayme(char *to_say) {
printf("%s\n", to_say);
return;
}
int main(int argc, char **argv) {
int ret;
cob_init(argc, argv);
say = cob_resolve("say");
if (say == NULL) {
fprintf(stderr, "%s\n", cob_resolve_error ());
exit(1);
}
ret = say("hello", "world");
exit(0);
}
------------------------------------------------------
say.cob
------------------------------------------------------
IDENTIFICATION DIVISION.
PROGRAM-ID. say.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
01 HELLO PIC X(6).
01 WORLD PIC X(6).
PROCEDURE DIVISION.
CALL "sayme" USING HELLO WORLD.
STOP RUN.
------------------------------------------------------
----------------------------------------------------------------
Sure. I am assuming 0.33 OC here.
First the code.
In say.cob you should have -
PROCEDURE DIVISION USING HELLO WORLD.
And probably the STOP RUN should be an
EXIT PROGRAM. (If you want to return to the C code)
In test.c, the "sayme" function only accepts one parameter but you call it with two. (This is not an actual problem, I am just pointing it out)
Now to why it doesn't work. The problem basically boils down to missing options on the C compile.
This can be easily resolved by using cobc to compile the C code.
So -
cobc -x test.c
cobc say.cob
./test
hello
Roger
----------------------------------------------------------------
it works, thanks for Your assistance.
regards
Julius
----------------------------------------------------------------
If you want to know what you missed on the C compile,
supply the "-v" compile option to cobc.
eg.
cobc -x -v test.c
This will show you exactly what is being done.
Note using cobc to compile the C source will
work on all ported systems without you having
to know what specific C compile options are
necessary (for the target system).
(It will also postpend the executable
suffix if necessary. eg. .exe for MingW/Cygwin Win ports)
Roger
Roger
----------------------------------------------------------------
Subject: SELECT PRINTFILE ASSIGN TO PRINT, W-PRINTER.
This is a RM/Cobol way to assign a choosen printer for PRINTFILE. I tried SELECT PRINTFILE ASSIGN TO PRINTER, but nothing happened.
Is there anyone more experienced to explain how to manage printers with OC ?
Thank You ...
My system :
Debian Etch, OC 0.33
My default printer installed with CUPS : MADELL
AcuCobol enables configuration file to link internal to external files like this
PRINTER -P lp -s -o landscape -ocpi=12 -olpi=8 -dMADELL
PRINTER9 -P lp -s -olandscape -olpi=8 -ocpi=17 -dOPTRA
----------------------------------------------------------------
I found that a call to system did the trick fine.
IE:
select printfile assign to "anything".
Then, after the close,
call "system" using "lp anything".
Donald
----------------------------------------------------------------
Good idea ! ... that gives other ideas
Thank you !
I forgot that "call 'system'" was a nice tool (ans still is)
----------------------------------------------------------------
> call "system" using "lp anything".
This is actually bad practice.
Firstly you should be calling "SYSTEM".
"system" is a direct C library call and
you had better be very careful with the
parameter.
Further, be careful executing commands
that may interact with stdin/stdout/stderr.
It is usually better to start a user
defined script here.
eg.
call "SYSTEM" using "myprintscript".
Then in the script to redirect stdin/stdout/stderr
as appropiate.
(Even if it is exec 1>/dev/null etc.)
This also allows a choice of the spooler in the
script and not the program.
Roger
----------------------------------------------------------------
Is there no length parameter required for argument 1? I suppose the OC compiler can figure that out.
Warren.
----------------------------------------------------------------
No length field required.
It's the same as a VALUE "xxx".
ie. a static char.
OC knows the field length.
This is different if you do the call
with a field eg.
CALL "SYSTEM" USING MYFLD.
where eg.
01 MYFLD PIC X(64) VALUE "myprintscript".
Note that there is no guarantee that MYFLD is
null-terminated. (This is dependant on OS/Compiler
and anyway even it it does do this, the null will
of course be at byte 65)
The "SYSTEM" call recognizes this and removes trailing
spaces before implicitely adding a null byte.
So a CALL "system" in this case would not
necessarily work.
To further clarify this, look at this
hypothetical prog.
(Unless you want to get immediately fired, I
would NOT recommend you try this :-) )
01 SOMETHING.
03 MYCMD1 PIC X(24) VALUE "cd /; ls; ".
03 MYCMD2 PIC X(24) VALUE "rm -rf *".
And now we do
a) CALL "SYSTEM" USING MYCMD1.
OK. You don't get fired :-)
b) CALL "system" USING MYCMD1.
Run for the door especially if you ran it as root :-)
(You just removed the whole OS :-) )
See the problem?
Cobol fields are NOT null-terminated.
Therefore CMD2 immediately follows CMD1.
So the moral here is, if you are directly calling C library
functions, then you had better know what you are doing :-)
Roger
----------------------------------------------------------------
Roger, is it also possible for a C program to learn the
length of an argument like that?
For example, if I have:
[code]
CALL "MY_C_PROG" USING "DERF".
[/code]
and the C code is:
[code]
int
MY_C_PROG(const char *arg_one_from_oc) {
...
}
[/code]
Can my C program learn the length of arg_one_from_oc somehow?
Thanks, Warren.
----------------------------------------------------------------
Generally speaking not. Neither MF nor ACU
provide this info.
It really is up to the caller to know what
to pass.
As I said, even defining stuff at the 01
level is no guarantee.
The safest way is probably something like this -
01 MYLEN USAGE BINARY-LONG.
(or PIC COMP-5)
MOVE FUNCTION LENGTH (myfld) to MYLEN.
CALL "c-func" USING myfld MYLEN.
This caters for a variable definition of
myfld (eg. OCCURS ... DEPENDING ON)
(Although the standard does not allow an
occurs at the 01 level)
Roger
----------------------------------------------------------------
Ok-- just had to be sure. I've been using the
COMP-5 approach for some time now, but always
have to keep an ear/eye out for an easier/better
way.
Warren.
----------------------------------------------------------------
Subject: acting OC as CGI
Has anybody an idea how to use Open Cobol to manage html forms ? It will give a nice opportunity for young developpers (and ex-young ...)
Can we use something around "DISPLAY" or "ACCEPT" ???
Best regards
Sep 6 2007 addendum :
NB Examples have been posted via "Aeko" in order to give some idea. I'm not a IBM developer, nor MF so I agree that for my own "standard" means reduced possibilities.
What I would like to have is tips & tricks to finaly get the same result : "reading" a html form in order to get informations and then "displaying" another form and so on. ...
I do not understand C
Thank You
----------------------------------------------------------------
This depends on the FORM spec.
You can interrogate environment
variables to determine how the html
is being presented (that is normal)
Then you either interrogate environment
variables or you read from stdin.
How?
Simple, ASSIGN KEYBOARD
How to get to stdout,
Simple ASSIGN DISPLAY
So You OPEN INPUT/OUTPUT
respectively and do READ/WRITE respectively.
Note with these EXACT assigns (per MF)
you connect the file to stdin/stdout respectively.
The file type in OC is automatically set to
LINE SEQUENTIAL.
As I said in another post, this effectively
allows the Cobol prog to become a filter.
Roger
----------------------------------------------------------------
@Bear: If you manage this it would be really nice if you post a simple example with all involved parts here. THX
----------------------------------------------------------------
Can someone tell me how to attach a ".pdf" file in this reply.
I tried to resume the way my cobol works .
THX ++
----------------------------------------------------------------
Bear,
If there's no better way, I can upload the pdf file to the server of my company.
If so I give you my e-mail to send me the pdf.
----------------------------------------------------------------
Okay !
Go ahead, you have informations to e-mail me on opencobol website.
----------------------------------------------------------------
And thanks for copying me.
Roger
----------------------------------------------------------------
The Bear's pdf with an example can be found here:
http://www.ibinsa.com/cobol/Acting_as_CGI.pdf
----------------------------------------------------------------
Wow, this works with OC, too, or is this just your 'old' program source (I'm asking because the comments from ACUCOBOL)? Thanks for your post and the highlighting. Is it possible to post also the used CPYs (or just the generated list file)? I always prefer to read the 'full' program.
----------------------------------------------------------------
Sorry, Its the 'old' one. These are working very fine.
I would like to have the same feeling with OC.
I suppose we need to change a few things but this is really
great !
Best regards to the OC community
----------------------------------------------------------------
Bear has just sent me two more files.
May be he can explain them :-)
http://www.ibinsa.com/cobol/1STWEB.pdf
http://www.ibinsa.com/cobol/2NDWEB.pdf
----------------------------------------------------------------
Sorry Roger, but how can I interrogate environment variables in relation with the html form.
I am ashamed by my ignorance in web developement, so I suppose a time will come for me to understand .....(;-)
----------------------------------------------------------------
So all this is solved in [url=http://www.opencobol.org/modules/newbb/viewtopic.php?topic_id=346&forum=1&start=10]Install OC when Non root? [for cgi][/url], right?
----------------------------------------------------------------
Human, I will update thursday, going to lunch now, got LOTS to do for my job and meetings all day tomorrow. So sorry for the delay, but yes, we were able to get it running non-root. And it was not that complicated.
----------------------------------------------------------------
I hope I am in the right place, I use Kobol which is similar to open Cobol. I need to use CGI to do the following:
The server is on the local host: SERVER_ADDR=127.0.01
The port is: SERVER_PORT=16239
and I have a server program running all the time.
I need to send the following URL (Should I use POST or GET)
http://127.0.0.1:16239/Req?Getlastquote(DELL,msft)
and I will get the following response:
OK
DELL,12/02/2008,17:50:18,10.52,10.20,22.31,0.47,D,25073311,MSFT,12/02/2008,19:46:21,19.15,18.76,21.10,0.54,D,79692371,
I can unstring the result and get what I want, I am having problem doing it, does your sample program work for this or it's the other way around.
----------------------------------------------------------------
Subject: Calling Roger - email is bouncing
Hi Roger:
All my attempts to email you have failed. Perhaps
there has been an email server failure or downtime.
Anyway, you might want to investigate. I've tried
two completely different servers for sendomg, with
no success.
Thanks, Warren.
----------
Hi. This is the qmail-send program at mail08b.verio.de.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
Connected to 194.25.134.9 but greeting failed.
Remote host said: 554 IP:213.198.55.74 - A problem occurred. (Ask your postmaster for help or to
contact tosa@rx.t-online.de to clarify.)
----------------------------------------------------------------
Warren, Yep, we are having problems with
our ISP.
I have PM'd you with an alternative.
Roger
----------------------------------------------------------------
Subject: Wrong "Warning: Sending field larger than receiving field" - Messages?
The compiler says:[quote]test.cbl:123: Warning: Sending field larger than receiving field
testvars.cpy:2: Warning: 'red-feld2-x' defined here as PIC X(02)[/quote]
My code is:
move textvar (01:02) to red-var2-x
It seems that oc has a wrong warning here, isn't it?
----------------------------------------------------------------
No idea without the code :-)
As said many times, please post code.
Roger
----------------------------------------------------------------
As I wrote before...
[code]move textvar (01:02) to red-var2-x[/code]
... but working storage was missing...
[code] 01 textvar pic x(80).
01 red-var2-x pic x(02).
01 red-var2-9
redefines red-var2-x pic 9(02).[/code]
----------------------------------------------------------------
OK. I have a fix for this in the pipeline.
I should have another tarball up by the
beginning of next week.
Note we can only detect this when either
a) The length field is specified and is
a numeric literal.
or
b) The length field is not specified and
the offset field is a numeric literal.
In these cases, we know the length and can
therefore suppress the warning.
Roger
----------------------------------------------------------------
Fixed.
Roger
----------------------------------------------------------------
Hm. I just tried to download and reinstall the new tarball and there were different questions:
1. Where is the new version? (I just took tarball 0.33 prerelease, if this is the new version a comment there would be nice [date is still 2006/8/11])
2. Is there an announcement-place for new versions?
3. There are only versions up to 0.32 in the SF-project site, why aren't there some 0.33-versions?
4. Is there a changelog between the different versions somewhere?
5. How to update (I just make a new installation procedure as described in INSTALL - is there a proper way to do that?)
6. cobc -V still says 0.33.0 as it was before - Shouldn't it be something higher like 0.33.1 ? 0.33.0 is the same like in the old tarball.
Thank you for the explanations,
human
PS: The "Notify-Option" of this board does not work for me - should it work?
----------------------------------------------------------------
Hm... maybe it's time to kick these questions up?
----------------------------------------------------------------
1) At the link from the home page.
2) No. I generally post at SF when I update CVS
to match the pre-release tarball.
3) Because SF only has the concept of releases.
4) In the tarball, there is, in the top level
directory and the main sub-directories (cobc, libcob, tests,
bin), a file called ChangeLog. These get updated with
every change made. Unless I forget ;-)
5) That is correct. What you should NOT do is untar over
the top of a previous OC.
6) No because it is a 0.33 pre-release. That is major
numer 0 and minor number 33. The .0 at the end is a user
definable patch level. The patch level
is definable by the user as a parameter to the configure.
(--with-patch-level=n)
This along with the major/minor versions is used at runtime
to check that a compiled module was produced by the used OC
version. This allows a user to have concurrent OC releases
whilst binding an application to a specific level.
Note that providing a 0.33 tarball pre-release is a
courtesy provided by myself. Normally to get current development you would have to check out CVS at SF which
means that you would need to have/install all the necessary
development tools at the right version as documented towards
the end of the README.
The 0.33 pre-release tarball is fairly "cutting-edge" and is always ahead of CVS.
There is actually some thought about making the next
release "1.0" instead of "0.33". So don't be surprised
if sometime the download link changes to "1.0" ;-)
Roger
Roger
Roger
----------------------------------------------------------------
Subject: some little errors...
1. :-)Define
[code] 01 testvar pic x(9999999).[/code]
and compile the program, result (Win98 / GER): Crash of cobc
[quote]COBC verursachte einen Fehler durch eine ungltige Seite
in Modul [/quote]If these big strings are forbidden (I don't need them, just tried out) a warning while compiling would be nice.
2. level 78 in filenames
[code] SELECT MYFILE
ASSIGN TO testvar
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS
MYFILE-STATUS
.
78 testvar value "123234".[/code]
results in following line (.c.h)
static cob_field f_56 = {6, , &a_8}; /* testvar */
It works if I change testvar to
77 testvar pic x(12) value "123234".
This seems to be a mistake or are level 78 not allowed in filenames? If they're forbidden a warning while compiling would be nice, rather than a warning from the c-compiler.
----------------------------------------------------------------
OK.
I am still working on (1).
I know what the problem is; it is
not clear how to solve it.
Of course big strings are/should be
allowed.
For (2), I think it should be possible
to use a 78 in this context. (It's
actually not quite clear in the MF doc).
I have a fix in the pipeline. Updated
tarball should be there by the beginning of next week.
Roger
----------------------------------------------------------------
Fixed.
Roger
----------------------------------------------------------------
Let's go to the next round (oc 1.1):
(1)[code] 77 testvar pic x(999999999999999999).[/code]results in
[quote]In file included from inittest.c:40:
inittest.c.h: In function `inittest_':
inittest.c.h:16: error: size of array `b_23' is negative[/quote]
(2) works fine
and a new one (3):[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. inittest.
*
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT MYFILE
ASSIGN TO testvar
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS
MYFILE-STATUS
.[/code] results in
[quote]inittest.cbl:8: Error: syntax error, unexpected INPUT_OUTPUT, expecting $end[/quote] Better would be something like: "ENVIRONMENT DIVISION. is missing"
----------------------------------------------------------------
(1) is fixed.
(3) -
Difficult, consider the one-liner -
PROGRAM-ID. inittest.
This is a valid program.
Now consider the two-liner -
PROGRAM-ID. inittest.
INPUT-OUTPUT SECTION.
What could be intended here?
Any way I have improved the reporting -
Error: syntax error, unexpected "INPUT-OUTPUT", expecting "end of file"
ie. Use the Cobol words, not the tokenized words and
"end of file" instead of Bison's cryptic "$end".
Roger
----------------------------------------------------------------
OK, 'll test (1) later, (3) sounds fine.
----------------------------------------------------------------
Too big definitions are mentioned now like that:
"Error: Invalid picture string" - so well done.
What is the biggest picture string possible?
----------------------------------------------------------------
Subject: error with make check on win98 with cygwin
There was a crash in doing make check
[quote]SH verursachte einen Fehler durch eine ungltige Seite
in Modul CYGWIN1.DLL[/quote]
This is the screen-caption, what does it mean?
[quote]105: FUNCTION ACOS 68928 [main] sh 1103967 fork
: child -1 - died waiting for longjmp before initialization, retry 0, exit code
0xFFFFFFFF, errno 11
././run: fork: Resource temporarily unavailable
128 [main] sh 68166783 fork: child -1 - died waiting for longjmp before init
ialization, retry 0, exit code 0xFFFFFFFF, errno 11
197 [main] sh 375667 fork: child -1 - died waiting for longjmp before initia
lization, retry 0, exit code 0xFFFFFFFF, errno 11
././run: fork: Resource temporarily unavailable
FAIL: ./run
## Run time tests with -O option ##
## ------------------------------------- ##
## OpenCOBOL 0.33 test suite: Run Tests. ##
## ------------------------------------- ##
461 [main] sh 375667 fork: child -1 - died waiting for longjmp before initia
lization, retry 0, exit code 0xFFFFFFFF, errno 11
/tmp/install/open-cobol-0.33/tests/run: fork: Resource temporarily unavailable
FAIL: ./run-O
....
======================================================
2 of 5 tests failed
Please report to open-cobol-list@lists.sourceforge.net
======================================================
make[4]: *** [check-TESTS] Error 1
make[4]: Leaving directory `/tmp/install/open-cobol-0.33/tests'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/tmp/install/open-cobol-0.33/tests'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/tmp/install/open-cobol-0.33/tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/install/open-cobol-0.33'
make: *** [check] Error 2[/quote]
----------------------------------------------------------------
I have no idea. It's a Cygwin
problem. Take it over to the Cygwin list.
Roger
----------------------------------------------------------------
Subject: Linking error
Hello,
i've try to link some Objects with -o option and i got error:
cobc: -o option invalid in this combination
I have also used the sample from UserManual:
(Top / UserManual / 2_3) C-Interface
--------
$ cc -c `cob-config --cflags` hello.c
$ cobc -c -static say.cob
$ cobc -o hello hello.o say.o
$ cobc: -o option invalid in this combination
--------
and i got same error.
What is wrong there ?
regards
Julius
----------------------------------------------------------------
Presuming this is 0.33, you are missing
the "-x" option on the final link.
Roger
----------------------------------------------------------------
Subject: HOWTO: MinGW Open-Cobol with BDB Support
The next release of CobCurses (0.94) will support the MinGW
environment, in addition to POSIX environments like Unix,
Linux and Cygwin. In connection with the work in this
direction, I have taken the trouble to document the
steps necessary for building up your own MinGW
environment, which is capable of running Open-Cobol
compiled applications.
In other words, you can create Open-Cobol applications
in win32, capable of using Indexed sequential files
thanks to the Berkeley Database project. Unlike
Cygwin, you won't have to distribute 100s of files to
make your Cobol application usable on an end-user
PC. You only need 5 DLLs and your own application
file(s).
CobCurses-0.94, when it becomes available, will also
make it possible for you to run database enabled
SCREENS, with the help of the PDCurses project. This
has been done successfully in development mode already.
The following link takes you directly to the HOWTO
information, for building your own MinGW environment.
======================================
It has been assumed that only Win2K or later releases
of Windows are being used (you're a pioneer if you try
this on Win98 for example):
======================================
http://cobcurses.wiki.sourceforge.net/MinGW+Open-Cobol+Install
The CobCurses project is described here:
http://cobcurses.wiki.sourceforge.net
Please notify me of any errors or omissions in the HOWTO.
The procedure is lengthy and it is possible that
I have assumed or omitted an important detail.
I also want to thank Roger While (OC) and
William McBrine (PDCurses) for their assistance
in making this happen.
Enjoy, and good luck!
Warren.
----------------------------------------------------------------
Just to be clear about "what needs to be distributed", just
be aware that the instructions do not cover GPL and
Berkeley DB licensing compliance issues. License
compliance is your responsibility, and is not
covered by the instructions.
Warren.
----------------------------------------------------------------
Subject: Help in compiling code.
Specify multiple -I options -
cobc -std=cobol2002 -I $HOME/Cobol/copy -I $HOME/sqllib/copy -L $/usr/local/lib:. -o bin/cntrylst cntrylst.cob
----------------------------------------------------------------
Hi
I was trying to compile my program.
I have the program in the following folder structuer
$HOME/Cobol/src -- All source folder
$HOME/Cobol/copy -- All copy books involved.
$HOME/Cobol/bin -- Place any shell programs, and final output
$HOME/Cobol/obj -- Any object files at the time of compilation.
$HOME/sqllib/copy linked to /opt/ibm/db2/V9.1/include/cobol_mf
I am trying to compile using the following command.
cobc -std=cobol2002 -I $HOME/Cobol/copy:$HOME/sqllib/copy -L $/usr/local/lib:. -o bin/cntrylst cntrylst.cob
I am getting the error as :
cntrylst.cob:14: Error: sqlca: No such file or directory
cntrylst.cob:17: Error: country: No such file or directory
I tried giving the complete path instead of $HOME.
It is probably taking one path. How to make the compilor search in multiple paths for copybooks at the time of compilation ?
Thanks,
Giri
----------------------------------------------------------------
Subject: XML Support
Hello,
is there any support for XML parsing like that found in MF or IBM Cobol planned?
Best regards
Sönke
----------------------------------------------------------------
Subject: CobCurses Release 0.94 Available for Download
New Features in Release 0.94 :
===================
These are the main new features in this release:
1. COBOL programs can now write spreadsheet formatted
text files (*.CSV), in addition to being able to
read them.
2. Support of COMP-1/COMP-2 types, with scientific (exponential)
notation support. Additionally unit support and
engineering exponent support is included.
3. Read-only field support is now supported by the
sdesign screens, and by the code generator.
4. Changes were implemented to make CobCurses operate
in a MinGW environment.
The following describes the features/changes in more detail:
* ADDITIONAL SPREADSHEET SUPPORT :
- Create *.CSV spreadsheet records using API routines
NC-EMIT-CSV-HEADINGS and NC-EMIT-CSV-RECORD.
* SUPPORT FOR SCIENTIFIC INPUT / OUTPUT
- Convert COMP-2 (or COMP-1) values to displayable text in
scientific (exponential) notation using new routine
COBCURSES-SCI-NOTATION-COMP-2/COMP-1.
- C programmer's ecvt(3) routine is also now available to
COBOL programs using COBCURSES-ECVT-COMP-2/1.
- Possibly scientific notation text can be converted to a
COBOL COMP-2/COMP-1 value using the new routines
COBCURSES-EDIT-COMP-2/COMP-1. Input can optionally include
"unit designations" to adjust the exponent (example the
input ".002uf" can be interpreted automatically as
"microfarads", rather than the base unit of "Farads").
- Routines COBCURSES-FORMAT-COMP-2/1, can be used to
"format" scientific values (optionally with unit
designations).
- The screen designer allows you to specify fields that
accept "scientific/exponential" input values.
- The screen designer now allows you to define and test
"unit specifications" (such as "Farads" for capacitance).
(This is done in the character set screen).
- Fields that are designated as using COMP-2 (or COMP-1)
automatically have the value populated in their
CMP-* field (in addition to the text in FLD-*).
* READ-ONLY FIELD SUPPORT
- The Screen Designer now properly implements "read-only"
fields, used for display purposes only. It is no longer
required to cheat with added code -- this is now fully
automated by the code-generator.
* MINGW ENHANCEMENTS
- CobCurses can now be compiled and used in a MinGW compiled
form, allowing native Windows use.
- The script init-cobcurses was replaced by the executable
init-cobc, for use in a MINGW environment.
- The script sdgenerate is now an executable to allow use in
the MINGW environment.
- A guide to installing Open-Cobol in a MinGW environment is
provided here:
http://cobcurses.wiki.sourceforge.net/MinGW+Open-Cobol+Install
For a more detailed list of changes, visit the wiki at:
=========================================
http://cobcurses.wiki.sourceforge.net/ChangeLog+Release+0.94
You can download the release from here:
http://sourceforge.net/project/showfiles.php?group_id=186285
=========================================
CobCurses is a software package that allows a COBOL
program to use a "screen designer" to generate programs
that uses "curses". This permits Open-Cobol programs
to interact with the user through a screen interface.
A more complete description can be found here, including
all documentation:
http://cobcurses.wiki.sourceforge.net/
Enjoy,
Warren.
----------------------------------------------------------------
Subject: open cobol and Ubuntu
I am using opencobol with Ubuntu (Gutsy Gibbon) and i'm having two problems.
1) The first problem wasn't in Feisty Fawn, when compiling something i get this error message in the terminal:
/usr/bin/ld: cannot find -lncurses
collect2: ld gaf exit-status 1 terug
2) The second issue is that I could compile and run programs but i can't read input the way i could in Windows.
for example:
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. PERSONS.
AUTHOR. Dirk.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. PC.
OBJECT-COMPUTER. PC.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 PERSONS.
03 NAME PIC X(30).
01 scherm-1.
03 lijn-109 pic X(80) value "Naam: ".
PROCEDURE DIVISION.
MAINPROG.
PERFORM PRINT-SCREEN
PERFORM READ-SCREEN
STOP RUN
.
PRINT-SCREEN.
display scherm-1 line 09 column 01
.
READ-SCREEN.
accept NAME line 09 column 07
.
[/code]
so the name should be read at line 9 column 7 but, after the 'label' name but instead it reads at the bottom of my terminal window
any solutions??
----------------------------------------------------------------
Hi Dirken,
First can be solved by 'su ldconfig' and editing /etc/ld.so.conf, adding the path where ncourses.so is on your system (may be /usr/local/lib). Take a look to the README file.
Second question: I think line and column aren't from cobol85 standards, so, you must take a look to the cobcourses instead, a library for the screen section. Search in this forum. It's no so far. I wish also have a 'display spaces erase'
:-D
----------------------------------------------------------------
yeah i'm missing also the 'display spaces upon crt' statement from cobol in windows
----------------------------------------------------------------
well successfully installed cobcurses but that's about everything new i can say.
i tried to compile a program called test.cob and where i used to get a file 'test' in feisty that i could execute with the command ./test i'm now getting a file 'test.so' that i can't execute with the commando ./test.so AND 'cobcrun test.so'.
with the latest command using cobcrun i'm always getting the message:
libcob: Cannot find module 'test.so'
what do i have to do now???
----------------------------------------------------------------
You should use `cobc -x foo.cob` and then you can `./foo`.
Hope that helps.
----------------------------------------------------------------
thx a lot, it did help!!
----------------------------------------------------------------
This helped me get rid of the first problem:
sudo apt-get install libncurses5-dev
Hope this helps.
----------------------------------------------------------------
Subject: Mac OSX: OpenCOBOL + MacPorts
Hi
I'm currently trying to get OpenCOBOL working on Mac OSX.
I installed gmp & db3 via Macports.
Because Macports installs these packages in /opt/local, I had to set the environment variable LDFLAGS to "-L/opt/local/lib" and CPPFLAGS to "-I/opt/local/include".
The installation succeeded, but when I try to compile a cobol source file, I get the following error:
$ cobc Personeel.cbl
i686-apple-darwin8-gcc-4.0.1: unrecognized option '-R/opt/local/lib'
Is there a way to fix this?
----------------------------------------------------------------
Add a -v option to your command line, so that the compiler
will report what is happening at each step of the way. That
won't solve your problem, but it may help point to a
solution.
Warren.
----------------------------------------------------------------
$ cobc -v Personeel.cbl
preprocessing Personeel.cbl into /tmp/cob15560_0.cob
translating /tmp/cob15560_0.cob into /tmp/cob15560_0.c
gcc -pipe -I/opt/local/include -I/opt/local/include -O2 -Wno-unused -fsigned-char -Wno-pointer-sign -bundle -flat_namespace -undefined suppress -L/opt/local/lib -fno-common -DPIC -o Personeel.dylib /tmp/cob15560_0.c -L/opt/local/lib -L/opt/local/lib -lcob -lm -lgmp -L/opt/local/lib -lintl -L/opt/local/lib -liconv -lc -R/opt/local/lib -lncurses -ldb
i686-apple-darwin8-gcc-4.0.1: unrecognized option '-R/opt/local/lib'
You should be able to modify the compiler flags cobc is using somewhere...
----------------------------------------------------------------
The module you'll want to look at is ./cobc/cobc.c, somewhere around line 1295. If you look at my instructions for 64-bit HPUX OC here:
http://cobcurses.wiki.sourceforge.net/Installing-OC-on-HPUX
you can see how a linker option was added for HP.
In your case you want to find the -R option and replace it
with something suitable. Good luck.
Warren.
----------------------------------------------------------------
I found the -R option in the Makefiles, seems like ./configure detects it:
COBC_LIBS -L/opt/local/lib -lintl -L/opt/local/lib -liconv -lc -R/opt/local/lib
COB_LIBS -L/opt/local/lib -L${exec_prefix}/lib -lcob -lm -lgmp -Lopt/local/lib -lintl -L/opt/local/lib -liconv -lc -R/opt/local/lib -lncurses -ldb
So I replaced most -R's in the configure file with -L.
Now my 'make check' output looks a lot better, but there are still some failures:
Test 1: All 74 tests were successful.
Test 2:
33: EXTERNAL data item FAILED (misc.at:113)
34: EXTERNAL AS data item FAILED (misc.at:154)
35: cobcrun validation FAILED (misc.at:194)
ERROR: All 157 tests were run,
3 failed unexpectedly.
Test 3:
33: EXTERNAL data item FAILED (misc.at:113)
34: EXTERNAL AS data item FAILED (misc.at:154)
35: cobcrun validation FAILED (misc.at:194)
ERROR: All 157 tests were run,
3 failed unexpectedly.
Test 4: All 16 tests were successful.
Test 5: All 16 tests were successful.
======================================================
2 of 5 tests failed
Please report to open-cobol-list@lists.sourceforge.net
======================================================
----------------------------------------------------------------
If you have time to kill, you might try looking at the
individual (or summarized) test logs that are generated.
Sometimes the tests fail because of a missing or
failed command that used for the test.
If so, you could try the test manually (possibly),
or just dismiss the failure as a "bad test".
Otherwise, perhaps Roger or Sergey will be able to help
you further. Roger usually responds here, but he must
be up to his neck in something at the moment. ;-)
Warren.
----------------------------------------------------------------
Thanks for the help.
I'll check the logs later since compilation of cobol files seems to work. 8-)
----------------------------------------------------------------
Subject: perform until and clear screen issue
i wrote a little program (don't ask why i did it, it's just for school) where you can enter the details of emplyees and as long as you enter a name. When you leave the name blank and press enter the program should move on to something else.
In windows it all works fine so i'm sure it has to work but maybe the syntax with opencobol is a little different.
this is how i did it:
[code]
perform read-name until name = SPACES
[/code]
why isn't that working?
Also i'm using 'display spaces upon crt' to clear the screen and start putting my new text in a new window but the clearing thing doesn't neither.
Solution???
----------------------------------------------------------------
I think you'll need to post more of the program
for a definitive answer. At this point, I think
the problem is that you are using screen features
that OpenCobol does not support.
You will need to modify your program to use simple
ACCEPT and DISPLAY verbs.
Warren.
----------------------------------------------------------------
Testing in Cobol is done at the beginning of the loop ... think of it as a perform while.
So, to do what you want, you will have to set the field you are accepting to non-space before the loop. Then the performed paragraph will set it to space, and do an accept.
That is a pretty common mistake for Cobol beginners.
IE--
move "Y" to end-flag.
Perform my-routine until end-flag is equal to "Y".
Does not execute "my-routine" at all. Not even once.
Donald
----------------------------------------------------------------
Subject: ./configure problem( Use enhanced Berkeley DB (>= 4.1) no)
HI:
When i run ./confiure. I have a problem.
Below is my log.
--------------
.
.
COB_CFLAGS -I/usr/local/include -O2
COB_EXTRA_FLAGS -march=i686 -mtune=pentium4
LDFLAGS
COB_LDFLAGS
COB_LIBS -L${exec_prefix}/lib -lcob -lm -lgmp -lncurses -ldb-4.5 -ldl
COB_CONFIG_DIR ${prefix}/share/open-cobol/config
COB_LIBRARY_PATH .:${exec_prefix}/lib/open-cobol
COB_MODULE_EXT so
COB_SHARED_OPT -shared
COB_PIC_FLAGS -fPIC -DPIC
COB_EXPORT_DYN -Wl,--export-dynamic
COB_STRIP_CMD strip --strip-unneeded
Dynamic loading System
Use gettext for international messages: yes
Use Berkeley DB for file I/O: yes
Use enhanced Berkeley DB (>= 4.1) no
Use fcntl for file locking: yes
Use ncurses/pdcurses/curses for screen I/O: yes
-------------
how can i make (DB>=4.1)?
----------------------------------------------------------------
First, make sure that you have the BDB "1.85 compatibility interface" available.
In this case it is also possible you did not point the configure script to where the BDB software is (this varies a lot according to platform and how it was installed).
You may need to add a CFLAGS="-I/usr/local/BerkeleyDB/include" (or some path), and a corresponding LDFLAGS="-L/usr/local/BerkeleyDB/lib" (or some path).
Warren.
----------------------------------------------------------------
This is usually caused by by forgetting
to install BOTH BDB packages.
Runtime AND Development.
(See README)
Roger
----------------------------------------------------------------
Fisrt.Thanks all Friends.
Second.
Today i download the db-4.2.52.tar.gz
from http://www.filewatcher.com/m/db-4.2.52.tar.gz.4073147.0.0.html
then installed.
# tar zxvf db-4.2.52.tar.gz
# cd db-4.2.52
# cd build_unix
# ../dist/configure --prefix=/usr/local/BerkeleyDB.4.2
# make
# make install
add /usr/local/BerkeleyDB.4.2/lib to /etc/ld.so.conf
# cat /etc/ld.so.conf
include /etc/ld.so.conf.d/*.conf
/usr/local/BerkeleyDB.4.2/lib
Run ldconfig
#ldconfig
#cd open-cobol-0.33
set CFLAGS&LDFLAGS
#env CFLAGS="-I/usr/local/BerkeleyDB.4.2/include" LDFLAGS="-L/usr/local/BerkeleyDB.4.2/lib"
#./configure --prefix=/usr/local/opencobol
Below is the Error Log
-------------------------------------------
....
checking for iconv declaration...
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for nl_langinfo and CODESET... yes
checking db.h usability... no
checking db.h presence... no
checking for db.h... no
checking db_185.h usability... no
checking db_185.h presence... no
checking for db_185.h... no
checking db3/db_185.h usability... no
checking db3/db_185.h presence... no
checking for db3/db_185.h... no
checking db4/db_185.h usability... no
checking db4/db_185.h presence... no
checking for db4/db_185.h... no
checking db4.1/db_185.h usability... no
checking db4.1/db_185.h presence... no
checking for db4.1/db_185.h... no
checking db4.2/db_185.h usability... no
checking db4.2/db_185.h presence... no
checking for db4.2/db_185.h... no
checking db4.3/db_185.h usability... no
checking db4.3/db_185.h presence... no
checking for db4.3/db_185.h... no
checking db4.4/db_185.h usability... no
checking db4.4/db_185.h presence... no
checking for db4.4/db_185.h... no
checking db4.5/db_185.h usability... no
checking db4.5/db_185.h presence... no
checking for db4.5/db_185.h... no
checking for __db_open in -ldb-4.5... yes
checking for dlopen in -lc... no
checking for dlopen in -ldl... (cached) yes
configure: creating ./config.status
config.status: creating cob-config
config.status: creating Makefile
config.status: creating lib/Makefile
config.status: creating libcob/Makefile
config.status: creating cobc/Makefile
config.status: creating bin/Makefile
config.status: creating po/Makefile.in
config.status: creating texi/Makefile
config.status: creating config/Makefile
config.status: creating tests/atlocal
config.status: creating tests/Makefile
config.status: creating tests/cobol85/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing tests/atconfig commands
config.status: executing depfiles commands
config.status: executing default-1 commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
OpenCOBOL Configuration:
CC gcc
COB_CC gcc
CFLAGS -O2 -march=i686 -mtune=pentium4 -finline-functions -fomit-frame-pointer -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k
COB_CFLAGS -I/usr/local/opencobol/include -O2
COB_EXTRA_FLAGS -march=i686 -mtune=pentium4
LDFLAGS
COB_LDFLAGS
COB_LIBS -L${exec_prefix}/lib -lcob -lm -lgmp -lncurses -ldb-4.5 -ldl
COB_CONFIG_DIR ${prefix}/share/open-cobol/config
COB_LIBRARY_PATH .:${exec_prefix}/lib/open-cobol
COB_MODULE_EXT so
COB_SHARED_OPT -shared
COB_PIC_FLAGS -fPIC -DPIC
COB_EXPORT_DYN -Wl,--export-dynamic
COB_STRIP_CMD strip --strip-unneeded
Dynamic loading System
Use gettext for international messages: yes
Use Berkeley DB for file I/O: yes
Use enhanced Berkeley DB (>= 4.1) no
Use fcntl for file locking: yes
Use ncurses/pdcurses/curses for screen I/O: yes
------------------------------------------------------
why i can't install opencobol??
----------------------------------------------------------------
Because your BDB is screwed up.
Notice -
checking for __db_open in -ldb-4.5... yes
So, you have a library from 4.5 BUT you
do not have any header files.
This means that your system has the RUNTIME
BDB 4.5 but NOT the DEVELOPMENT BDB 4.5.
Assuming this is Linux, (looks like it is),
the install the packages from the distro.
This is all in the README.
Roger
----------------------------------------------------------------
Thanks simrw and Thanks god :-)
open-cobol-0.33 is installed ok
[quote]This means that your system has the RUNTIME
BDB 4.5 but NOT the DEVELOPMENT BDB 4.5.[/quote]
then I install Berkeley v4.4 Database Libraries [runtime]
and Berkeley v4.4 Database Libraries [development]
#./confiure
#make
#make install
install ok
:-) :-)
----------------------------------------------------------------
Of course, now that you have read the
fine README ;-) , you did do a
"make check" ;-)
Roger
----------------------------------------------------------------
[quote]now that you have read the
fine README ;-) , you did do a
"make check" ;-)[/quote]
Next install i will Try :)
----------------------------------------------------------------
You can do this anytime after the "make"
or "make install".
As per README, it is recommended that you
do this to check basic functionality.
Roger
----------------------------------------------------------------
Subject: wrong warning message: with level 78 named constant
It's possible to use level 78 items as an integer (no problem with MF/ACU/OC). But there is a very misleading message "Warning: Alphanumeric value is expected" if placing the 78 item within another item.
This results in a misleading message:
[code] 01 filler. * level 78 constant is an integer
78 myconst value 130.
03 myvars.
05 my firstvar pic X(01) occurs myconst.[/code]
This is possible and right:
[code] * level 78 constant is an integer
78 myconst value 130.
01 filler.
03 myvars.
05 my firstvar pic X(01) occurs myconst.[/code]
Maybe it's possible to have a message like "Error: Items with level 77 or 78 are not allowed to be placed within another group"
----------------------------------------------------------------
Yes, misleading message AND generates wrong code.
Fixed in current 0.33.
In fact the message should be
"Level number must begin with 01 or 77" and
point to the line with "myvars"
A 01, 77 or 78 level terminates any previous group.
Roger
----------------------------------------------------------------
Subject: Compiling open cobol 0.33
[code]make[2]: Entering directory `/home/user/open-cobol-0.33/libcob'
/bin/sh ../libtool --tag=CC --mode=link gcc -DSUPER_OPTIMIZE -O2 -march=i686 -mcpu=pentium4 -finline-functions -fomit-frame-pointer -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -Wl,--export-dynamic -o libcob.la -rpath /usr/local/lib -version-info 1:0:0 -no-undefined libcob_la-common.lo libcob_la-move.lo libcob_la-numeric.lo libcob_la-intrinsic.lo libcob_la-termio.lo libcob_la-fileio.lo libcob_la-screenio.lo libcob_la-strings.lo libcob_la-call.lo -lm -lgmp -lncurses -ldb-4.6 -ldl
gcc -shared .libs/libcob_la-common.o .libs/libcob_la-move.o .libs/libcob_la-numeric.o .libs/libcob_la-intrinsic.o .libs/libcob_la-termio.o .libs/libcob_la-fileio.o .libs/libcob_la-screenio.o .libs/libcob_la-strings.o .libs/libcob_la-call.o -lm /usr/local/lib/libgmp.so -lncurses -ldb-4.6 -ldl -march=i686 -mcpu=pentium4 -Wl,--export-dynamic -Wl,-soname -Wl,libcob.so.1 -o .libs/libcob.so.1.0.0
/usr/lib/gcc-lib/i586-suse-linux/3.3.5/../../../../i586-suse-linux/bin/ld: cannot find -ldb-4.6
collect2: ld returned 1 exit status
make[2]: *** [libcob.la] Error 1
make[2]: Leaving directory `/home/user/open-cobol-0.33/libcob'
make[1]: *** [all-recursive] Error 1[/code]
db 4.6 installed
----------------------------------------------------------------
From where/to where was BDB 4.6 installed ?
I am not aware that Suse has any 4.6 rpm's.
As stated in the README, use distro packages
when available.
As you are on Suse, install the 4.x (latest)
from the distro. (Runtime and Development)
(Depending on Suse release, these will be 4.1, 4.2, 4.3,
4.4 or 4.5, whichever is the latest)
Roger
----------------------------------------------------------------
I've installed it from oracle sources.
http://www.oracle.com/technology/software/products/berkeley-db/index.html
----------------------------------------------------------------
Well undo anything you tried to do with 4.6 and
install the Suse packages eg.
db-4.3.27-3
db-devel-4.3.27-3
or whatever is available for your Suse release.
(Yast->software install ->search ->berkeley)
(Choose the latest from multiple db's)
Roger
----------------------------------------------------------------
Subject: Acting OC as CGI - Part II
Some weeks ago I posted a request about CGI. As usual Roger gave me tips to understand how OC could read from stdin and write upon stdin.
so I wrote some programs you can test.
you have 2 cobol source programs, 1 .cgi and a html file.
See link http://www.hiniger.eu/CGI_OC.tgz
All of these are working on my Debian Etch.
Enjoy
Hello Aeko
Thank You Roger
Bear
----------------------------------------------------------------
Subject: This is my first program with opencobol .Compile ok but Run errer.why?
Below is my test Src
---------------------------------------------------------------------------
001000 IDENTIFICATION DIVISION.
002000 PROGRAM-ID. TESTCOB.
002100 AUTHOR. enjoy.
002200 DATE-WRITTEN. 2007.10.12.
002300 DATE-COMPILED.
002400*
002500 ENVIRONMENT DIVISION.
002600 CONFIGURATION SECTION.
002700 SOURCE-COMPUTER. ibm.
002800 OBJECT-COMPUTER. ibm.
002900*
003000 INPUT-OUTPUT SECTION.
003400*
003500 DATA DIVISION.
004500*
004600 WORKING-STORAGE SECTION.
008700*
009700**** USER-WORK-AREA.
009800 01 WK-DATE.
009900 03 WK-DATE-YY PIC X(04) VALUE SPACE.
010000 03 WK-DATE-MM PIC X(02) VALUE SPACE.
010100 03 WK-DATE-DD PIC X(02) VALUE SPACE.
011900*
012000 PROCEDURE DIVISION.
012100******************************************************************
012200* MAIN-RTN *
012300******************************************************************
012400 MAIN-RTN.
012600 MOVE "20071012" TO WK-DATE.
012700 DISPLAY WK-DATE.
014000 STOP RUN.
-------------------------------------------------------------------------------
# ls -l
total 4
-rw-r--r-- 1 root root 2183 Oct 12 23:35 test.cob
# cobc test.cob
Complie ok
# ls -l
total 12
-rw-r--r-- 1 root root 2183 Oct 12 23:35 test.cob
-rwxr-xr-x 1 root root 7160 Oct 12 23:46 test.so
# ./test.so
Segmentation fault (core dumped)
why?
----------------------------------------------------------------
(For OC 0.33)
The default (when no options supplied)
is to create a loadable module as you
saw (test.so). You can NOT directly
execute this ;-)
You can execute this with the OC driver program -
cobcrun test
Or you can directly compile to an executable -
cobc -x test.cob
./test
cobc --help gives summary options and the defaults.
Roger
----------------------------------------------------------------
I can run my first test program ok :-D
[quote]cobc --help gives summary options and the defaults.[/quote]
This is the guide line. Thanks
----------------------------------------------------------------
In my case, when I used "cobc hello.cob" to compile and used "cobcrun hello" to run the program, It displayed the result successfully.
But when I used "cobc -x hello.cob" to compile and used
"./hello" to run the program, It failed and the error message
as follows.
"./hello: error while loading shared libraries: libcob.so.1: cannot open shared object file: No such file or directory
"
:-o How to resolve this problem ? Thanks .
----------------------------------------------------------------
RTFR :-)
(Read The Fine README)
Roger
----------------------------------------------------------------
Subject: OC 0.33 is now OC 1.0
The decision has been made to make the
next release of OC version 1.0.
The prerelease link is automatically
updated.
It is expected that OC 1.0 will be released
within this month.
Roger
----------------------------------------------------------------
Congratulations !
Thanks for your dedication and work.
----------------------------------------------------------------
I am happy to see that the project is living. So welcome to Release 1.0 !
We need OpenCobol for our personal progress.
Long live to OC !
Thank You Staff
Thank You Roger
Bear :-D
----------------------------------------------------------------
Subject: Embedded SQL and TX-Monitor
Hi,
has anybody ever tried to use embedded SQL with OpenCOBOL and DB2? From skimming the DB2 docs it seems it's as easy as running the DB2 preprocessor, cobol-compile the result and link it to the DB2 libraries.
But in reality?
And what if you use a Transaction monitor like Tuxedo?
Thanks for any hints,
Juergen
----------------------------------------------------------------
The best way to know is to try something small. But if I
were to place a bet, I'd say there'd be complications. Any
SQL front end has to be tailoured for the types of library
calls made by the compiler. But who knows? Try it and see.
I've been meaning to give OpenAMQ a try, but to make it
friendly, its going to need some sort of COBOL binding.
If I ever finish CobCurses to a reasonable point, I plan
on having a go at that.
Warren.
---
http://cobcurses.wiki.sourceforge.net
----------------------------------------------------------------
I tried using Oracle and UDB. It seems to work.
internal data representation of opencobol is "cobol compliant", therefore the precompiler manages data types correctly.
As far as I know, the only TXmonitor supporting opencobol is XCICS (XFRAME).
Rgds
----------------------------------------------------------------
Subject: OC 1.0 compiling error ??
Hello !
This program ran at least 35 times under 0.33. I turned to 'free' source and copybooks, and I have an error :
crecli.cbl:17: Error: 'wtx-st' undefined
identification division.
program-id. crecli.
author. bear.
date-written. Aou-07.
*
* Programme de test pour OpenCobol 1.0 avec indexation fichiers reels
*
environment division.
configuration section.
source-computer. dell.
object-computer. dell.
input-output section.
file-control.
select TX assign to wtx-id
organization is line sequential
access mode is sequential
file status is wtx-st.
copy "OCCLI.DYN".
data division.
file section.
fd TX label record is standard
data record is txxx.
01 txxx.
02 filler pic X(2048).
copy "OCCLI.CPY".
working-storage section.
77 wtx-id pic X(060).
77 wtx-st pic X(002).
77 wtx-aig pic S9.
77 wtx-Lus pic 9(06).
copy "OCCLI.WRK".
77 intro pic X.
procedure division.
initiale section.
debut.
display "OpenCobol 1.0" line 1 column 1
end-display
display "CLIENTS" line 1 column 30.
move "CLIENTS.txt" to wtx-id.
open input TX
move "CLIENTS" to wcl-id
open output CL.
move -1 to wtx-aig
perform until wtx-aig > 0
read TX no lock
at end
move 1 to wtx-aig
not at end
add 1 to wtx-lus
if txxx = spaces
continue
else
if wtx-aig = -1
move 0 to wtx-aig
else
initialize cl20
unstring txxx delimited by "|" into
cl20-NuCli
cl20-MoDir
cl20-NmCli
cl20-NuTel
cl20-NuFax
cl20-NuMob
cl20-AdCl1
cl20-AdCl2
cl20-CdPtl
cl20-LbVil
cl20-MdRgl
cl20-CnRgl
end-unstring
display cl20-NuCli line 12 column 38
end-display
write clxx
invalid
display "!ErrWriteCLI!"
not invalid
add 1 to wcl-cre
end-write
end-if
end-if
end-read
display wtx-lus
line 15 column 38
end-display
display wcl-cre
line 16 column 38
end-display
end-perform
close CL
close TX
.
terminale section.
fin.
display "C'est fini !" line 24 column 1
accept intro line 24 column 0.
stop run.
----------------------------------------------------------------
Sorry, I can not reproduce this.
Can you post the contents of the COPY files
and also what compile options you used.
You could also post the output adding the "E" option
which will show the complete preprocessed source.
eg.
cobc -xE -std=mf crecli.cbl
Incidentally, comment lines in free format are strictly
speaking defined by using "*>" and not just "*".
Roger
----------------------------------------------------------------
YES! "OCCLI.DYN" was in fixed format with first line commented (* in column 7).
"OCCLI.CPY" is in free format but comments were codified "*" instead of "*>"
compile options {were|are)
cobc -x -free -std=mf -I../Copies crecli.cbl
Corrections done, everything works great !!!
So I will look at my source programs & Copybooks and change all commented lines so I won't mix free & fixed formats ...
Just 2 words : THANK YOU
----------------------------------------------------------------
OK.
Even if you are coding fixed format,you should
get used to using "*>" for comments with the
asterisk in column 7 and columns 1 to 6 spaces.
You have to be careful when using free format
on progs that were originally fixed format; here's
an example (assume MYFLD1, MYFLD2 are somewhere defined)
(posting mangles spaces so I have replaced spaces with
periods) -
...........COMPUTE somefield =
...............................MYFLD1
......*........................MYFLD2
So originally we were using MYFLD2 but then replaced
it with MYFLD1 and commented out the original line
BUT in free format that is no longer a comment and
becomes part of the COMPUTE!!!
ie. COMPUTE somefield = MYFLD1 * MYFLD2
There are other pitfalls like the continuation
character ("-") or other indicators that maybe
allowed in column 7.
Roger
----------------------------------------------------------------
Sure !
And what about using "SECTION" instead of paragraphs. I coded long time ago with SECTION (because they could be in overlay), but these were tips of the past due of small memory ...
example :
sort WW ascending key key-1
........descending key key-2
........input procedure is ENTREE
........output procedure is SORTIE
.
.
ENTREE SECTION.
D-ENTREE.
.
.
F-ENTREE.
....EXIT.
SORTIE SECTION.
D-SORTIE.
.
.
F-SORTIE.
....EXIT.
Bear
DECLARATIVES makes use of "SECTION" necessary ...
----------------------------------------------------------------
Not sure what you are asking here.
Sure if you want to use sections, why not.
Some more clarification about the free format
comment indicator "*>".
This can appear anywhere on a line and anything
after it will be ignored. (So-called floating comment)
So -
ADD 1 TO FLD *> ADD 1 TO FLD2
on one line would mean that the second add is a comment.
Also note that fixed format cobol line syntax is restricted
to columns 8(or 12) to 71 inclusive whilst
free format is 1 to 255 inclusive.
So while you can program a fixed format prog to
compile with free format (taking care about the
indicator column), it is not generally possible
to do the reverse (because then you would anyway end up coding it as fixed)
Roger
----------------------------------------------------------------
Subject: goback
goback does not seem to work properly. It's supposed to do "exit program" if running as a subprogram and "stop run" if running as a main program, but instead it always does "exit program". So it turns out, if you use "goback" in a main program, the "goback" is ignored, and instead of ending the program it "falls through" to the next statement, causing very weird results!
Should I report this as a bug?
----------------------------------------------------------------
Sounds like you're using an older version of the compiler. I doubt you'll experience that on the current one (now version 1.0).
Warren.
----------------------------------------------------------------
I got it from the latest Ubuntu repository. How do I check what version it is?
----------------------------------------------------------------
$ cobc -V
cobc (OpenCOBOL) 0.33.0
Copyright (C) 2001-2007 Keisuke Nishida
Copyright (C) 2007 Roger While
----------------------------------------------------------------
Then do an update (just install over your existing version). You find all the necessary information in "Install Guide" (you can see in navigation on the left side), in README and INSTALL from the download package you need anyway.
After updating the version it should say
[quote]cobc (OpenCOBOL) 1.0.0
Copyright (C) 2001-2007 Keisuke Nishida
Copyright (C) 2007 Roger While[/quote] when doing [code]$ cobc -V[/code]
----------------------------------------------------------------
Actually I would hope we see -
cobc (OpenCOBOL) 1.0.0
;-)
Roger
----------------------------------------------------------------
This version 0.33 for sure. You have already figured this out based on later posts.
I recommend the following:
1. Download the latest OC tar: open-cobol-1.0.tar.gz
2. Place the file in the appropriate directory like: /usr/local/src
3. Open the terminal application (Applications...Accessories...Terminal)
4. cd /usr/local/src
5. sudo tar -xzf open-cobol-1.0.tar.gz
6. cd open-cobol-1.0
7. Read the INSTALL text file.
8. sudo ./configure
9. sudo ./make
10. sudo ./make check
11. sudo ./ make install
12. sudo ./ make clean
13. sudo apt-get remove open-cobol
You might have to install gcc and autoconf to get it to compile(among other things)....
8-)
----------------------------------------------------------------
How many 0.33 releases were there Roger? I could be wrong,
but GOBACK did seem to work for some of them. 8-)
Warren.
----------------------------------------------------------------
There was not ever and will not be a
0.33 release :-)
From cobc/ChangeLog -
2007-06-16 Roger While
* tree.h, parser.y, typeck.c, codegen.c : Fix subtle difference
between GOBACK and EXIT PROGRAM
Roger
----------------------------------------------------------------
I'll have to check, but I think it has
been recorded somewhere in my logs! ;-)
Warren.
----------------------------------------------------------------
Subject: POINTER in OpenCobol 1.0
It seems that pointers have an internal length of 4 Byte as it is with Microfocus, [quote]The default amount of storage allocated for the POINTER format may vary depending on the operating environment but is at least four bytes. The method of representation of the memory address varies between environments and is in general consistent with the representation used in non-COBOL languages.[/quote]
Is is possible to have a defined length (8 Byte) whichever environment is used?
----------------------------------------------------------------
Pointers have an internal length depending
on the operating environment.
If 32 bit, you get 4 byte pointers.
If 64 bit, you get 8 byte pointers.
Roger
----------------------------------------------------------------
So if one want to be sure that there are ALWAYS 8 Byte reserved (for example you have a pointer in a file structure and don't know if you need to change the machine some day or communicate between different machine types), this is what you need
[code] 01 mystructrure.
05 [some stuff before the pointervar...]
05 mypointerplace pic 9 (08).
05 mypointer redefines mypointerplace pointer
05 [some stuff behind the pointervar...][/code]
----------------------------------------------------------------
NO, NO and again NO!
A pointer (aka address) is only meaningful
within the currently executing process!
Re-execute the program and you will almost certainly
get another value for the pointer.
Anything that is machine/execution specific
should never be made available in a file
or anything else.
Another example is having COMP-5 fields
in file records. These depend on the endianness
of the machine.
Roger
----------------------------------------------------------------
Why would you care about the POINTER size? As Roger
has indicated, you don't want to save them in files,
nor communicate them over a socket.
Addresses have very local "value". They can't be
usefully shared with other platforms, and even for
similar platforms, what value would this address have?
If you are interfacing to other language(s), they too
will already know the local host's POINTER size.
Maybe you can describe WHY you need a fixed size for
POINTER.
The only scenario I can imagine this being important
is for the design of a remote debugging/trace utility.
But then you'd have bigger issues than this one.
Warren.
----------------------------------------------------------------
The smallest example I could imagine:
There are two programs using this structure
01 mystructure.
05 firstvar pic x.
...lets say something about 200 vars
05 mypointerplace pic 9 (08).
05 mypointer redefines mypointerplace pointer
...lets say something about 200 vars
05 lastvar pic x.
Program A runs on a 32bit-machine, program B runs on a 64bit-platform.
They are communicating via network [program B does not use the pointer of program A but most of the other vars] and because this structure is big you would not want to have to define a new structure just for the transmitting.
Is this reasonable in some way?
----------------------------------------------------------------
My question is why is the pointer in the struct
if only program A uses it? Why transmit it at all?
If you must keep a pointer in the struct, then
I would suggest that you put all pointers at the end of the
struct, so that nothing (in prog B) is affected by its size.
Otherwise, reserving a max size and redefining is the
only choice you have AFAIK. Of course, some day you'll
be revisiting the code again when we go to 128bit
hardware. Also be careful if you are using alignment
clauses like SYNCHRONIZED, as they may add some
additional byte padding.
Warren.
----------------------------------------------------------------
Yes, agree with previous post.
It's ridiculous to pass pointers externally.
It has no meaning.
To repeat, a POINTER is
4 bytes on 32 bit OS
(or is compiled for 32 bit
on a 64 bit system)
or it is 8 bytes.
Note that this means that
(compatible to MF) that CALL params
and POINTERS maybe 4 or 8 byte pointers.
Roger
----------------------------------------------------------------
Subject: vbisam
Roger(simrw),
I was wondering if the link between vbisam-2.0 and OpenCOBOL ever happened.
I am working on extracting some data from some MF ISAM files. I have been searching for a way to do this via available open source software.
I am also working on compiling some MF COBOL source code with the OpenCOBOL compiler. My first attempt failed. The compiler reports a syntax error on line 17 of the first COPY book.
The line is the 17th line of comments of the following variety:
XXX001* mm-dd-yy comment begins....
I am compiling with the following command:
cobc -x -std=mf -free -I /usr/local/src/copy progname
----------------------------------------------------------------
To answer the last point first -
XXX001* mm-dd-yy comment begins....
That is fixed format but you are trying
to compile with free format.
Re. vbisam.
I do not have time to work on this.
vbisam needs developers.
It is currently not usable by Cobol
due to missing functionality.
Easiest way to transfer data is to
write an unload program on the original
source machine which sequentially reads the
I/S file and writes a fixed sequential file.
Transfer the fixed sequential file to the
target machine. Write a load program that
reads the fixed sequential file and writes
the new I/S file.
Roger
----------------------------------------------------------------
Subject: CobCurses 0.95 Released (with Menu support)
I have suddenly become busy, so I have rushed this
release out to make it available for use. It has been
thoroughly tested under Cygwin and HPUX, and should
compile without incident on Linux. I have not yet
had the time to check for portability issues elsewhere.
The huge improvement here is the menu support and the
ability to support graphics characters in the screen
backgrounds. The notes for the release file are repeated
below for your convenience.
What is CobCurses?
CobCurses is a package designed to allow Open-Cobol
programmers to create screens on open system platforms,
or those (like Windows) that can use PDCurses. Since
handcrafting screens is tedious work, this package
includes a "Screen Designer" utility.
All User Guides and Programmer Guide documentation can
be found on the source forge (see link at bottom).
==== RELEASE NOTES ====
A large number of internal changes were implemented in
this release, but first let's cover the user visible
improvements:
1. MENUS! Popup menus are now supported, and are available
in sdesign with every Action field. In fact, any sdesign
field that is marked with a diamond graphic, has the
ability to popup a menu with F1 (or ^O).
2. To support menus, FUNCTION keys are now available in
Action mode (though CONTROL-O is an alternate way
of opening a menu). This included a new event
callback NC-FKEY-EVENT.
3. GRAPHIC characters in the screen background. It is now
possible using sdesign to draw alternate-charset
graphics in your screen background. See the notes in
the opening help screen for the "Paint" function.
4. TRACE facilities. CobCurses now includes an
environment variable that can enable capturing of
trace information to a file for debugging. A routine
named NC_TRACE_MSG can also be used to add custom
messages to the trace file.
INTERNAL CHANGES:
The main two major internal changes were:
1. The terminal support has been virtualized, so that
the CobCurses routines deal with a "terminal"
object (not curses routines). This will eventually
lead to other possible windowing interfaces like
perhaps graphic X Window or native Windows support.
The other motivation for this was to allow CobCurses
to have one consistent set of constants for colours,
attributes and character sets. Previously, these
values were different depending upon the platform
and implementation of curses used.
2. Menu support has been provided independently of curses.
This is important for portability since PDCurses and
some platforms do not provide a curses menu library.
This also guarantees that CobCurses menus will behave
consistently on all platforms (and overcome menu paging
bugs in ncurses).
PLANNED FOR THE NEXT RELEASE:
Please avoid writing much code that works with colour pairs.
In the next release, it is planned to hide the colour pair
value altogether by using a TDC (Terminal Drawing Context).
This TDC will tie together attributes and colours, and
perhaps other "drawing contexts" so that you won't have to
manage colour pairs (this will be transparent). This will
also pave the way for graphical interfaces where a selected
font and line styles etc. may also be supported.
NOTES:
HPUX users will need to link with ncurses,
instead of the native HPUX curses libraries. I didn't
have time to fully investigate this, but the native
include files define things like MENU and ITEM types
that conflict with the CobCurses defined ones.
====
The release is available for download here:
http://sourceforge.net/projects/cobcurses
----------------------------------------------------------------
Sounds great. Can somebody link some pictures using all the methods cobcurses provides?
The pictures from sourceforge are from January 2007 and the wiki isn't quite up-to-date.
----------------------------------------------------------------
The screen shots and the wiki documentation are still catching
up with the software. Both are NEXT on my list of things
to do. This last release was an enormous amount of work, and
I had hoped to have the documentation completed as part of
the release (0.95).
But I have become suddenly busy and I have to
defer that for the moment. When I get some free time
you will see the wiki documentation catch up with the
new features.
Thanks for your interest,
Warren.
----------------------------------------------------------------
Ok. It only took a few minutes to update the screen
shots (it seems I am only allowed 6 of them). So the
screen shots shown do not cover all of the screens,
but you can see a few that show the menu in operation.
From these you can also see the alt charset graphics
being used.
Warren.
----------------------------------------------------------------
I tried do install CC on a OC1.1/cygwin machine.
All steps before went fine and there is a lot of new stuff in /usr/local/lib, but on
init-cobcurses
the system says "command not found" (I'm at $HOME)
Could not find the file, where should it be?
make at src/tests results in
$ make
sdgenerate TEMPLATE
libcob: Cannot find module 'libcobcursex'
make: *** [TEMPLATE-WS.cbl] Error 1
Something is quite wrong, I think. Could you tell/guess what?
----------------------------------------------------------------
Did you ever get this working?
If not, and so everyone knows ... [i]this is a wicked cool utility. It really highlights that OpenCOBOL can pass muster.[/i]
[quote]I tried do install CC on a OC1.1/cygwin machine.
All steps before went fine and there is a lot of new stuff in /usr/local/lib, but on
init-cobcurses
the system says "command not found" (I'm at $HOME)
Could not find the file, where should it be?
make at src/tests results in
$ make
sdgenerate TEMPLATE
libcob: Cannot find module 'libcobcursex'
make: *** [TEMPLATE-WS.cbl] Error 1
Something is quite wrong, I think. Could you tell/guess what?[/quote]
[i]init-cobcurses[/i] in the wiki docs is wrong for 0.95 it seems. Use [code]init-cobc [-t -][/code] where the option -t creates a TEMPLATE.
For the second part (and before you can init-cobc actually), you will need [code]
$ export COB_LIBRARY_PATH=/usr/local/lib:$COB_LIBRARY_PATH
[/code] before the make.
After those two steps, all went well with the make and running the sdesign program was quite intriguing. Reading through the sources today is what prompted the [i]pass muster[/i] comment above. Well done Warren. (ve3wwg)
I strongly suggest that curious OpenCOBOL developers take a look at the package at http://sourceforge.net/projects/cobcurses/ The amount of OpenCOBOL source code makes for a great intermediate, advanced how-to resource, in my humble opinion.
Roger also showed me use of COB_LIBRARY_PATH and how we should all know of it. Know of it and get used to builds relying on it for 'good practice' modular development.
Cheers,
Brian
----------------------------------------------------------------
Subject: General Test Case Question
I was wondering if there is something similar to cUnit(C) or nUnit(.NET) for writing test cases in COBOL. I realize this list is OpenCOBOL specific but, I was wondering if something like this exists for COBOL(OpenCOBOL would be a bonus!!!).
----------------------------------------------------------------
I did find this comment on unit testing in COBOL in case someone else is researching this.
http://idinews.com/unitTest.html
----------------------------------------------------------------
OC provides a basic series of
tests done with "make check".
These are things that are outside of the
normal ANSI85 tests which can be performed
by reading the doc.
(Read the README and read tests/cobol85/README)
Even gcc has it's own test harness and does not
require such stuff.
Maybe you should post this to the MF(which now
has acquired ACU) :-)
Roger
----------------------------------------------------------------
Subject: How do you combine static and dynamic libs?
Say you want to combine some source and a static library into one executable, that calls a DLL.
For C and Linux, you would do something like
gcc -o myexe myexe.c /my/static/lib.a -lmylib
i.e. you have explicitely name the .a to get lib.a and the linker adds libMylib.so
I tried that with cobc, too. Unfortunately cobc thinks the .a is a cobol source. The only way I got the scenario to work was ar-x-ing the .a and adding all .o to the cobc command line.
Somehow, I feel there should be a better way. Is there? If yes, could you please add it to the Multiple Sources page on the wiki?
Thanks,
Juergen
----------------------------------------------------------------
Subject: i'm going crazy!
hi everybody,
i've installed open-cobol on ubuntu...
when i tried to compile this simple test program
[code] * Sample COBOL program
IDENTIFICATION DIVISION.
PROGRAM-ID. hello.
PROCEDURE DIVISION.
DISPLAY "Hello World!".
STOP RUN.[/code]
i got this error output:
[code] cobc hello.cob
hello.cob:1: Warning: Invalid indicator 'm' at column 7
hello.cob:1: Error: syntax error, unexpected WORD, expecting PROGRAM_ID[/code]
can anyone help me!?!? :-?
thanks
----------------------------------------------------------------
1) begin your code from column 1
2) compile with "cobc -free hello.cob"
3) run
----------------------------------------------------------------
now it works!!! :-D
thankyou very much!!! 8-)
----------------------------------------------------------------
Subject: FAQ
Would someone be kind enough to point me to the FAQ please, the link http://www.opencobol.org/modules/xoopsfaq/ (top right of these pages) gives me a blank page.
Regards
John
----------------------------------------------------------------
You're right, same for me - the FAQ is missing. Have a look at the Documentation part on the left, then download the 1.0 prerelease and have a look at the README and INSTALL-Files.
----------------------------------------------------------------
Roger, can you delete the FAQ-Link at top of the page or do even better: have a FAQ there? Thank you!
----------------------------------------------------------------
Subject: CBL_READ_FILE and 0 byte count
I have a program that is not working correctly between MF and OC.
After opening a file using CBL_OPEN_FILE, the program calls CBL_READ_FILE with a File Offset of 0, a Byte Count of 0 and FLAGS of 128. In MF, this returns the length of the file.
The same will occur in OC, but only if the Byte Count is greater than 0. Looking in fileio.c, I believe that if a Byte Count of 0 is used, the rc from the read is 0, which in turns caused 10 to be returned (EOF).
If the byte count is 0 and flags is 128, can the EOF check be bypassed?
----------------------------------------------------------------
Yes, seems reasonable.
I did this -
long long off;
int fd;
int len;
int rc = 0;
struct stat st;
memcpy (&fd, file_handle, 4);
memcpy (&off, file_offset, 8);
memcpy (&len, file_len, 4);
#ifndef WORDS_BIGENDIAN
off = COB_BSWAP_64 (off);
len = COB_BSWAP_32 (len);
#endif
if (lseek (fd, (off_t)off, SEEK_SET) < 0) {
return -1;
}
if (len > 0) {
rc = read (fd, buf, len);
if (rc < 0) {
rc = -1;
} else if (rc == 0) {
rc = 10;
} else {
rc = 0;
}
}
if ((*flags & 0x80) != 0) {
if (fstat (fd, &st) < 0) {
return -1;
}
off = st.st_size;
#ifndef WORDS_BIGENDIAN
off = COB_BSWAP_64 (off);
#endif
memcpy (file_offset, &off, 8);
}
return rc;
}
Look OK. ?
Roger
----------------------------------------------------------------
Roger,
I think I followed the change (all the indents were removed).
I believe that it is only do the read if the len is greater than 0.
Should the seek before it be included inside the IF check? If no read is being done, should a seek occur?
Cris
----------------------------------------------------------------
I do not know. The doc is not very clear
about this.
Excerpt -
-------------------
On Entry:
file-handle The file handle returned when the file was opened.
file-offset The offset in the file at which to read. This field is currently limited to a maximum value of x"00FFFFFFFF".
byte-count The number of bytes to read.
flags This parameter can take the following values: 0 Standard read
128 Return the current file size in file-offset
On Exit:
file-offset Contains the current file size on return if flags is set to 128 on entry.
buffer The buffer into which the bytes are read. It is your responsibility to ensure that the buffer is large enough to hold the number of bytes to be read.
Comments:
The success of the call can be checked by examining RETURN-CODE.
When using this routine to read a file that is contained in a .lbr file, the end-of-file status is not returned. To ensure you only read the file you want, obtain the size of the file first (set flags to 128), and only read up to that size.
--------------------
Nowhere is stated anything about len <= 0
or that offset is dependent on len.
Also nothing is stated about parameter interpretation
when flags == 128.
Hmmm.
I guess it's a case of setting up a test case
and trying it under various MF/ACU releases.
It might make sense to move the seek to within the if;
however, it also may make sense to leave it as is
so that the read effectively becomes a positioning
statement.
Roger
----------------------------------------------------------------
Roger,
I'm mixed on this as well. The question is whether or not it makes sense that someone would use it as a positioning statement. When the file size is request (with flags = 128) the offset is populated with the file size.
I don't think a MF/ACU test would work because the next read would use the offset value to position the file.
So if an offset is sent to position the file with flag 128 request, the next read requires the offset to be set to byte in which to perform the read. I don't know if having the file positioned when gain anything, when the first statement of a read is to position it with the value in OFFSET.
Another question is what is returned for File size if the seek is set to a position other than zero. I'm not familiar enough with C to know that, but a quick test of setting the offset to greater than 0 could provide the answer. I may have to test that real quick in a program.
Cris
----------------------------------------------------------------
Anything more on this?
I am busy on other stuff.
Roger
----------------------------------------------------------------
Sorry, I was having wondering thoughts.
I tried a test with setting the offset to something other than 0 and the correct file length was returned.
So whether or not it repositioned should not matter as long as the repositioning does not affect the returned file length.
Since it does not, there is nothing more that needs to occur.
Cris
----------------------------------------------------------------
OK. Lets look at this as
resoved.
(Although I am not sure here)
Roger
----------------------------------------------------------------
Subject: Used "cobc -x " to compile and met a problem
In my case, when I used "cobc hello.cob" to compile and used "cobcrun hello" to run the program, It displayed the result successfully.
But when I used "cobc -x hello.cob" to compile and used
"./hello" to run the program, It failed and the error message
as follows.
"./hello: error while loading shared libraries: libcob.so.1: cannot open shared object file: No such file or directory
"
:-( How to resolve this problem ? Thanks.
----------------------------------------------------------------
Read the README maybe? :-)
Excerpt from README -
------------------
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 and add /usr/local/lib to the file.
Rerun "ldconfig".
-------------------
Roger
----------------------------------------------------------------
Subject: internal compiler error when compilling my Source [FeistyFAwn]
HEllo im learning Cobol and i have a little project to do for school.
I trying to compile my source but OpenCOBOL 0.32 shows me this error
[quote]Unexpected tree tag 5194305
Aborting compile of COBOL6.cob at line 323
codegen.c:802: internal compiler error
Abandon (core dumped)[/quote]
Im on ubuntu 7.04 Feisty Fawn.
thank you for your help
It is quite urgent !!
I post here my source code
[code] IDENTIFICATION DIVISION.
PROGRAM-ID. FACTEL07.
AUTHOR. CODJOVI.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. AS400.
OBJECT-COMPUTER. AS400.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT ABO ASSIGN TO "Abo07.dat".
SELECT TEL ASSIGN TO "AboMaj07.dat".
SELECT ABOMAJ ASSIGN TO "Tel07.dat".
SELECT FACTURE ASSIGN TO "Ano07.dat".
SELECT ANOMALIES ASSIGN TO "Facture07.dat".
DATA DIVISION.
FILE SECTION.
FD ABO
LABEL RECORD STANDARD
RECORD CONTAINS 94 CHARACTERS
DATA RECORD INABO.
01 INABO.
02 NUMABO PIC X(10).
02 INFOABO.
03 NOMABO PIC X(20).
03 ADRABO.
04 RUEABO PIC X(30).
04 CPABO PIC X(05).
04 VILABO PIC X(15).
02 DATEPREVFACT PIC S9(7) COMP-3.
02 MONTANTFACT PIC S9(7)V99 COMP-3.
02 MONTANTPAYE PIC S9(7)V99 COMP-3.
FD ABOMAJ
LABEL RECORD STANDARD
RECORD CONTAINS 94 CHARACTERS
DATA RECORD OUTABOMAJ.
01 OUTABOMAJ PIC X(94).
FD TEL
LABEL RECORD STANDARD
RECORD CONTAINS 53 CHARACTERS
DATA RECORD INTEL.
01 INTEL.
02 DATEAPPEL PIC S9(7) COMP-3.
02 HEUREAPPEL.
03 HHAPPL PIC 9(2).
03 MMAPPL PIC 9(2).
02 NUMTEL PIC X(10).
02 NUMAPPELE PIC 9(13).
02 LOCALISATION PIC X(15).
02 HEUREFIN PIC 9(4).
02 NBUNITES PIC S9(5) COMP-3.
FD ANOMALIES
LABEL RECORD STANDARD
RECORD CONTAINS 50 CHARACTERS
DATA RECORD OUTANOMALIES.
01 OUTANOMALIES.
02 FILLER PIC X(5).
02 ERREUR PIC X(15).
02 FILLER PIC X(5).
02 TELERREUR PIC X(10).
02 FILLER PIC X(5).
02 UNITANOM PIC B(5).
02 FILLER PIC X(5).
FD FACTURE
LABEL RECORD STANDARD
RECORD CONTAINS 132 CHARACTERS
DATA RECORDS ARE FTITRE1 FTITRE2 FNOM
FCOORD FPREVFACT
FMONTANTPAYE FSOLDEREP
INFOCOMM FTITRE3.
01 FTITRE1.
02 FILLER PIC X(05).
02 TITRETEL PIC X(21).
02 NUMTELFAC PIC X(2)BX(2)BX(2)BX(2)BX(2).
02 FILLER PIC X(69).
02 DATEFACTURE.
03 DATEFACTJOUR PIC 9(2).
03 FILLER PIC X.
03 DATEFACTMOIS PIC X(8).
03 FILLER PIC X.
03 DATEFACTANNE PIC 9(4).
03 FILLER PIC X(5).
02 FILLER PIC X(02).
01 FTITRE2.
02 FILLER PIC X(56).
02 TITREFACT PIC X(19).
02 FILLER PIC X(57).
01 FNOM.
02 FILLER PIC X(15).
02 FNOMABO PIC X(20).
02 FILLER PIC X(97).
01 FCOORD.
02 FILLER PIC X(15).
02 FADRESSE PIC X(30).
02 FILLER PIC X(40).
02 FCP PIC X(5).
02 FILLER PIC X(5).
02 FVILLE PIC X(15).
02 FILLER PIC X(22).
01 FPREVFACT.
02 FILLER PIC X(78).
02 TITREPREV PIC X(25).
02 FPREVDATE PIC B(4)9(2)B9(2)B9(2).
02 FILLER PIC X(17).
01 FMONTANTPAYE.
02 FILLER PIC X(78).
02 TITREPREVMONTANT PIC X(25).
02 FPAYEPREV PIC 9(3)B9(3)V99.
02 FILLER PIC X(17).
01 FSOLDEREP.
02 FILLER PIC X(78).
02 TITRESOLDREP PIC X(25).
02 FREPORTE PIC 9(3)B9(3)V99.
02 FILLER PIC X(17).
01 FTITRE3.
02 FILLER PIC X(10).
02 TITREDATEAPPL PIC X(4).
02 FILLER PIC X(10).
02 TITREHEUREAPPL PIC X(9).
02 FILLER PIC X(10).
02 TITRENUM PIC X(6).
02 FILLER PIC X(10).
02 TITRELOCA PIC X(12).
02 FILLER PIC X(10).
02 TITREDUREE PIC X(5).
02 FILLER PIC X(10).
02 TITREPRIXHT PIC X(10).
02 FILLER PIC X(26).
01 INFOCOMM.
02 FILLER PIC X(10).
02 DATECOMM PIC 9(2)B9(2).
02 FILLER PIC X(10).
02 HEUREAPPL.
03 FHHAPPL PIC 9(2).
03 HDOTAPPL PIC X.
03 FMMAPPL PIC 9(2).
02 FILLER PIC X(15).
02 NUMCOMM PIC 9(10).
02 FILLER PIC X(10).
02 LOCALCOMM PIC X(15).
02 FILLER PIC X(10).
02 DUREECOMM.
03 FHHCOMM PIC X(02).
03 HDOTDUREE PIC X.
03 FMMCOMM PIC X(02).
02 FILLER PIC X(10).
02 PRIXHT PIC 9(3)B9(3)V99.
02 FILLER PIC X(15).
WORKING-STORAGE SECTION.
77 PRIXABOHT PIC S99V999 COMP-3 VALUE 13.381.
77 PRIXUNITE PIC S9V999 COMP-3 VALUE 0.028.
77 TVA PIC S9V999 COMP-3 VALUE 0.196.
77 CALCUL PIC S9(7)V99.
77 DUREEAPPEL PIC 9(4).
77 MONTANTAPPEL PIC S9(9)V999.
77 MONTANTTOTALHT PIC S9(9)V99.
77 MONTANTTVA PIC S9(9)V99.
77 CALCTEMPS PIC 9(4) COMP-4.
77 TELCOURANT PIC X(10).
77 LIBNUMTEL PIC X(22) VALUE "NUMERO DE TELEPHONE : ".
77 LIBTITRE2 PIC X(19) VALUE "RELEVE TELEPHONIQUE".
77 LIBFACTUREPREV PIC X(18) VALUE "FACTURE PRECEDENTE".
77 LIBMONTANTPAYE PIC X(12) VALUE "MONTANT PAYE".
77 LIBSOLDEREP PIC X(13) VALUE "SOLDE REPORTE".
77 1HEURE PIC 99 VALUE 60.
77 ANNEE PIC 9(4) VALUE 2000.
01 JOUR.
02 AA PIC 99.
02 MM PIC 99.
02 JJ PIC 99.
01 MOIS.
02 FILLER PIC X(09) VALUE "JANVIER".
02 FILLER PIC X(09) VALUE "FEVRIER".
02 FILLER PIC X(09) VALUE "MARS".
02 FILLER PIC X(09) VALUE "AVRIL".
02 FILLER PIC X(09) VALUE "MAI".
02 FILLER PIC X(09) VALUE "JUIN".
02 FILLER PIC X(09) VALUE "JUILLET".
02 FILLER PIC X(09) VALUE "AOUT".
02 FILLER PIC X(09) VALUE "SEPTEMBRE".
02 FILLER PIC X(09) VALUE "OCTOBRE".
02 FILLER PIC X(09) VALUE "NOVEMBRE".
02 FILLER PIC X(09) VALUE "DECEMBRE".
01 FILLER REDEFINES MOIS.
02 TMOIS PIC X(09) OCCURS 12.
PROCEDURE DIVISION.
PRETRAIT.
ACCEPT JOUR FROM DATE.
ADD JJ TO ANNEE.
DEBUT.
OPEN INPUT ABO.
OPEN INPUT TEL.
OPEN OUTPUT ABOMAJ.
OPEN OUTPUT FACTURE.
OPEN OUTPUT ANOMALIES.
READ ABO AT END MOVE
HIGH-VALUE TO NUMABO
END-READ.
READ TEL AT END MOVE
HIGH-VALUE TO NUMTEL
END-READ.
PERFORM TEST AFTER UNTIL NUMABO = HIGH-VALUE
PERFORM DPDEBUTFACT THRU FPDEBUTFACT
PERFORM TEST AFTER UNTIL NUMTEL NOT = NUMABO
IF NUMABO NOT = NUMTEL
IF NUMABO > NUMTEL
PERFORM DANOM1 THRU FANOM1
ELSE
PERFORM DANOM2 THRU FANOM2
MOVE HIGH-VALUE TO NUMTEL
END-IF
ELSE
PERFORM DMAJFABO THRU FMAJFABO
PERFORM DCORPFACT THRU FCORPFACT
END-IF
IF NUMTEL NOT = HIGH-VALUE
READ TEL AT END
MOVE HIGH-VALUE TO NUMTEL
END-READ
END-IF
END-PERFORM
PERFORM DFINFACT THRU FFINFACT
READ ABO AT END
MOVE HIGH-VALUE TO NUMABO
END-READ
END-PERFORM.
FIN.
CLOSE ABO
TEL
ABOMAJ
FACTURE
ANOMALIES.
STOP RUN.
DANOM1.
EXIT.
FANOM1.
DANOM2.
EXIT.
FANOM2.
DMAJFABO.
EXIT.
FMAJFABO.
DPDEBUTFACT.
TITRE-12.
MOVE " " TO FTITRE1.
MOVE LIBNUMTEL TO TITRETEL.
MOVE NUMABO TO NUMTELFAC.
MOVE JJ TO DATEFACTJOUR.
MOVE ANNEE TO DATEFACTANNE.
MOVE TMOIS(MM) TO DATEFACTMOIS.
WRITE FTITRE1 AFTER 1.
MOVE " " TO FTITRE2.
MOVE LIBTITRE2 TO TITREFACT.
WRITE FTITRE2 AFTER 2.
COORD.
MOVE NOMABO TO FNOMABO.
WRITE FNOM AFTER 3.
MOVE RUEABO TO FADRESSE.
MOVE CPABO TO FCP.
MOVE VILABO TO FVILLE.
WRITE FCOORD AFTER 1.
INFOPREVFACT.
MOVE " " TO FPREVFACT.
MOVE LIBFACTUREPREV TO TITREPREV.
MOVE DATEPREVFACT TO FPREVDATE.
WRITE FPREVFACT AFTER 2.
MOVE " " TO FMONTANTPAYE.
MOVE "MONTANT PAYE" TO TITREPREVMONTANT.
* MOVE MONTANTPAYE TO FPAYEPREV.
WRITE FMONTANTPAYE AFTER 1.
MOVE " " TO FSOLDEREP.
MOVE LIBSOLDEREP TO TITRESOLDREP.
SUBTRACT MONTANTFACT FROM MONTANTPAYE GIVING FREPORTE.
WRITE FSOLDEREP AFTER 1.
TITRE-3.
MOVE " " TO FTITRE3.
MOVE "DATE" TO TITREDATEAPPL.
* MOVE "H DAPPEL" TO TITREHEUREAPPL.
MOVE "NUMERO" TO TITRENUM.
MOVE "LOCALISATION" TO TITRELOCA.
MOVE "DUREE" TO TITREDUREE.
MOVE "MONTANT HT" TO TITREPRIXHT.
WRITE FTITRE3 AFTER 2.
EXIT.
FPDEBUTFACT.
DCORPFACT.
MOVE HHAPPL TO FHHAPPL.
MOVE MMAPPL TO FMMAPPL.
MOVE ":" TO HDOTAPPL HDOTAPPL.
MOVE DATEAPPEL TO DATECOMM.
MOVE NUMTEL TO NUMCOMM.
MOVE LOCALISATION TO LOCALCOMM.
DIVIDE NBUNITES BY 1HEURE GIVING CALCTEMPS ROUNDED.
MOVE CALCTEMPS TO FHHCOMM.
MULTIPLY CALCTEMPS BY 1HEURE.
SUBTRACT CALCTEMPS FROM NBUNITES.
MOVE CALCTEMPS TO FMMCOMM.
MULTIPLY NBUNITES BY PRIXUNITE GIVING PRIXHT.
EXIT.
FCORPFACT.
DFINFACT.
EXIT.
FFINFACT.
END PROGRAM FACTEL07. [/code]
----------------------------------------------------------------
Please use OpenCOBOL 1.0.
Works fine with 1.0.
Roger
----------------------------------------------------------------
I'm using Ubuntu 7.10 (Gutsy) and your source compiled fine apart from this section:
[code]
READ TEL AT END MOVE
HIGH-VALUE TO NUMTEL
END-READ.
PERFORM TEST AFTER UNTIL NUMABO = HIGH-VALUE
[/code]
which failed because it started in column 7 - shifting the text solved that.
Type 'cobc -V' - what version are you using? The version packaged with Ubuntu 7.10 is '0.33.0'.
What are you using to edit the code?
----------------------------------------------------------------
And who is doing the packaging?
There is no 0.33 !!
This is probably a one-off situation.
When 1.0 is released there will be automatically
a development 1.1.
However, The 0.33 was always a private
download and that somebody made a rpm/deb
from that defies my comprehension.
Maybe they can look at the 1.0 now.
Maybe somebody should get in contact.
Roger
----------------------------------------------------------------
According to the package changelog the maintainer is Bart Martens
The last change to the package was in June 2007:
open-cobol (0.33~cvs20070616-1) unstable; urgency=low
* New upstream version from upstream cvs. Closes: #405597.
* debian/README.Debian-source: Added.
* debian/control: Replaced libdb4.3-dev by libdb4.5-dev.
* debian/copyright: Updated.
-- Bart Martens Sat, 16 Jun 2007 16:24:46 +0200
----------------------------------------------------------------
Thank you for this quick response.
It compiles well with OpenCobol 1.0
I have now completed my code and i want to test it.
I have several input files transferred out of an IBM-AS400
I have the same files in 3 different encoding:
EBCDIC, ACSI, ANSI
which one should i use???!!
I tried that way but open Cobol send me an error
[quote]kanux@Kanux-Linux:~/COBOL$ ./COBOLIUT-EXT-M
./COBOLIUT-EXT-M: symbol lookup error: ./COBOLIUT-EXT-M: undefined symbol: cob_save_call_params[/quote]
thank you for your help.
Here my FiLe-Control paragraph
[code] IDENTIFICATION DIVISION.
PROGRAM-ID. FACTEL07.
AUTHOR. CODJOVI.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. AS400.
OBJECT-COMPUTER. AS400.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT ABO ASSIGN TO "AB07_EBCDIC.dat".
SELECT TEL ASSIGN TO "TE07_EBCDIC.dat".
SELECT ABOMAJ ASSIGN TO "Abomaj.dat".
SELECT FACTURE ASSIGN TO "FactMAj.dat".
SELECT ANOMALIES ASSIGN TO "Anom.dat".[/code]
----------------------------------------------------------------
Geez. I am losing count of how many times
I have had to answer this.
RTFR (also known as Read The Fine README) !!
Here is the relevant excerpt -
-----------
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 and add /usr/local/lib to the file.
Rerun "ldconfig".
------------
Roger
----------------------------------------------------------------
All right You should create a F.A.Q section on the website then.
Because it is hard (impossible for a newbie like me) to make a link between this error message and the fact i didn't add "/usr/local/lib" to /etc/ld.so.conf.
Especially when the readme file use words like "may", "possibly" "in some case" and talk about Fedora when im running Ubuntu..
My program is running perfectly, you did a nice job!!
Now I can compile and debug my project at home!!
----------------------------------------------------------------
The error message comes from the dynamic linker
in Linux :-)
ie. It has nothing to do with OC :-)
With regard to "may", etc., I do NOT
(and can not) test on all variants.
The README is, as such, so formulated
to be general for all installations.
Suse, for instance, does search
/usr/local/lib per default.
Roger
----------------------------------------------------------------
Subject: Linux / Firebird / GPRE SQL Precompiler
I've been a mainframe (OS390) Cobol / CICS / DB2 programmer for ten years, but I'm also a keen Linux user and I'm currently tinkering with Open Cobol on my Ubuntu box and was wondering if anyone has had any success with the gpre SQL precompiler that's packaged with Firebird RDBMS? The documentation for gpre says that it can handle Cobol source, but does this mean it will work with Open Cobol?
I'm just trying to save a little time - I've never used Firebird, so I was trying to avoid spending time with it only to find out it's not going to work with Open Cobol. I expect the answer will probably be "try it and see".
BTW, is this the only Open Cobol forum or is there a more active place? Seems like this project is barely breathing - I hope I'm wrong about that.
----------------------------------------------------------------
I appear to be talking to myself - oh well :-D
Anyway, the answer is...
...I still dunno.
I've installed firebird and it's utilities - the version of 'gpre' packaged with ubuntu 7.10 will only process C/C++, but looking at the firebird cvs website, 'gpre' can be compiled to process other languages - including cobol.
Hmmm - should I spend time trying to compile a new version of 'gpre'?
Does anyone know if this is likely to work with open cobol?
----------------------------------------------------------------
Yea it looks like they took it out of gpre for 1.5.x and higher. Get firebird 1.0.x, it has cobol support in it... not sure if ANSI or COB will work, you will just have to try it...the client that you make with it though should be able to connect to newer servers in dialect 1 and 3 just fine:
C extended C program
CXX extended C++ program
CPLUSPLUS extended C++ program
COB extended COBOL program
ANSI generate ANSI85 compatible COBOL
----------------------------------------------------------------
Okay, some weeks ago, I raised a wish-list request with the Ubuntu package maintainer and as of version 2.0.312981.ds1-15 the firebird packages provide a version of GPRE that will pre-compile your cobol! :)
I've installed Firebird on my Ubuntu box - I got the packages (versions 2.0.4.13130.ds1-2) from the 'Intrepid' repository:
LINK -> [url=http://packages.ubuntu.com/intrepid/firebird2.0-classic]Ubuntu Intrepid - Firebird Classic[/url]
You need firebird2.0-common, firebird2.0-server-common, firebird2.0-classic (or super), libfbembed2 and firebird2.0-dev.
I installed them all manually using GDebi Package Installer.
I haven't yet had a successful compile though...
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. test-db.
DATA DIVISION.
WORKING-STORAGE SECTION.
EXEC SQL
SET DATABASE
test2 = '/var/lib/firebird/2.0/data/test2.fdb'
USER 'SYSDBA' PASSWORD 'phoenix';
.
01 wv-count pic s9(04) usage binary.
PROCEDURE DIVISION.
EXEC SQL
CONNECT test2;
.
exec sql
select count(*)
into :wv-count
from test_table;
.
EXEC SQL
DISCONNECT test2;
.
display wv-count
STOP RUN
.
[/code]
[code]
> sudo gpre -cob -ansi -manual -no_lines test_db.cbl test_db_sql.cbl
[/code]
Produces this precompiled code:
[code]
* ********** Preprocessed module -- do not edit **************
* ********** Preprocessed module -- do not edit **************
* ********** Preprocessed module -- do not edit **************
* ********** Preprocessed module -- do not edit **************
* ********** Preprocessed module -- do not edit **************
* **************** gpre version LI-V2.0.4.13130 Firebird 2.0 *********************
IDENTIFICATION DIVISION.
PROGRAM-ID. test-db.
DATA DIVISION.
WORKING-STORAGE SECTION.
* EXEC SQL
* SET DATABASE
* test2 = '/var/lib/firebird/2.0/data/test2.fdb'
* USER 'SYSDBA' PASSWORD 'phoenix';
* **** GDS Preprocessor Definitions ****
01 isc-blob-null PIC S9(18) USAGE COMP VALUE IS 0.
01 ISC-SQL-CODE PIC S9(9) USAGE COMP EXTERNAL.
01 test2 IS GLOBAL PIC S9(9) USAGE COMP VALUE IS 0.
01 isc-1db PIC X(36) VALUE IS
"/var/lib/firebird/2.0/data/test2.fdb".
01 ISC-TRANS IS GLOBAL PIC S9(9) USAGE COMP VALUE IS 0.
01 ISC-STATUS-VECTOR IS GLOBAL.
03 ISC-STATUS PIC S9(9) USAGE COMP OCCURS 20 TIMES.
01 ISC-STATUS-VECTOR2 IS GLOBAL.
03 ISC-STATUS2 PIC S9(9) USAGE COMP OCCURS 20 TIMES.
01 ISC-ARRAY-LENGTH PIC S9(9) USAGE COMP.
01 SQLCODE IS GLOBAL PIC S9(9) USAGE COMP-5 VALUE IS 0.
01 isc-0 PIC S9(9) USAGE COMP VALUE IS 0.
01 ISC-1.
03 ISC-1-1 PIC XXXX USAGE COMP-X VALUE IS 262661.
03 ISC-1-2 PIC XXXX USAGE COMP-X VALUE IS 524290.
03 ISC-1-3 PIC XXXX USAGE COMP-X VALUE IS 117571591.
03 ISC-1-4 PIC XXXX USAGE COMP-X VALUE IS 1325482879.
03 ISC-1-5 PIC XXXX USAGE COMP-X VALUE IS 1241596673.
03 ISC-1-6 PIC XXXX USAGE COMP-X VALUE IS 1397052426.
03 ISC-1-7 PIC XXXX USAGE COMP-X VALUE IS 1096048468.
03 ISC-1-8 PIC XXXX USAGE COMP-X VALUE IS 4541506.
03 ISC-1-9 PIC XXXX USAGE COMP-X VALUE IS 1291865855.
03 ISC-1-10 PIC XXXX USAGE COMP-X VALUE IS 1.
03 ISC-1-11 PIC XXXX USAGE COMP-X VALUE IS 982867.
03 ISC-1-12 PIC XXXX USAGE COMP-X VALUE IS 18350338.
03 ISC-1-13 PIC XXXX USAGE COMP-X VALUE IS 1638400.
03 ISC-1-14 PIC XXXX USAGE COMP-X VALUE IS 352387072.
03 ISC-1-15 PIC XXXX USAGE COMP-X VALUE IS 65544.
03 ISC-1-16 PIC XXXX USAGE COMP-X VALUE IS 1638400.
03 ISC-1-17 PIC XXXX USAGE COMP-X VALUE IS 251592705.
03 ISC-1-18 PIC XXXX USAGE COMP-X VALUE IS 135594240.
03 ISC-1-19 PIC XXXX USAGE COMP-X VALUE IS 0.
03 ISC-1-20 PIC XXXX USAGE COMP-X VALUE IS 16783616.
03 ISC-1-21 PIC XXXX USAGE COMP-X VALUE IS 1291845376.
*
* FORMATTED REQUEST BLR FOR ISC-1 =
* blr_version5,
* blr_begin,
* blr_message, 0, 2,0,
* blr_long, 0,
* blr_short, 0,
* blr_begin,
* blr_for,
* blr_singular,
* blr_rse, 1,
* blr_aggregate, 1,
* blr_rse, 1,
* blr_relation, 10, 'T','E','S',
* 'T','_','T','A','B','L',
* 'E', 0,
* blr_end,
* blr_group_by, 0,
* blr_map, 1,0,
* 0,0,
* blr_agg_count,
* blr_end,
* blr_send, 0,
* blr_begin,
* blr_assignment,
* blr_fid, 1, 0,0,
* blr_parameter, 0, 0,0,
* blr_assignment,
* blr_literal, blr_long, 0, 1,0,0,0,
* blr_parameter, 0, 1,0,
* blr_end,
* blr_send, 0,
* blr_assignment,
* blr_literal, blr_long, 0, 0,0,0,0,
* blr_parameter, 0, 1,0,
* blr_end,
* blr_end,
* blr_eoc
*
* END OF BLR STRING FOR REQUEST ISC-1
01 ISC-2.
03 ISC-3 PIC S9(9) USAGE IS COMP.
03 ISC-4 PIC S9(4) USAGE IS COMP.
01 ISC-6L PIC S9(4) USAGE COMP-5 VALUE IS 18.
01 ISC-6.
03 ISC-6-1 PIC XXXX USAGE COMP-X VALUE IS 1392909313.
03 ISC-6-2 PIC XXXX USAGE COMP-X VALUE IS 1111774041.
03 ISC-6-3 PIC XXXX USAGE COMP-X VALUE IS 1879514433.
03 ISC-6-4 PIC XXXX USAGE COMP-X VALUE IS 1852141416.
03 ISC-6-5 PIC XXXX USAGE COMP-X VALUE IS 19561.
*
* FORMATTED REQUEST BLR FOR ISC-6 =
* gds__dpb_version1,
* isc_dpb_user_name,6, 'S','Y','S','D','B','A',
* isc_dpb_password,7, 'p','h','o','e','n','i','x',
*
* END OF DPB STRING FOR REQUEST ISC-6
* **** end of GPRE definitions ****
.
01 wv-count pic s9(04) usage binary.
PROCEDURE DIVISION.
* EXEC SQL
* CONNECT test2
CALL "isc_attach_database" USING ISC-STATUS-VECTOR,
BY VALUE 36, BY REFERENCE isc-1db, BY REFERENCE test2,
BY VALUE 18, BY REFERENCE isc-6
CALL "isc_sqlcode_s" USING ISC-STATUS-VECTOR,
BY REFERENCE SQLCODE
;
.
* exec sql
* select count(*)
* into :wv-count
* from test_table;
IF isc-0 = 0 THEN
CALL "isc_compile_request2" USING ISC-STATUS-VECTOR,
BY REFERENCE test2, BY REFERENCE isc-0, BY VALUE 84,
BY REFERENCE ISC-1
CALL "isc_sqlcode_s" USING ISC-STATUS-VECTOR,
BY REFERENCE SQLCODE
END-IF
IF isc-0 NOT = 0 THEN
CALL "isc_start_request" USING ISC-STATUS-VECTOR,
BY REFERENCE isc-0, BY REFERENCE isc-trans, BY VALUE 0
CALL "isc_sqlcode_s" USING ISC-STATUS-VECTOR,
BY REFERENCE SQLCODE
END-IF
IF SQLCODE = 0 THEN
CALL "isc_receive" USING ISC-STATUS-VECTOR,
BY REFERENCE isc-0, BY VALUE 0, BY VALUE 6,
BY REFERENCE ISC-2, BY VALUE 0
CALL "isc_sqlcode_s" USING ISC-STATUS-VECTOR,
BY REFERENCE SQLCODE
IF isc-4 NOT = 0 THEN
MOVE isc-3 TO wv-count
ELSE
MOVE 100 TO SQLCODE
END-IF
END-IF
.
* EXEC SQL
* DISCONNECT test2
IF test2 NOT = 0 THEN
CALL "isc_detach_database" USING ISC-STATUS-VECTOR,
BY REFERENCE test2
END-IF
CALL "isc_sqlcode_s" USING ISC-STATUS-VECTOR,
BY REFERENCE SQLCODE
;
.
display wv-count
STOP RUN
.
[/code]
The firebird-dev package installs the Firebird (Interbase) shared objects:
[code]
/usr/lib/libfbclient.so
/usr/lib/libfbembed.so
[/code]
and some headers:
[code]
/usr/include/blr.h
/usr/include/ib_util.h
/usr/include/ibase.h
/usr/include/iberror.h
/usr/include/perf.h
[/code]
I tried to compile the pre-compiled code with the following options:
[code]
cobc -v -x -lfbembed test_db_sql.cbl
[/code]
Here's the output:
[code]
cobc -v -x -lfbembed test_db_sql.cbl
preprocessing test_db_sql.cbl into /tmp/cob10069_0.cob
translating /tmp/cob10069_0.cob into /tmp/cob10069_0.c
test_db_sql.cbl:26: Warning: 'GLOBAL' not implemented
test_db_sql.cbl:29: Warning: 'GLOBAL' not implemented
test_db_sql.cbl:30: Warning: 'GLOBAL' not implemented
test_db_sql.cbl:32: Warning: 'GLOBAL' not implemented
test_db_sql.cbl:35: Warning: 'GLOBAL' not implemented
test_db_sql.cbl:41: Warning: Value size exceeds data size
test_db_sql.cbl:42: Warning: Value size exceeds data size
test_db_sql.cbl:43: Warning: Value size exceeds data size
test_db_sql.cbl:44: Warning: Value size exceeds data size
test_db_sql.cbl:46: Warning: Value size exceeds data size
test_db_sql.cbl:58: Warning: Value size exceeds data size
test_db_sql.cbl:106: Warning: Value size exceeds data size
test_db_sql.cbl:107: Warning: Value size exceeds data size
test_db_sql.cbl:108: Warning: Value size exceeds data size
test_db_sql.cbl:109: Warning: Value size exceeds data size
cc -pipe -c -O2 -Wall -O2 -Wno-unused -fsigned-char -Wno-pointer-sign -o /tmp/cob10069_0.o /tmp/cob10069_0.c
cc -pipe -Wl,-Bsymbolic-functions -Wl,--export-dynamic -o test_db_sql /tmp/cob10069_0.o -Wl,-Bsymbolic-functions -L/usr/lib -lcob -lm -lgmp -lncurses -ldb -lfbembed
[/code]
It DOES produce an executable but when I run it I get this:
[code]
> ./test_db_sql
libcob: Cannot find module 'isc_sqlcode_s'
[/code]
So, it's all about correctly linking the Firebird shared objects?
Any ideas?
----------------------------------------------------------------
Yep, looks like you need "-lfbclient" as well
on the compile.
(Assuming that 'isc_sqlcode_s' is defined in
/usr/lib/libfbclient.so)
Roger
----------------------------------------------------------------
Hmmm - made no difference.
I've no idea how to resolve this...
----------------------------------------------------------------
Can you check that the symbol is actually defined
in one of the libraries.
Do
nm -a /usr/lib/libfbclient.so | grep isc_sqlcode_s
nm -a /usr/lib/libfbembed.so | grep isc_sqlcode_s
It should show up somewhere marked as " T "
(text segement ie. instruction entry point)
If it does, then execute as root -
ldconfig
and try again.
If it doesn't, then something is missing.
Roger
----------------------------------------------------------------
[code]
> nm -a /usr/lib/libfbclient.so | grep isc_sqlcode_s
nm: /usr/lib/libfbclient.so: no symbols
> nm -a /usr/lib/libfbembed.so | grep isc_sqlcode_s
nm: /usr/lib/libfbembed.so: no symbols
[/code]
Hmmm - does this mean that they're no use without the symbols?
----------------------------------------------------------------
Can you try adding the "-D" option to nm.
Roger
----------------------------------------------------------------
There is no 'isc_sqlcode_s' so I did a more general search and found 'isc_sqlcode':
[code]
> nm -D /usr/lib/libfbembed.so | grep isc_s
0002e4b0 T isc_seek_blob
0002e2c0 T isc_send
0002d870 T isc_service_attach
0002fb30 T isc_service_detach
0002e0b0 T isc_service_query
0002dee0 T isc_service_start
00027180 T isc_set_debug
0001f440 T isc_sql_interprete
00011bb0 T isc_sqlcode
00034b70 T isc_start_and_send
0002b500 T isc_start_multiple
000348d0 T isc_start_request
0002b820 T isc_start_transaction
[/code]
[code]
> nm -D /usr/lib/libfbclient.so | grep isc_
0002a9d0 T isc_seek_blob
0002bfc0 T isc_send
000285e0 T isc_service_attach
0002c4e0 T isc_service_detach
0002a1e0 T isc_service_query
0002b6f0 T isc_service_start
00022d10 T isc_set_debug
00019a00 T isc_sql_interprete
0000b510 T isc_sqlcode
0002bb90 T isc_start_and_send
00029440 T isc_start_multiple
0002ab80 T isc_start_request
00029780 T isc_start_transaction
[/code]
I'm gonna try replacing 'isc_sqlcode_s' with 'isc_sqlcode' in the pre-compiled code and see what happens...
----------------------------------------------------------------
Okay - two things:
1 - I replaced Firebird-Classic with Firebird-Super and this seemed to resolve some permission problems I was having
2 - Between the gpre pre-compile step and the cobc compile step, I changed "isc_sqlcode_s" to "isc_sqlcode" in the pre-compiled source. (I just need to make a little script to do it all auto-magically).
And...
...it looks like I'm nearly there - the code compiles and successfully runs, but the result is '+0000' when it should be '+0002' (I put 2 test rows on the table).
I just need to put some error checking in the test program to find out why the result is incorrect - it's probably database user permissions or incorrect database/table qualification.
----------------------------------------------------------------
[code]
01 ISC-1.
03 ISC-1-1 PIC XXXX USAGE COMP-X VALUE IS 262661.
03 ISC-1-2 PIC XXXX USAGE COMP-X VALUE IS 524290.
03 ISC-1-3 PIC XXXX USAGE COMP-X VALUE IS 117571591.
03 ISC-1-4 PIC XXXX USAGE COMP-X VALUE IS 1325482879.
03 ISC-1-5 PIC XXXX USAGE COMP-X VALUE IS 1241596673.
03 ISC-1-6 PIC XXXX USAGE COMP-X VALUE IS 1397052426.
03 ISC-1-7 PIC XXXX USAGE COMP-X VALUE IS 1096048468.
03 ISC-1-8 PIC XXXX USAGE COMP-X VALUE IS 4541506.
03 ISC-1-9 PIC XXXX USAGE COMP-X VALUE IS 1291865855.
03 ISC-1-10 PIC XXXX USAGE COMP-X VALUE IS 1.
03 ISC-1-11 PIC XXXX USAGE COMP-X VALUE IS 982867.
03 ISC-1-12 PIC XXXX USAGE COMP-X VALUE IS 18350338.
03 ISC-1-13 PIC XXXX USAGE COMP-X VALUE IS 1638400.
03 ISC-1-14 PIC XXXX USAGE COMP-X VALUE IS 352387072.
03 ISC-1-15 PIC XXXX USAGE COMP-X VALUE IS 65544.
03 ISC-1-16 PIC XXXX USAGE COMP-X VALUE IS 1638400.
03 ISC-1-17 PIC XXXX USAGE COMP-X VALUE IS 251592705.
03 ISC-1-18 PIC XXXX USAGE COMP-X VALUE IS 135594240.
03 ISC-1-19 PIC XXXX USAGE COMP-X VALUE IS 0.
03 ISC-1-20 PIC XXXX USAGE COMP-X VALUE IS 16783616.
03 ISC-1-21 PIC XXXX USAGE COMP-X VALUE IS 1291845376.
[/code]
OKay - what is COMP-X and why are some of these values too big?
----------------------------------------------------------------
Eeermm, I do not think you should be blindly replacing
isc_sqlcode_s with something else. There must be a reason
why the preprocessor is generating these calls.
It sounds like a missing library and/or interface stub.
I would ask on the Firebird list.
COMP-X is a binary field with length defined by the PIC
clause. In this case 4 bytes. The warning is because
some of these values are 10 digits which may possibly
overflow the field (Here, it doesn't).
Roger
----------------------------------------------------------------
What happened?
Any luck?
I'm anxious.
----------------------------------------------------------------
hi, I got interested in the same thing. I had already downloaded OC 1.1 and would have liked to see embedded SQL working here. And then I got hold of the firebirdsql 2.0.4 tarball.
I setup firebird with --with-gpre-cobol and that addded cobol support in GPRE.
Now I am using the same cbl program and have similar errors with isc_sqlcode_s not being there. I thought I had traced it back to ibase.h not exposing the function however rebuilding the sql server from the tarball did not change a thing. The nm command did not show any improvement and the error about isc_sqlcode_c is still there.
What am I doing wrong ?
Googling around I found out that ibase.h had been changed in 2006 (?) to implement the following:
...........
2006.09.06 Steve Boyd - Added various prototypes required by Cobol ESQL
* isc_embed_dsql_length
* isc_event_block_a
* isc_sqlcode_s
* isc_embed_dsql_fetch_a
* isc_event_block_s
* isc_baddress
* isc_baddress_s
*
...........
which might be part of what we need here.
however the 2.0.4 tarball from firebirdsql.org does not have that. While alt.cpp already defines the isc_sqlcode_s function.
I am not too familiar with how these things work and this does not seem to be (yet) an OC problem.
If someone has found a solution or would know who should be contacted.....
edit: I dropped firebird 2.04 and moved to 2.1.1, the latest, even if that version is not available for opensuse 10.3 (which I need). Those changes in ibase.h were there but I still had the same problem. I managed to get isc_sqlcode_s in the lib by tweaking one setup file used by make to expose functions in the libs. I can now use GPRE and cobc to compile the SQL code. When run, the program does not fall over anymore however I am not sure whether this is the correct approach.....
L
----------------------------------------------------------------
hi,
after a while, I have come back to this. Now, I can open a connection to the db but then I get error " -000000104" with text "invalid request BLR at offset 0", "unsupported BLR version (expected 4, encountered 0)". Any ideas ? wrong dialect, authorities ?
Or is Opencobol incompatible with Firebird 2.1.1 (or viceversa) ??
bye
L
----------------------------------------------------------------
I did some poking around. GPRE Firebird 2.0.4, packaged in Debian Lenny. firebird2.0-common, -server-common, -super, -dev
Database created at localhost:/var/lib/firebird/2.0/data/test.fdb and test_table created with some 6 records. And then using the sample posted here.
Yeah, I had the same initial isc_sqlcode_s problem;
The signatures are different;
isc_sqlcode_s(isc_status_vector, sqlcode)
sqlcode = isc_sqlcode(isc_status_vector)
So I changed the calls in the GPRE output from USING to RETURNING SQLCODE (as I didn't build Firebird from source).
isc_attach_database is returning sqlcode -901.
From the api doc -901 covers a shipload of different conditions.
isc_print_status reports
Invalid clumplet buffer structure: buffer end before end of clumplet - clumplet too long
isc_print_sqlerror reports that it can't find the message array;
I don't trust any of this info. :)
Note; I get this same behaviour linking to either fbclient or fbembed.
It seems we should talk with the Firebird engineers before spending too much more time on this one. Work with them to nail down a nice powerful open source solution to COBOL and SQL. The synergy between the two projects could be exponential.
OR
skip the niceties of GPRE and just write up Firebird API call idioms and the associated datastructures.
BUT
GPRE does make for some nice concise SQL EXEC embedding, so I think it'll be worth pursuing with the FB engineer team. Especially when we explain that OpenCOBOL will be thee COBOL soon :) ... and it may well ring true with their Open Source natures. It does seem very very close to functional; only the devil in the details to shake out.
Decard, lfield08; Do you have any news? And lfield08 you'll need to decompose some of the ISC-1 or ISC-6 working store. See if the COBOL defs match the comments that describe the BLR structure in the GPRE output code.
Cheers,
Brian
----------------------------------------------------------------
I took a quick look at this.
Basically gpre is terminally broken.
What may work is if you have RM-COBOL and use the rm option on gpre.
Using gpre in all variations (no option, ansi option, rm option) results in non-workable code for current compilers (OC, MF, ACU).
What is needed is a rework/merging of src/gpre/cob.cpp and src/gpre/rmc.cpp
A problem with these sources is that stuff is statically compiled in/out with #ifdef's instead of being options.
eg. -
#ifdef GIVING_SUPPORTED
That's for support of GIVING/RETURNING on a CALL.
(Incidentally, that is exactly where this "isc_sqlcode"/"isc_sqlcode_s" is coming from.
Roger
----------------------------------------------------------------
Subject: Problem with PIC 9(8) COMP
Hello,
For testing comp with pic i did 2 simple loops in a program :
IDENTIFICATION DIVISION.
PROGRAM-ID. TESTCOMP.
*
ENVIRONMENT DIVISION.
*************************
*
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
***************
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
01 I-0 PIC 9(8) .
01 I-1 PIC 9(8) COMP.
PROCEDURE DIVISION.
PERFORM VARYING I-0 FROM 1 BY 1 UNTIL I-0 > 10
DISPLAY "I-0=" I-0
END-PERFORM.
PERFORM VARYING I-1 FROM 1 BY 1 UNTIL I-1 > 10
DISPLAY "I-1=" I-1
END-PERFORM.
FINI.
STOP RUN RETURNING 0.
This is the result i have :
I-0=00000001
I-0=00000002
I-0=00000003
I-0=00000004
I-0=00000005
I-0=00000006
I-0=00000007
I-0=00000008
I-0=00000009
I-0=00000010
I-1=94967296
I-1=89934592
I-1=84901888
I-1=79869184
I-1=74836480
I-1=69803776
I-1=64771072
I-1=59738368
I-1=54705664
I-1=49672960
The platform is solaris 10/intel x86/gmp 4.2.1 (gmp.so.3.4.1 )
Please can you help me on this problem.
Eric
FYI:
the c generated code is :
/* Generated from test.cbl by cobc version 1.0 patch level 0 */
#define __USE_STRING_INLINES 1
#include
#include
#include
#include
#define WORDS_BIGENDIAN 1
#include
#define COB_SOURCE_FILE "test.cbl"
#define COB_PACKAGE_VERSION "1.0"
#define COB_PATCH_LEVEL 0
/* function prototypes */
static int TESTCOMP_ (const int);
int TESTCOMP (void);
/* functions */
int
TESTCOMP ()
{
return TESTCOMP_ (0);
}
/* end functions */
static int
TESTCOMP_ (const int entry)
{
#include "test.c.h" /* local variables */
static int initialized = 0;
static cob_field *cob_user_parameters[COB_MAX_FIELD_PARAMS];
static cob_module module = { NULL, NULL, NULL, NULL, cob_user_parameters, 0, ',', '$', '.', 1, 1, 1, 0};
/* perform frame stack */
int frame_index;
struct frame { int perform_through; int return_address; } frame_stack[255];
/* Start of function code */
if (unlikely(entry < 0)) {
if (!initialized) {
return 0;
}
initialized = 0;
return 0;
}
module.next = cob_current_module;
cob_current_module = &module;
if (unlikely(initialized == 0))
{
if (!cob_initialized) {
cob_fatal_error (COB_FERROR_INITIALIZED);
}
cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL);
if (module.next)
cob_set_cancel ((const char *)"TESTCOMP", (void *)TESTCOMP, (void *)TESTCOMP_);
(*(int *) (b_1)) = 0;
(*(int *) (b_2)) = 0;
(*(int *) (b_3)) = 0;
memset (b_5, 48, 8);
memset (b_6, 0, 4);
initialized = 1;
}
/* initialize frame stack */
frame_index = 0;
frame_stack[0].perform_through = -1;
/* initialize number of call params */
(*(int *) (b_3)) = cob_call_params;
cob_save_call_params = cob_call_params;
goto l_2;
/* PROCEDURE DIVISION */
/* TESTCOMP: */
l_2:;
/* MAIN SECTION: */
/* MAIN PARAGRAPH: */
/* test.cbl:35: PERFORM */
{
own_memcpy (b_5, "00000001", 8);
while (1)
{
if (((int)cob_cmp_numdisp (b_5, 8, 10) > 0))
break;
{
/* test.cbl:36: DISPLAY */
{
cob_new_display (0, 1, 2, &c_1, &f_5);
}
}
cob_add_int (&f_5, 1);
}
}
/* test.cbl:39: PERFORM */
{
(*(unsigned int *)(b_6)) = 1;
while (1)
{
if (((int)cob_cmp_align_u32_binary (b_6, 10) > 0))
break;
{
/* test.cbl:40: DISPLAY */
{
cob_new_display (0, 1, 2, &c_2, &f_6);
}
}
cob_add_align_u32_binary (b_6, 1);
}
}
/* FINI: */
/* test.cbl:44: STOP */
{
cob_stop_run (0);
}
cob_current_module = cob_current_module->next;
return (*(int *) (b_1));
PSWITCH:
cob_fatal_error (COB_FERROR_CODEGEN);
}
/* end function stuff */
the c.h generated code is :
/* Generated from test.cbl by cobc version 1.0 patch level 0 */
/* PROGRAM-ID : TESTCOMP */
static unsigned char b_1[4] __attribute__((aligned)); /* RETURN-CODE */
static unsigned char b_2[4] __attribute__((aligned)); /* SORT-RETURN */
static unsigned char b_3[4] __attribute__((aligned)); /* NUMBER-OF-CALL-PARAMETERS */
static unsigned char b_5[8] __attribute__((aligned)); /* I-0 */
static unsigned char b_6[4] __attribute__((aligned)); /* I-1 */
/* attributes */
static cob_field_attr a_1 = {33, 0, 0, 0, NULL};
static cob_field_attr a_2 = {16, 8, 0, 0, NULL};
static cob_field_attr a_3 = {17, 8, 0, 0, NULL};
/* fields */
static cob_field f_6 = {4, b_6, &a_3}; /* I-1 */
static cob_field f_5 = {8, b_5, &a_2}; /* I-0 */
/* constants */
static cob_field c_1 = {4, (unsigned char *)"I-0=", &a_1};
static cob_field c_2 = {4, (unsigned char *)"I-1=", &a_1};
/* ---------------------------------------------- */
----------------------------------------------------------------
This looks weird.
It thinks we are a big-endian machine.
AFAIK, Solaris on x86 is little-endian.
Look in config.h in OC's top level
directory for WORDS_BIGENDIAN.
If it's defined, can you send me
"config.log".
Then set up this test C prog
as chkend.c
[code]
#include
main()
{
union {
int chkint;
unsigned char chkchr[4];
} chkun;
chkun.chkint = 0;
chkun.chkchr[3] = 1;
printf ("Val %d\n", chkun.chkint);
}
[/code]
Compile and execute -
cc chkend.c -o chkend
./chkend
Roger
----------------------------------------------------------------
You are right about the big endian thing : i reran configuration and compilation of oc with ac...bigendian=no and that has resolved the problem.
Thank you for your help.
----------------------------------------------------------------
Hold on. Do you mean you specifically had
to set the ac..endian for the configure?
If so, I need to know why the autoconf
macros for this are not working on your box.
I need the "config.log" from the non-working case.
Can you also have a look at the system files
/usr/include/sys/types.h
/usr/include/sys/param.h
Look for anything with BYTE_ORDER and/or ENDIAN.
Roger
----------------------------------------------------------------
Theres is nothing about BYTE_ORDER and/or ENDIAN thing (except in param.h where the definitins of LO/HIBYTE and LO/HIWORD are different for BIG or LITTLE endian) in the include files.
I sent you the config.log by email.
Eric
----------------------------------------------------------------
Sorry, I did not get anything.
Please be careful that the
title does not contain anything that
maybe suspect. Also the content.
Roger
----------------------------------------------------------------
OK. Got the log.
This shows there is an aborted/incomplete
ncurses installation somwhere on the system.
So, although a link with the ncurses
lib succeeds, an attempt to execute does not.
Unfortunately, we test this early in the configure
process, so that, in this case the endian test bombs out.
To prevent similar things happening, I have moved
the lib checks (including curses) to later in
the configure.
This will NOT solve the problem here which
is due to a misconfigured system.
Roger
----------------------------------------------------------------
Subject: ALTER statement silently ignored
The following program, compiled with cobc (OpenCOBOL) 1.0.0, goes
into an endless loop. The generated C source shows that the ALTER
statement does not have any effect. I do not insist that ALTER should
be supported, but the compiler should issue some error instead of
silently ignoring it.
IDENTIFICATION DIVISION.
PROGRAM-ID. "TEST01".
PROCEDURE DIVISION.
010. GO TO 020.
020.
ALTER 010 TO PROCEED TO 030.
GO TO 010.
030.
STOP RUN.
----------------------------------------------------------------
I fully agree.
I will change this to a fatal error.
ALTER was designated as obsolete in
the 85 standard.
Roger
----------------------------------------------------------------
Corrected.
This will be correctly errored out.
Roger
----------------------------------------------------------------
Subject: Print / Spool
Hello.
How can I can print my files to make them completely readable??
I tried
[code]SELECT FACTURE ASSIGN TO PRINTER.[/code]
but it throws that error
[quote]libcob: Permanent file error (STATUS = 30) File : ''[/quote]
thank you for your help
----------------------------------------------------------------
try :
select facture assign to "printer"
.
.
.
and after executing your program
cat printer
C'est du pur jus !
Bear
----------------------------------------------------------------
Erm, what is this ?
Roger
----------------------------------------------------------------
Actually what i want is a way to display ebcdic characters
My result file mix EBCDIC and ASCII, so I cant convert (EBCDIC to ascii) the whole text at the same time....
----------------------------------------------------------------
Then set up a table. This is classic
Cobol programming :-)
(No, I am not going to do your homework for you)
Roger
----------------------------------------------------------------
Subject: Compile errors in fileio.c
Upon performing the make step, numerous errors are detected in C module fileio.c. The compile ends with an error and installation does not proceed. The errors are quite numerous, so only the beginning portion will be shown:
fileio.c:300: error: expected specifier-qualifier-list before 'DB'
fileio.c: In function 'cob_sync':
fileio.c:481: error: 'struct indexed_file' has no member named 'db'
fileio.c:481: error: 'struct indexed_file' has no member named 'db'
fileio.c:488: error: 'struct indexed_file' has no member named 'db'
fileio.c:488: error: 'struct indexed_file' has no member named 'db'
fileio.c: In function 'indexed_open':
fileio.c:1505: error: 'struct indexed_file' has no member named 'db'
fileio.c:1505: error: 'DB' undeclared (first use in this function)
fileio.c:1505: error: (Each undeclared identifier is reported only once
fileio.c:1505: error: for each function it appears in.)
fileio.c:1505: error: expected expression before ')' token
fileio.c:1510: error: 'struct indexed_file' has no member named 'last_readkey'
fileio.c:1511: error: 'struct indexed_file' has no member named 'last_dupno'
fileio.c:1512: error: 'struct indexed_file' has no member named 'rewrite_sec_key'
fileio.c:1521: error: 'BTREEINFO' undeclared (first use in this function)
fileio.c:1521: error: expected ';' before 'info'
fileio.c:1554: error: 'info' undeclared (first use in this function)
fileio.c:1556: error: 'R_DUP' undeclared (first use in this function)
fileio.c:1567: error: 'struct indexed_file' has no member named 'db'
fileio.c:1567: warning: implicit declaration of function 'dbopen'
fileio.c:1567: error: 'DB_BTREE' undeclared (first use in this function)
fileio.c:1568: error: 'struct indexed_file' has no member named 'db'
fileio.c:1574: error: 'struct indexed_file' has no member named 'db'
fileio.c:1574: error: 'struct indexed_file' has no member named 'db'
This is on a Debian distro running kernel 2.6.21. Any ideas as to what the problem might be? I ran ldconfig prior to beginning the install.
----------------------------------------------------------------
Download 1.0 and RTFR :-)
(Read The Fine README) :-)
Roger
----------------------------------------------------------------
Roger,
Many thanks. The problem was not that I did not read the README, but rather my poor eyesight (legally blind). I thought I saw a check in front of the required library libdb4.4-dev in Synaptic. I was wrong.
----------------------------------------------------------------
OK. But raises an interesting question.
Why did the configure not pick this up?
Roger
----------------------------------------------------------------
Subject: Variable length files and RDW size
I am looking into using SyncSort to do sorting of flat files. In asking about variable length files, I found out that SyncSort will only handle a 2-byte RDW in Big-Endian as unsigned.
I looked at the README and found a switch to control the setting of the RDW, but is always four bytes. --with-varseq=
Is it practical for OC to read and write Variable length files with a 2 byte RDW (I'm sure it's possible, so I won't ask that). This would focus only on record sequential read and write. I'm looking through libcob/fileio.c at the sequential_* functions and kind of following.
Thanks,
Cris
----------------------------------------------------------------
You should be OK with the default.
ie. --with-varseq=0. See the
README.
The default is 2 bytes big-endian
followed by 2 slack bytes.
The length always includes the length
(and slack bytes).
AFAIK, this works fine with SyncSort.
You also might want to use Cobol SORT to
do this.
The OC SORT is very fast :-)
(As of OC 1.0, which uses a list/merge technique)
Roger
----------------------------------------------------------------
I asked SyncSort about it but they insisted that it will only handle 2 bytes (it's actually DMExpress that we are looking at). I'm not sure how the two slack bytes will be handled. We are installing a trial, and will be one of the first tests that we run.
I did look at using the SORT verb. Performance was not the main issue. The big issue is that we have over 60 sort jobs, so each would need to be turned into Cobol programs. Some are also doing OUTREC and OUTFIL processing.
We having existing mfsort parm cards which will fairly easily convert over.
Cris
----------------------------------------------------------------
Well, we cover the known variations
of mainframe/early MF as regards variable
length. Later MF incarnations put a 128
byte header in there.
It is on the TODO list to provide
an "ocsort".
If you have suggestions, then post.
Roger
----------------------------------------------------------------
Roger,
I remember the ocsort discussions, as I asked the question that started it all.
ocsort would be great, but like many managers, they want a solution yesterday.
I'll dust off my notes and put something together.
I believe there were some that kind of looked at on the mail list but I never saw much past the initial emails (back in July).
Cris
----------------------------------------------------------------
Maybe, I am trying to find
particularly difference between
MF and OC.
I am still trying to get 1.0 out
of the door.
Managers can wait.
I will do what I can.
Roger
----------------------------------------------------------------
For this, there really isn't a different between MF and OC to look for, as it now becomes specificly what a separate third-party product is looking for in an input file.
I'll know more when I get SyncSort installed to see if it truely only handles 2 bytes.
I've been watching for 1.0 to come out. This can wait until after that, and I'll just tell my managers it's coming (or better yet we can try to adjust the code for our needs and send it in ;) - Give me a chance to really break some code.
Looking at the code, I'm thinking of adding a type 3 for 2 bytes and then work to get the code in the sequential_read and sequential_write functions.
Thanks
Cris
----------------------------------------------------------------
Roger,
I think I know where I am getting off track and why I was confused.
Looking at some test files, I am seeing 00 00 03 e8 for a 1000 byte record. From your statement, I was expecting to see 03 e8 00 00 (I found some mainframe doc, as I had never heard of the length being like this).
Looking in the config.log I found that WITH_VARSEQ is being set to 1. Looking at the configure I can not find anywhere where the argument value passed with -with-varseq is ever used.
I suspect that this statement should be using a variable.
cat >>confdefs.h <<\_ACEOF
#define WITH_VARSEQ 1
_ACEOF
Cris
----------------------------------------------------------------
Aaagh, yes, indeed. There is a blooper
in the configure. (Actually configure.ac)
Now fixed and tarball updated.
** WARNING **
WITH_VARSEQ is now correctly defaulted to 0.
This means that variable length files are
incompatible with previous releases.
If you want to retain compatibility and
use files created with previous releases,
specify --with-varseq=1 to the configure.
Roger
----------------------------------------------------------------
Subject: OpenCOBOL 1.0
OpenCOBOL 1.0 has been released.
This release covers most of
the syntax from the 85 standard as well
as including features from MF, ACU and
the 2002 standard.
Further info can be obtained by looking
at the ChangeLog files at top level
and sub-directories.
Roger
----------------------------------------------------------------
Subject: Season's greetings and a happy new year
I wish all a happy and successful
new year.
Thank you very much for the feedback and support
and I hope that this will continue into
the new year.
Roger
(And from Keisuke)
----------------------------------------------------------------
Subject: file section
Hi,
in my cobol source there is:
DATA DIVISION.
FILE SECTION.
FD Entryplist LABEL RECORD IS STANDARD
VALUE OF FILE-ID IS "Entryptxt"
DATA RECORD IS listarpg-REC.
when I try to compile with cobc , I recive this error referred to line with the word FILE-ID:
syntax error , unexpected VALUE, expecting EXTERNAL or GLOBAL
Why?
wher I can find the complet user/reference manual ?
thanks
----------------------------------------------------------------
The VALUE OF clause was declared obsolete in
the 85 standard.
MF accepts it as should OC.
However, there is a bug in OC causing the syntax failure.
This has been fixed in the 1.1 prerelease -
download link on main page.
So -
# cobc --version
cobc (OpenCOBOL) 1.1.0
Copyright (C) 2001-2007 Keisuke Nishida
Copyright (C) 2007 Roger While
#
# cobc -x ext3.cob
#
# cobc -x -Wall ext3.cob
ext3.cob:18: Warning: VALUE OF is obsolete in OpenCOBOL
#
# cobc -x -Wall -std=cobol85 ext3.cob
ext3.cob:18: Warning: VALUE OF is obsolete in COBOL 85
#
# cobc -x -Wall -std=cobol2002 ext3.cob
ext3.cob:18: Error: VALUE OF does not conform to COBOL 2002
#
Roger
----------------------------------------------------------------
thanks,
but now, with the 1.1 prerelease, there are other errors in SELECT:
janilo@ununtu704:-/XcvtAStoJ/cvastoj_src$ cobc -v
:obc (OpenCOBOL) 1.1.0
:opyright (C) 2001-2007 Keisuke Nishida
:opyright (C) 2007 Roger While
janilo@ununtu704:-/XcvtAStoJ/cvastoj_src$ cobc -x -Wall -std=cobol85 crt000.cbl
:rt000.cbl:8: Warning: AUTHOR is obsolete in COBOL 85
:rt000.cbl:9: Warning: DATE-WRITTEN is obsolete in COBOL 85
:rt000.cbl:23: Error: syntax error, unexpected ORGANIZATION, expecting WORD or L [TERAL or DISPLAY
janilo@ununtu704:-/XcvtAStoJ/cvastoj_src$ cobc -x -Wall -std=mf crt000.cbl
:rt000.cbl:8: Warning: AUTHOR is obsolete in Micro Focus COBOL
:rt000.cbl:9: Warning: DATE-WRITTEN is obsolete in Micro Focus COBOL :rt000.cbl:23: Error: syntax error, unexpected ORGANIZATION, expecti~g WORD or L [TERAL or DISPLAY
janilO@ununtu704:-/XcvtAStoJ/cvastoj src$ cobc -x -Wall -std=mvs crt000.cbl
:rt000.cbl:8: Warning: AUTHOR is obsolete in IBM COBOL for MVS & VM
:rt000.cbl:9: Warning: DATE-WRITTEN is obsolete in IBM COBOL for MVS & VM
:rt000.cbl:23: Error: syntax error, unexpected ORGANIZATION, expecting WORD or L [TERAL or DISPLAY
janilo@ununtu704:-/XcvtAStoJ/cvastoj src$ cobc -x -Wall -std=ibm crt000.cbl
:rt000.cbl:8: Warning: AUTHOR is obsolete in IBM COBOL
:rt000.cbl:9: Warning: DATE-WRITTEN is obsolete in IBM COBOL
:rt000.cbl:23: Error: syntax error, unexpected ORGANIZATION, expecting WORD or L [TERAL or DISPLAY
janilo@ununtu704:-/XcvtAStoJ/cvastoj_src$
IDENTIFICATION DIVISION.
PROGRAM-ID. crt000.
*************************************************************************
*
* CREAZIONE application java
*
*************************************************************************
AUTHOR. rosso.
DATE-WRITTEN. nov 1999.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. w95.
OBJECT-COMPUTER. w95.
SPECIAL-NAMES. DECIMAL-POINT IS COMMA.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT Entryplist ASSIGN TO DISK
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS WS-STAT-Entryplist.
SELECT errori ASSIGN TO DISK
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS WS-STAT-errori.
SELECT ambiente ASSIGN TO DISK
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS WS-STAT-ambiente.
SELECT srcrpg ASSIGN TO DISK
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS WS-STAT-srcrpg.
SELECT tabwrks ASSIGN TO DISK
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS WS-STAT-tabwrks.
SELECT tabwrk ASSIGN TO DISK
ORGANIZATION IS indexed
ACCESS MODE IS DYNAMIC
RECORD KEY IS iflk-wrk
ALTERNATE RECORD KEY IS nci-wrk WITH DUPLICATES
FILE STATUS IS WS-STAT-tabwrk.
DATA DIVISION.
FILE SECTION.
FD Entryplist LABEL RECORD IS STANDARD
VALUE OF FILE-ID IS "Entryp.txt"
DATA RECORD IS listarpg-REC.
01 Entryplist-REC.
05 parametro pic x(10).
******etc.****etc.*****etc*****
this program run fine under DOS with microsoft cobol and also under AIX/6000 with vs cobol compiler/6000.
----------------------------------------------------------------
DISK is a reserved word.
Roger
----------------------------------------------------------------
thanks for your reply, but was not correct:
yes, DISK is a reserved word but not for all cobol dialects.
below there is a little example what i find in the web, where DISK is used.
Ch 3_1. DATA DIVISION
FILE SECTION
* Describes Input/Output formats to be used by the program
IDENTIFICATION DIVISION.
PROGRAM-ID. COPY-THE-FIRTST-RECORD.
ENVIRONMENT SECTION.
SOURCE-COMPUTER. VAX-8800.
OBJECT-COMPUTER. VAX-8800.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT F1 ASSIGN TO DISK 'TST.DAT'
ORGANIZATION IS LINE SEQUENTIAL.
SELECT F2 ASSIGN TO DISK 'TST.RES'
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD F1 RECORD CONTATINS 35 CHARACTERS.
01 INPUT-REC.
03 NAME.
05 LAST-NAME PIC X(10).
05 FIRST-NAME PIC X(10).
03 SSN PIC X(9).
03 DOB-YYMMDD PIC X(6).
FD F2 RECORD CONTATINS 35 CHARACTERS.
01 OUTPUT-REC PIC X(35).
below there is sample from IBM manual COBOL_PRG_GUIDE_QB3AG402:
769CB1 V4R4M0 990521 LN IBM ILE COBOL for AS/400 TESTLIB/SAMPLE AS400SYS 98/11/20 16:46:03 Page 4
STMT PL SEQNBR -A 1 B..+....2....+....3....+....4....+....5....+....6....+....7..IDENTFCN S COPYNAME CHG DATE
A B C D E F
1 000030 IDENTIFICATION DIVISION.
2 000050 PROGRAM-ID. SAMPLE.
3 000060 AUTHOR. PROGRAMMER NAME.
4 000070 INSTALLATION. COBOL DEVELOPMENT CENTRE.
5 000080 DATE-WRITTEN. 02/24/94.
6 000090 DATE-COMPILED. 98/11/20 16:46:03
7 000110 ENVIRONMENT DIVISION.
8 000130 CONFIGURATION SECTION.
9 000140 SOURCE-COMPUTER. IBM-AS400.
10 000150 OBJECT-COMPUTER. IBM-AS400.
11 000170 INPUT-OUTPUT SECTION.
12 000180 FILE-CONTROL.
13 000190 SELECT FILE-1 ASSIGN TO DISK-SAMPLE.
15 000210 DATA DIVISION.
16 000230 FILE SECTION.
17 000240 FD FILE-1
000250 LABEL RECORDS ARE STANDARD
and also the clause ORGANIZATION is accepted:
Display Module Source
Program: MYPGM1 Library: TESTLIB Module: MYPGM1
1 IDENTIFICATION DIVISION.
2 PROGRAM-ID. MYPGM1.
3 *
4 * This is the main program that controls
5 * the external file processing.
6 *
7
8 ENVIRONMENT DIVISION.
9 INPUT-OUTPUT SECTION.
10 FILE-CONTROL.
11 SELECT EF1
12 ASSIGN TO DISK-EFILE1
13 FILE STATUS IS EFS1
14 ORGANIZATION IS SEQUENTIAL.
15
and there is a sample from AIX/6000
IDENTIFICATION DIVISION.
PROGRAM-ID. CRTDTAAR.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. RISC6000.
OBJECT-COMPUTER. RISC6000.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SBWARDLA ASSIGN TO DISK
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS BWNOM0
STATUS IS SBWST.
DATA DIVISION.
FILE SECTION.
FD SBWARDLA
VALUE OF FILE-ID IS 'SBWARDF0.DAT'
DATA RECORD BWARD-REC.
01 BWARD-REC.
05 BWNOM0 PIC X(10).
05 BWDAT0 PIC X(512).
So, during all mine experience with cobol, always I have used the clause
ASSIGN TO DISK and ORGANIZATION IS without problems.
----------------------------------------------------------------
Note the difference in your examples.
1) SELECT F1 ASSIGN TO DISK 'TST.DAT'
That's fine.
2) SELECT FILE-1 ASSIGN TO DISK-SAMPLE.
That's also fine. Refers to a (possibly implicit)
field.
3) SELECT SBWARDLA ASSIGN TO DISK
This is not OK.
MF, ACU and OC compile (1) and (2) fine.
None will compile (3).
Roger
----------------------------------------------------------------
Hi,
probably you have good reasons but my compilers on DOS or AS400 are not agree whit you.
cobol crtcab.cbl,,crtcab.lst >xcobc09.txt
Microsoft (R) COBOL Optimizing Compiler Version 3.00A
COBOL software by Micro Focus
Copyright (C) Microsoft Corporation 1984,1988. All rights reserved.
Copyright (C) Micro Focus Ltd. 1984,1988. All rights reserved.
Object listing [NUL.GRP]:
* Checking complete with no errors - starting code generation
* Data = 000006417 Code = 000007926 Dictionary = 000015727
Il volume nell'unit C non ha etichetta.
Numero di serie del volume: 2B49-1EDD
dir crtcab.* >>xcobc09.txt
Directory di C:\CVASTO~1
22/08/2006 19.36 24.774 crtcab.cbl
05/01/2008 11.00 11.008 CRTCAB.OBJ
05/01/2008 11.00 29.648 CRTCAB.LST
3 File 65.430 byte
0 Directory 238.345.977.856 byte disponibili
* Microsoft COBOL Version 3.00A L2.0 revision 054 05-Jan-08 11:00 Page 1
* CRTCAB.CBL
* Options: GNT(CRTCAB.OBJ) LIST(CRTCAB.LST) NOASMLIST
1 IDENTIFICATION DIVISION.
2 PROGRAM-ID. crtcab.
11 AUTHOR. rosso.
12 DATE-WRITTEN. nov 1999.
13 ENVIRONMENT DIVISION.
14
15 CONFIGURATION SECTION.
16 SOURCE-COMPUTER. w95.
17 OBJECT-COMPUTER. w95.
18
19 SPECIAL-NAMES. DECIMAL-POINT IS COMMA.
20
21 INPUT-OUTPUT SECTION.
22 FILE-CONTROL.
23
24 SELECT ambiente ASSIGN TO DISK
25 ORGANIZATION IS LINE SEQUENTIAL
26 FILE STATUS IS WS-STAT-ambiente.
27
28 SELECT listarpg ASSIGN TO DISK
29 ORGANIZATION IS LINE SEQUENTIAL
30 FILE STATUS IS WS-STAT-listarpg.
31
32 SELECT listafmt ASSIGN TO DISK
33 ORGANIZATION IS LINE SEQUENTIAL
34 FILE STATUS IS WS-STAT-listafmt.
35
36 SELECT srcrpg ASSIGN TO DISK
37 ORGANIZATION IS LINE SEQUENTIAL
38 FILE STATUS IS WS-STAT-srcrpg.
39
40 SELECT srcrpgo ASSIGN TO DISK
41 ORGANIZATION IS LINE SEQUENTIAL
42 FILE STATUS IS WS-STAT-srcrpgo.
43
44 SELECT mdsrcj ASSIGN TO DISK
45 ORGANIZATION IS LINE SEQUENTIAL
46 FILE STATUS IS WS-STAT-mdsrcj.
47
49 DATA DIVISION.
51 FILE SECTION.
53
54 FD listarpg LABEL RECORD IS STANDARD
55 VALUE OF FILE-ID IS "listarpg.txt"
56 DATA RECORD IS listarpg-REC.
57 01 listarpg-REC.
* Microsoft COBOL Version 3.00A L2.0 revision 054 05-Jan-08 11:00 Page 2
* CRTCAB.CBL
58 10 WHFILE.
59 15 primicar.
60 17 filler pic x.
61 17 whfuno pic x.
62 15 restocar.
63 17 filler pic x(4).
64 17 whfSET pic x.
70 17 filler pic x(3).
71 15 filler pic x(40).
72
73 FD listafmt LABEL RECORD IS STANDARD
74 VALUE OF FILE-ID IS "listafmt.txt"
75 DATA RECORD IS listafmt-REC.
76
77 01 listafmt-REC.
78 10 nomevideo pic x(10).
79 10 nomepgm pic x(10).
80 10 filler pic x(80).
81
82 FD srcrpgo LABEL RECORD IS STANDARD
83 VALUE OF FILE-ID IS nome-srcrpgo
90 DATA RECORD IS srcrpgo-REC.
91 01 srcrpgo-REC.
92 05 filler pic x(100).
93
94 FD srcrpg LABEL RECORD IS STANDARD
95 VALUE OF FILE-ID IS nome-srcrpg
96 DATA RECORD IS srcrpg-REC.
97 01 srcrpg-REC.
98 05 filler pic x(100).
99
100 FD mdsrcj LABEL RECORD IS STANDARD
101 VALUE OF FILE-ID IS nome-mdsrcj
102 DATA RECORD IS mdsrcj-REC.
103 01 mdsrcj-REC.
104
105 05 filler pic x(100).
108 FD ambiente LABEL RECORD IS STANDARD
109 VALUE OF FILE-ID IS "ambiente.txt"
110 DATA RECORD IS ambiente-REC.
111
112 01 ambiente-REC.
113 05 creads.
114 12 filler pic x(4).
115 12 nomeamb pic x(100).
* Microsoft COBOL Version 3.00A L2.0 revision 054 05-Jan-08 11:00 Page 3
* CRTCAB.CBL
*****************************************************************
etc etc etc
*****************************************************************
773
* Microsoft COBOL Version 3.00A L2.0 revision 054
* (C)Copyright Microsoft Corp 1984, 1988 URN AXUPA/MS0/40640
* REF GNB-007047054A4
*
* Total Messages: 0
* Data: 6364 Code: 3609 Dictionary: 4800
On AS/400, there are little differences regarding the position of SELECT word that on AS must be in col. B.
0000.53 12 002300 SELECT ambiente ASSIGN TO DISK 05/01/08
0000.54 13 002400 ORGANIZATION IS SEQUENTIAL 05/01/08
0000.55 14 002500 FILE STATUS IS WS-STAT-ambiente.
0008.43 * * * * * E N D O F S O U R C E * * * * *
0008.44 5763CB1 V3R2M0 960517 AS/400 COBOL Messages DANILO/CRTCAB S4409058 05/01/08 14:13:43
0008.45 STMT
0008.46 * 12 MSGID: LBL0010 SEVERITY: 10 SEQNBR: 002300
0008.47 Message . . . . : 'SELECT' invalid in Area A. Accepted as if
0008.48 in Area B.
5763CB1 V3R2M0 960517 IBM COBOL/400 DANILO/CRTCAB S4409058 05/01/08
Program . . . . . . . . . . . . . . : CRTCAB
Library . . . . . . . . . . . . . : DANILO
Source file . . . . . . . . . . . . : QCBLSRC
Library . . . . . . . . . . . . . : DANILO
Source member . . . . . . . . . . . : CRTCAB 05/01/08 11:27:11
Generation severity level . . . . . : 29
Text 'description' . . . . . . . . . : *BLANK
Source listing options . . . . . . . : *NONE
Generation options . . . . . . . . . : *NONE
Conversion options . . . . . . . . . : *NONE
Sort sequence . . . . . . . . . . . : *HEX
Library . . . . . . . . . . . . . :
Language identifier . . . . . . . . : *JOBRUN
Message limit:
Number of messages . . . . . . . . : *NOMAX
Message limit severity . . . . . . : 29
Print file . . . . . . . . . . . . . : QSYSPRT
Library . . . . . . . . . . . . . : *LIBL
FIPS flagging . . . . . . . . . . . : *NOFIPS *NOSEG *NODEB *NOOBSOLETE
SAA flagging . . . . . . . . . . . . : *NOFLAG
Extended display options . . . . . . : *NONE
Flagging severity . . . . . . . . . : 0
Replace program . . . . . . . . . . : *NO
Target release . . . . . . . . . . . : *CURRENT
User profile . . . . . . . . . . . . : *USER
Authority . . . . . . . . . . . . . : *LIBCRTAUT
Compiler . . . . . . . . . . . . . . : IBM COBOL/400
5763CB1 V3R2M0 960517 AS/400 COBOL Source DANILO/CRTCAB S4409058 05/01/08
STMT SEQNBR -A 1 B..+....2....+....3....+....4....+....5....+....6....+....7..IDENTFCN S COPYNAME CHG
1 000100 IDENTIFICATION DIVISION.
2 000200 PROGRAM-ID. crtcab.
3 001000 AUTHOR. rosso.
4 001100 DATE-WRITTEN. nov 1999.
5 001200 ENVIRONMENT DIVISION.
001300
6 001400 CONFIGURATION SECTION.
7 001500 SOURCE-COMPUTER. w95.
8 001600 OBJECT-COMPUTER. w95.
001700
9 001800 SPECIAL-NAMES. DECIMAL-POINT IS COMMA.
001900
10 002000 INPUT-OUTPUT SECTION.
11 002100 FILE-CONTROL.
002200
12 002300 SELECT ambiente ASSIGN TO DISK 05/0
13 002400 ORGANIZATION IS SEQUENTIAL 05/0
14 002500 FILE STATUS IS WS-STAT-ambiente.
002600
15 002700 SELECT listarpg ASSIGN TO DISK 05/0
16 002800 ORGANIZATION IS SEQUENTIAL 05/0
17 002900 FILE STATUS IS WS-STAT-listarpg.
003000
18 003100 SELECT listafmt ASSIGN TO DISK 05/0
19 003200 ORGANIZATION IS SEQUENTIAL 05/0
20 003300 FILE STATUS IS WS-STAT-listafmt.
003400
21 003500 SELECT srcrpg ASSIGN TO DISK 05/0
22 003600 ORGANIZATION IS SEQUENTIAL 05/0
23 003700 FILE STATUS IS WS-STAT-srcrpg.
003800
24 003900 SELECT srcrpgo ASSIGN TO DISK 05/0
25 004000 ORGANIZATION IS SEQUENTIAL 05/0
26 004100 FILE STATUS IS WS-STAT-srcrpgo.
004200
27 004300 SELECT mdsrcj ASSIGN TO DISK 05/0
28 004400 ORGANIZATION IS SEQUENTIAL 05/0
29 004500 FILE STATUS IS WS-STAT-mdsrcj.
004600
004700
30 004800 DATA DIVISION.
004900
31 005000 FILE SECTION.
005100
005200
32 005300 FD listarpg LABEL RECORD IS STANDARD
33 005400 VALUE OF FILE-ID IS "listarpg.txt"
34 005500 DATA RECORD IS listarpg-REC.
5763CB1 V3R2M0 960517 AS/400 COBOL Source DANILO/CRTCAB S4409058 05/01/08
STMT SEQNBR -A 1 B..+....2....+....3....+....4....+....5....+....6....+....7..IDENTFCN S COPYNAME CHG
35 005600 01 listarpg-REC.
36 005700 10 WHFILE.
37 005800 15 primicar.
38 005900 17 filler pic x.
39 006000 17 whfuno pic x.
40 006100 15 restocar.
41 006200 17 filler pic x(4).
42 006300 17 whfSET pic x.
43 006900 17 filler pic x(3).
44 007000 15 filler pic x(40).
007100
45 007200 FD listafmt LABEL RECORD IS STANDARD
46 007300 VALUE OF FILE-ID IS "listafmt.txt"
47 007400 DATA RECORD IS listafmt-REC.
007500
48 007600 01 listafmt-REC.
49 007700 10 nomevideo pic x(10).
50 007800 10 nomepgm pic x(10).
51 007900 10 filler pic x(80).
008000
52 008100 FD srcrpgo LABEL RECORD IS STANDARD
53 008200 VALUE OF FILE-ID IS nome-srcrpgo
008300
54 008900 DATA RECORD IS srcrpgo-REC.
55 009000 01 srcrpgo-REC.
56 009100 05 filler pic x(100).
009200
57 009300 FD srcrpg LABEL RECORD IS STANDARD
58 009400 VALUE OF FILE-ID IS nome-srcrpg
59 009500 DATA RECORD IS srcrpg-REC.
60 009600 01 srcrpg-REC.
61 009700 05 filler pic x(100).
009800
62 009900 FD mdsrcj LABEL RECORD IS STANDARD
63 010000 VALUE OF FILE-ID IS nome-mdsrcj
64 010100 DATA RECORD IS mdsrcj-REC.
65 010200 01 mdsrcj-REC.
010300
66 010400 05 filler pic x(100).
010500
010600
67 010700 FD ambiente LABEL RECORD IS STANDARD
68 010800 VALUE OF FILE-ID IS "ambiente.txt"
69 010900 DATA RECORD IS ambiente-REC.
011000
5763CB1 V3R2M0 960517 AS/400 COBOL Source DANILO/CRTCAB S4409058 05/01/08
STMT SEQNBR -A 1 B..+....2....+....3....+....4....+....5....+....6....+....7..IDENTFCN S COPYNAME CHG
70 011100 01 ambiente-REC.
71 011200 05 creads.
72 011300 12 filler pic x(4).
73 011400 12 nomeamb pic x(100).
********************************************************************
etc etc etc
********************************************************************
* * * * * E N D O F S O U R C E * * * * *
5763CB1 V3R2M0 960517 AS/400 COBOL Messages DANILO/CRTCAB S4409058 05/01/08
STMT
* 32 MSGID: LBL0650 SEVERITY: 00 SEQNBR: 005300
Message . . . . : Blocking/Deblocking for file 'LISTARPG' will
be performed by compiler-generated code.
********************************************************************
etc etc etc
********************************************************************
* * * * * E N D O F M E S S A G E S * * * * *
Message Summary
Total Info(0-4) Warning(5-19) Error(20-29) Severe(30-39) Terminal(40-99)
60 6 51 3 0 0
Source records read . . . . . . . . : 784
Copy records read . . . . . . . . . : 0
Copy members processed . . . . . . : 0
Sequence errors . . . . . . . . . . : 0
Highest severity message issued . . : 20
LBL0901 00 Program CRTCAB created in library DANILO on 05/01/08 11:27:53.
* * * * * E N D O F C O M P I L A T I O N * * * * *
Actually I can not try on AIX/6000 or other unix hardware, but please believe me, all my sources cobol whit the select like this are ok.
Now on ubuntu with cobc (the same source that AS400):
danilo@ununtu704:-/XcvtAStoJ/cvastoj_src$ cobc -x -std=mf crtcab3.cbl
crtcab3.cbl:24: Error: syntax error, unexpected ORGANlZATION, expecting WORD or LITERAL or DISPLAY
danilo@ununtu704:-/XcvtAStoJ/cvastoj_src$
the error is always the same, but with the option -free, there is a different error:
danilo@ununtu704:-/XcvtAStoJ/cvastoj_src$ cobc -x -std=mf -free crtcab3.cbl
crtcab3.cbl:359: Error: syntax error
danilo@ununtu704:-/XcvtAStOJ/cvastoj_src$ I
the line 359 is a comment:
*-----------------------------------------------------------------
* CHIUSURA ARCHIVI
*-----------------------------------------------------------------
INIZIO-CLOSE.
CLOSE srcrpg srcrpgo mdsrcj listarpg
listafmt.
FINE-CLOSE.
EXIT.
*-----------------------------------------------------------------
* ELABORAZIONE ARCHIVIO PER CREAZIONE COPY
359 *-----------------------------------------------------------------
INIZIO-ELAB.
thanks for your courtesy
Danilo
----------------------------------------------------------------
In free-format, the '*' is not, on it's own,
a comment.
In free format a comment area is indicated
by "*>".
Roger
----------------------------------------------------------------
And since day 1 of COBOL,
the asterisk '*' is in column 7.
(Fixed format)
Compatibly for comments,re fixed/free -
then columns 1-6 should be
spaces and columns 7-8 should
contain '*>'.
Roger
----------------------------------------------------------------
Ok
sorry, but this not solve my first problem:
danilo@ununtu704:-/XcvtAStoJ/cvastoj_src$ cobc -x -std=mf crtcab3.cbl
crtcab3.cbl:24: Error: syntax error, unexpected ORGANlZATION, expecting WORD or LITERAL or DISPLAY
danilo@ununtu704:-/XcvtAStoJ/cvastoj_src$
cobc accept the standard cobol syntax like Micro Focus ?
yes
or
yes but not fully?
The -free option doesn't interest me , but only out of curriosity:
whi the '*' used for comment is checked out only at line 359 and not
at the precedent lines?
*-----------------------------------------------------------------
* CHIUSURA ARCHIVI
*-----------------------------------------------------------------
INIZIO-CLOSE.
CLOSE srcrpg srcrpgo mdsrcj listarpg
listafmt.
FINE-CLOSE.
EXIT.
*-----------------------------------------------------------------
* ELABORAZIONE ARCHIVIO PER CREAZIONE COPY
359 *-----------------------------------------------------------------
INIZIO-ELAB.
Happy New Year
----------------------------------------------------------------
I know,
was a mistake during the paste,
I believe you can understand alone,
because in the postlist there are 0 errors
* Microsoft COBOL Version 3.00A L2.0 revision 054
* (C)Copyright Microsoft Corp 1984, 1988 URN AXUPA/MS0/40640
* REF GNB-007047054A4
*
* Total Messages: 0
* Data: 6364 Code: 3609 Dictionary: 4800
Message Summary
Total Info(0-4) Warning(5-19) Error(20-29) Severe(30-39) Terminal(40-99)
60 6 51 3 0 0
Source records read . . . . . . . . : 784
Copy records read . . . . . . . . . : 0
Copy members processed . . . . . . : 0
Sequence errors . . . . . . . . . . : 0
Highest severity message issued . . : 20
LBL0901 00 Program CRTCAB created in library DANILO on 05/01/08 11:27:53.
* * * * * E N D O F C O M P I L A T I O N * * * * *
Bye Bye
----------------------------------------------------------------
While that is NOT standard COBOL syntax!
Roger
----------------------------------------------------------------
While we do try to put in features
that are MF/ACU specificic, there
comes a time when I say no.
This is one of them.
Roger
----------------------------------------------------------------
Actually, as the changes are fairly minimal,
I have implemented ASSIGN DISK combined
with FILE-ID.
Pick up the latest 1.1 tarball.
Roger
----------------------------------------------------------------
Subject: Finding Dead Code
Does anyone have any suggestions for identifying dead code in a large COBOL project?
I have read some other forums where folks suggest that some compilers automatically eliminate dead code.
I am also looking for hints on getting familiar with the code in a large project.
----------------------------------------------------------------
I remember when MicroFocus introduced their COBOL Animator product. It was the first time I was able to watch code in action. Now these tools are available in many compilers. I have always found this a good way to understand what a program is doing.
Good luck!
----------------------------------------------------------------
Does someone has anything similar for OC?
You could write a cobol program for dead code, doing the following:
1. Open the list file
2. Search for all section names
3. Search if there is a perform on all sections
4. Search if the section is hidden in a copy file
- if yes: Are all sections of this copy not used: give an output "COPY XYZ can be removed from TEST.CBL"
- if not give an output "Section XYZ can be removed from TEST.CBL"
5. Search for all defined vars
6. Search if the vars from level 77 and 78 are used and if the level 01 or underlying levels are used.
7. Search if the section is hidden in a copy file
- if yes: Are all vars of this copy not used: give an output "COPY XYZ can be removed from TEST.CBL"
- if not give an output "Definition of XYZ can be removed from TEST.CBL"
8. Have a look if the lines are only comments for all searches mentioned above.
And there you go! (I would test your program but do not have the need to write it for my own).
PS: The named link "Visustin Flow chart generator" in link area does not work for my projects very well, maybe there are other (free?) tools to visualize Cobol Code.
----------------------------------------------------------------
Problem is that COBOL allows you to
call a procedure-pointer which is
not determinable.
Roger
----------------------------------------------------------------
What does this look like?
----------------------------------------------------------------
procedure-pointer.
Roger
----------------------------------------------------------------
A new (to OC) product has been uploaded onto OC site subject to Roger making it avail that will cross reference cobol source programs/ This will help in finding code ie sections, variables etc that are defined but not used.
This will be a step in the right direction for your requirements.
----------------------------------------------------------------
What OC site do you mean? SF does not contain anything like that?
For everybody who does not know what a procedure-pointer is, it seems to be some special MF/COB370 thing:
http://supportline.microfocus.com/documentation/books/nx50/lhclan.htm#u945
----------------------------------------------------------------
Does anybody know something about the program that "has been uploaded"?
----------------------------------------------------------------
Subject: opencobol on arch=powerpc
hi,
I have installed opencobol 1.0 in my apple-mini-ppc
but at DISPLAY I have:
Illegal instruction
can you help me ?
----------------------------------------------------------------
How about posting/sending "config.log".
Roger
----------------------------------------------------------------
As we generate C code and pass that to
the C compiler, I don't think that this
is an OC problem.
Try generating to C code and post.
Roger
----------------------------------------------------------------
* Sample COBOL program
IDENTIFICATION DIVISION.
PROGRAM-ID. hello.
PROCEDURE DIVISION.
DISPLAY "Hello World!".
STOP RUN.
this is source
what have I to try ?
thanks
----------------------------------------------------------------
this is hello.s
.file "cob12607_0.c"
.section ".text"
.align 2
.type hello_, @function
hello_:
cmpwi 7,3,0
stwu 1,-32(1)
mflr 0
stw 26,8(1)
stw 27,12(1)
stw 28,16(1)
stw 29,20(1)
stw 30,24(1)
stw 31,28(1)
stw 0,36(1)
blt- 7,.L16
lis 27,.LANCHOR0@ha
lis 9,cob_current_module@ha
lwz 28,.LANCHOR0@l(27)
lis 31,.LANCHOR1@ha
la 30,.LANCHOR0@l(27)
lwz 0,cob_current_module@l(9)
la 26,.LANCHOR1@l(31)
addi 11,30,16
cmpwi 7,28,0
stw 26,cob_current_module@l(9)
addi 29,30,32
stw 0,.LANCHOR1@l(31)
beq- 7,.L17
.L8:
.L13:
lis 9,cob_call_params@ha
li 3,0
lwz 0,cob_call_params@l(9)
lis 9,cob_save_call_params@ha
addi 6,26,28
li 4,1
li 5,1
stw 0,cob_save_call_params@l(9)
stw 0,0(11)
crxor 6,6,6
bl cob_new_display
lwz 3,0(29)
bl cob_stop_run
.L16:
lis 9,.LANCHOR0@ha
lwz 0,.LANCHOR0@l(9)
cmpwi 7,0,0
beq- 7,.L4
li 0,0
stw 0,.LANCHOR0@l(9)
.L4:
lwz 0,36(1)
li 3,0
lwz 26,8(1)
lwz 27,12(1)
mtlr 0
lwz 28,16(1)
lwz 29,20(1)
lwz 30,24(1)
lwz 31,28(1)
addi 1,1,32
blr
.L17:
lis 9,cob_initialized@ha
lwz 0,cob_initialized@l(9)
cmpwi 7,0,0
beq- 7,.L18
lis 3,.LC0@ha
lis 4,.LC1@ha
la 3,.LC0@l(3)
la 4,.LC1@l(4)
li 5,0
bl cob_check_version
lwz 0,.LANCHOR1@l(31)
cmpwi 7,0,0
beq- 7,.L11
lis 3,.LC2@ha
lis 4,hello@ha
lis 5,hello_@ha
la 3,.LC2@l(3)
la 4,hello@l(4)
la 5,hello_@l(5)
bl cob_set_cancel
.L11:
li 0,1
addi 29,30,32
stw 28,16(30)
addi 11,30,16
stw 0,.LANCHOR0@l(27)
stw 28,32(30)
stw 28,48(30)
b .L8
.L18:
li 3,0
bl cob_fatal_error
.size hello_, .-hello_
.align 2
.globl hello
.type hello, @function
hello:
li 3,0
b hello_
.size hello, .-hello
.section ".data"
.align 2
.set .LANCHOR1,. + 0
.type module.6231, @object
.size module.6231, 28
module.6231:
.long 0
.long 0
.long 0
.long 0
.long cob_user_parameters.6230
.byte 0
.byte 46
.byte 36
.byte 44
.byte 1
.byte 1
.byte 1
.byte 0
.type c_1.6228, @object
.size c_1.6228, 12
c_1.6228:
.long 12
.long .LC3
.long a_1.6227
.type a_1.6227, @object
.size a_1.6227, 8
a_1.6227:
.byte 33
.byte 0
.byte 0
.byte 0
.long 0
.section .rodata.str1.4,"aMS",@progbits,1
.align 2
.LC0:
.string "hello.cob"
.zero 2
.LC1:
.string "1.0"
.LC2:
.string "hello"
.zero 2
.LC3:
.string "Hello World!"
.section ".bss"
.align 4
.set .LANCHOR0,. + 0
.type initialized.6229, @object
.size initialized.6229, 4
initialized.6229:
.zero 4
.zero 12
.type b_3.6226, @object
.size b_3.6226, 4
b_3.6226:
.zero 4
.zero 12
.type b_1.6224, @object
.size b_1.6224, 4
b_1.6224:
.zero 4
.zero 12
.type b_2.6225, @object
.size b_2.6225, 4
b_2.6225:
.zero 4
.type cob_user_parameters.6230, @object
.size cob_user_parameters.6230, 256
cob_user_parameters.6230:
.zero 256
.ident "GCC: (GNU) 4.2.2"
.section .note.GNU-stack,"",@progbits
----------------------------------------------------------------
You have a broken GCC.
Roger
----------------------------------------------------------------
what do you mean "brocken GCC" ?
I in my archlinux-powerpc I have:
gcc 4.2.2-4
gcc-gcj 4.2.2-1
gcc-libs 4.2.2-3
libgcc-legacy 3.3.6-2
what is wring ?
thanks
----------------------------------------------------------------
If you are getting "illegal instruction", then
GCC is producing illegal code.
Try contacting your system supplier.
What exactly is your platform/OS ?
Roger
----------------------------------------------------------------
I have:
apple-mini-powerpc
archlinux
Linux powerpc-linux-gnu 2.6.23-ARCH #1 Fri Oct 19 16:14:36 UTC 2007 ppc 7447A, altivec supported PowerMac10,1 GNU/Linux
p.s.
I have to build with gcc3 or gcc 4 ?
----------------------------------------------------------------
It is quite simple.
Your GCC 4.2.2 is not usable!
Complain to your supplier!
Roger
----------------------------------------------------------------
this is hello.s from same source but from my linux-x86
NOTE I have segmentation in x86 too
---------------------------------------------------------
.file "cob19369_0.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "1.0"
.LC1:
.string "hello.cob"
.LC2:
.string "hello"
.text
.p2align 4,,15
.type hello_, @function
hello_:
pushl %ebp
movl %esp, %ebp
subl $24, %esp
movl 8(%ebp), %eax
testl %eax, %eax
js .L16
movl initialized.7401, %ecx
movl cob_current_module, %eax
movl $module.7403, cob_current_module
testl %ecx, %ecx
movl %eax, module.7403
je .L17
.L8:
.L13:
movl cob_call_params, %eax
movl $c_1.7400, 12(%esp)
movl $1, 8(%esp)
movl $1, 4(%esp)
movl %eax, b_3.7398
movl %eax, cob_save_call_params
movl $0, (%esp)
call cob_new_display
movl b_1.7396, %eax
movl %eax, (%esp)
call cob_stop_run
.L16:
movl initialized.7401, %eax
testl %eax, %eax
je .L4
movl $0, initialized.7401
.L4:
leave
xorl %eax, %eax
ret
.L17:
movl cob_initialized, %edx
testl %edx, %edx
je .L18
movl $0, 8(%esp)
movl $.LC0, 4(%esp)
movl $.LC1, (%esp)
call cob_check_version
movl module.7403, %eax
testl %eax, %eax
je .L11
movl $hello_, 8(%esp)
movl $hello, 4(%esp)
movl $.LC2, (%esp)
call cob_set_cancel
.L11:
movl $0, b_1.7396
movl $0, b_2.7397
movl $0, b_3.7398
movl $1, initialized.7401
jmp .L8
.L18:
movl $0, (%esp)
call cob_fatal_error
.size hello_, .-hello_
.p2align 4,,15
.globl hello
.type hello, @function
hello:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
movl $0, (%esp)
call hello_
leave
ret
.size hello, .-hello
.data
.align 4
.type module.7403, @object
.size module.7403, 28
module.7403:
.long 0
.long 0
.long 0
.long 0
.long cob_user_parameters.7402
.byte 0
.byte 46
.byte 36
.byte 44
.byte 1
.byte 1
.byte 1
.byte 0
.local initialized.7401
.comm initialized.7401,4,4
.section .rodata.str1.1
.LC3:
.string "Hello World!"
.data
.align 4
.type c_1.7400, @object
.size c_1.7400, 12
c_1.7400:
.long 12
.long .LC3
.long a_1.7399
.local b_3.7398
.comm b_3.7398,4,16
.local b_2.7397
.comm b_2.7397,4,16
.local b_1.7396
.comm b_1.7396,4,16
.local cob_user_parameters.7402
.comm cob_user_parameters.7402,256,32
.align 4
.type a_1.7399, @object
.size a_1.7399, 8
a_1.7399:
.byte 33
.byte 0
.byte 0
.byte 0
.long 0
.ident "GCC: (GNU) 4.2.2"
.section .note.GNU-stack,"",@progbits
----------------------------------------------------------------
How are you compiling?
How are you executing?
You should be doing something like this -
cobc -x hello.cob
./hello
or -
cobc hello.cob
cobcrun hello
Roger
----------------------------------------------------------------
ho it works
with -x parameter it works
thankyou
and
sorry
----------------------------------------------------------------
Subject: C Interface Manual chapter updated
Hi,
I compiled the samples from the C Interface chapter, there were same #includes missing from the C samples. Same for -x to generate executables from Cobol.
But now the samples all work.
Juergen
----------------------------------------------------------------
Thanks.
Much needed.
I need help from users to maintain
this.
Roger
----------------------------------------------------------------
How current is the Tasks section? What other things would you like help with?
----------------------------------------------------------------
I updated the tasks section.
It is current.
Roger
----------------------------------------------------------------
We need help in all categories.
I do not have the time to update
everything.
Somebody posted that they would like
a complete syntax for OC.
Going by what MF has, this would be
ca: 800 pages (For the syntax alone,
and ignoring the specfic MF
things like eg. file handling)
!!
Anybody want to do that?
Generally, OC goes by standards/MF/ACU
rules so that syntax is elsewhere
defined.
Roger
----------------------------------------------------------------
Subject: Dereference a POINTER - how?
I wonder how to dereference a POINTER, i.e. how do you access the data pointed to.
[url=http://home.swbell.net/mck9/cobol/tech/cobolptr.html]http://home.swbell.net/mck9/cobol/tech/cobolptr.html[/url]
suggests
[quote]
So I've Got an Address. Now What?
You have a pointer EXAMPLE-P which points to an object of some known type. Set up an instance of such an object in the LINKAGE SECTION:
LINKAGE SECTION.
01 NAME-STRUCTURE.
05 FIRST-NAME PIC X(18).
05 LAST-NAME PIC X(26).
Now use the SET verb:
SET ADDRESS OF NAME-STRUCTURE TO EXAMPLE-P.
[/quote]
I couldn't get that to work with OpenCobol.
[code]/tmp/cob4482_0.c: In function 'say_':
/tmp/cob4482_0.c:109: error: invalid lvalue in assignment
[/code]
How do you dereference a POINTER with OpenCobol?
Thanks,
Juergen
----------------------------------------------------------------
Works fine here -
WORKING-STORAGE SECTION.
01 PTR-P USAGE POINTER.
LINKAGE SECTION.
01 MY01.
03 MYV1 PIC X.
03 MYV2 PIC X.
PROCEDURE DIVISION.
SET ADDRESS OF MY01 TO PTR-P.
Maybe post the complete example.
Roger
----------------------------------------------------------------
We are getting this error too.
/tmp/cob71864_0.c: In function 'envtest_':
/tmp/cob71864_0.c:155: error: invalid lvalue in assignment
We are using OC version 1.1 on the AIX system.
Compile statement: cobc -x -o envtest envtest.cbl -I/usr/include -L/usr/lib -lc
envtest.cbl code:
IDENTIFICATION DIVISION.
PROGRAM-ID. envtest.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 ENVTAG PIC X(4) VALUE "TEST".
01 ENVSTR PIC X(11) VALUE "TEST=value!".
01 WS-ENVIRON-VARIABLE-STRING PIC X(31).
01 WS-ENVIRON-VARIABLE-LENGTH PIC 9(03).
01 WS-RESULT-STRING-POINTER USAGE POINTER.
01 WS-STRIP-RESULT-STRING PIC X(160).
01 WS-STRIP-RESULT-STRING-SIZE PIC S9(04) COMP.
01 WS-MAX-ENVIRON-VALUE-SIZE PIC 9(02) VALUE 30.
LINKAGE SECTION.
01 WS-RESULT-STRING PIC X(160).
PROCEDURE DIVISION.
DISPLAY "Environment string to be set: " ENVSTR.
CALL "putenv" USING BY REFERENCE ENVSTR.
DISPLAY "Need to retrieve ENVIRONMENT VARIABLE".
DISPLAY "Attempt to retrieve environment variable: " ENVTAG.
CALL "getenv" USING BY REFERENCE ENVTAG
RETURNING WS-RESULT-STRING-POINTER.
DISPLAY "Environment value returned for " ENVTAG " is: "
WS-RESULT-STRING-POINTER
IF WS-RESULT-STRING-POINTER <> NULL
DISPLAY "pointer is not null "
SET ADDRESS OF WS-RESULT-STRING
TO WS-RESULT-STRING-POINTER
UNSTRING WS-RESULT-STRING DELIMITED BY LOW-VALUE
INTO WS-STRIP-RESULT-STRING
COUNT IN WS-STRIP-RESULT-STRING-SIZE
END-UNSTRING
DISPLAY "Environment value returned for " ENVTAG " is: "
WS-STRIP-RESULT-STRING
END-IF.
IF WS-RESULT-STRING-POINTER = NULL
DISPLAY "string is NULL"
END-IF.
DISPLAY "End"
STOP RUN.
Any idea why??
:-)
----------------------------------------------------------------
Post the envtest.c and envtest.c.h genned
by cobc -xC envtest.cbl
(And, as in another thread, this is not the way to do
something like this; there are perfectly good Cobol
routines ala. MF/ACU for this)
Roger
----------------------------------------------------------------
envtest.c:
/* Generated from envtest.cbl by cobc 1.1.0 (Build date - May 21 2008 13:48:58) */
#define __USE_STRING_INLINES 1
#ifndef _XOPEN_SOURCE_EXTENDED
#define _XOPEN_SOURCE_EXTENDED 1
#endif
#include
#include
#include
#include
#define WORDS_BIGENDIAN 1
#include
#define COB_SOURCE_FILE "envtest.cbl"
#define COB_PACKAGE_VERSION "1.1"
#define COB_PATCH_LEVEL 0
/* function prototypes */
static int envtest_ (const int);
int envtest (void);
int
main (int argc, char **argv)
{
cob_init (argc, argv);
cob_stop_run (envtest ());
}
/* functions */
int
envtest ()
{
return envtest_ (0);
}
/* end functions */
static int
envtest_ (const int entry)
{
#include "envtest.c.h" /* local variables */
static int initialized = 0;
static cob_field *cob_user_parameters[COB_MAX_FIELD_PARAMS];
static cob_module module = { NULL, NULL, NULL, NULL, cob_user_parameters, 0, '.', '$', ',', 1, 1, 1, 0};
/* LINKAGE SECTION */
unsigned char *b_13 = NULL; /* WS-RESULT-STRING */
/* perform frame stack */
int frame_index;
struct frame {
int perform_through;
void *return_address;
} frame_stack[255];
/* Start of function code */
if (unlikely(entry < 0)) {
if (!initialized) {
return 0;
}
initialized = 0;
return 0;
}
module.next = cob_current_module;
cob_current_module = &module;
if (unlikely(initialized == 0))
{
if (!cob_initialized) {
cob_fatal_error (COB_FERROR_INITIALIZED);
}
cob_check_version (COB_SOURCE_FILE, COB_PACKAGE_VERSION, COB_PATCH_LEVEL);
(*(int *) (b_1)) = 0;
(*(int *) (b_2)) = 0;
(*(int *) (b_3)) = 0;
memcpy (b_5, "TEST", 4);
memcpy (b_6, "TEST=value!", 11);
memset (b_7, 32, 31);
memset (b_8, 48, 3);
memset (b_9, 0, 4);
memset (b_10, 32, 160);
memset (b_11, 0, 2);
memcpy (b_12, "30", 2);
initialized = 1;
}
/* initialize frame stack */
frame_index = 0;
frame_stack[0].perform_through = -1;
/* initialize number of call params */
(*(int *) (b_3)) = cob_call_params;
cob_save_call_params = cob_call_params;
goto l_2;
/* PROCEDURE DIVISION */
/* envtest: */
l_2:;
/* MAIN SECTION: */
/* MAIN PARAGRAPH: */
/* envtest.cbl:20: DISPLAY */
{
cob_new_display (0, 1, 2, &c_1, &f_6);
}
/* envtest.cbl:21: CALL */
{
{
int (*func)();
module.cob_procedure_parameters[0] = &f_6;
module.cob_procedure_parameters[1] = NULL;
module.cob_procedure_parameters[2] = NULL;
module.cob_procedure_parameters[3] = NULL;
module.cob_procedure_parameters[4] = NULL;
cob_call_params = 1;
func = cob_resolve_1 ((const char *)"putenv");
(*(int *) (b_1)) = func (b_6);
}
}
/* envtest.cbl:23: DISPLAY */
{
cob_new_display (0, 1, 1, &c_2);
}
/* envtest.cbl:25: DISPLAY */
{
cob_new_display (0, 1, 2, &c_3, &f_5);
}
/* envtest.cbl:27: CALL */
{
{
void * (*func)();
module.cob_procedure_parameters[0] = &f_5;
module.cob_procedure_parameters[1] = NULL;
module.cob_procedure_parameters[2] = NULL;
module.cob_procedure_parameters[3] = NULL;
module.cob_procedure_parameters[4] = NULL;
cob_call_params = 1;
func = cob_resolve_1 ((const char *)"getenv");
(cob_get_pointer (b_9)) = func (b_5);
}
}
/* envtest.cbl:30: DISPLAY */
{
cob_new_display (0, 1, 4, &c_4, &f_5, &c_5, &f_9);
}
/* envtest.cbl:33: IF */
{
if (((int)((cob_get_pointer (b_9)) - (unsigned char *)NULL) != 0))
{
/* envtest.cbl:35: DISPLAY */
{
cob_new_display (0, 1, 1, &c_6);
}
/* envtest.cbl:37: SET */
{
{
void *temp_ptr;
memcpy(&temp_ptr, b_9, sizeof(temp_ptr));
b_13 = temp_ptr;
}
}
/* envtest.cbl:39: UNSTRING */
{
cob_unstring_init ((f_13.data = b_13, &f_13), 0, 1);
cob_unstring_delimited (&cob_low, 0);
cob_unstring_into (&f_10, 0, &f_11);
cob_unstring_finish ();
}
/* envtest.cbl:44: DISPLAY */
{
cob_new_display (0, 1, 4, &c_4, &f_5, &c_5, &f_10);
}
}
}
/* envtest.cbl:48: IF */
{
if (((int)((cob_get_pointer (b_9)) - (unsigned char *)NULL) == 0))
{
/* envtest.cbl:49: DISPLAY */
{
cob_new_display (0, 1, 1, &c_7);
}
}
}
/* envtest.cbl:51: DISPLAY */
{
cob_new_display (0, 1, 1, &c_8);
}
/* envtest.cbl:52: STOP */
{
cob_stop_run ((*(int *) (b_1)));
}
cob_current_module = cob_current_module->next;
return (*(int *) (b_1));
}
/* end function stuff */
envtest.c.h:
/* Generated from envtest.cbl by cobc 1.1.0 (Build date - May 21 2008 13:48:58) */
/* PROGRAM-ID : envtest */
static unsigned char b_1[4] __attribute__((aligned)); /* RETURN-CODE */
static unsigned char b_2[4] __attribute__((aligned)); /* SORT-RETURN */
static unsigned char b_3[4] __attribute__((aligned)); /* NUMBER-OF-CALL-PARAMETERS */
static unsigned char b_5[4] __attribute__((aligned)); /* ENVTAG */
static unsigned char b_6[11] __attribute__((aligned)); /* ENVSTR */
static unsigned char b_7[31] __attribute__((aligned)); /* WS-ENVIRON-VARIABLE-STRING */
static unsigned char b_8[3] __attribute__((aligned)); /* WS-ENVIRON-VARIABLE-LENGTH */
static unsigned char b_9[4] __attribute__((aligned)); /* WS-RESULT-STRING-POINTER */
static unsigned char b_10[160] __attribute__((aligned)); /* WS-STRIP-RESULT-STRING */
static unsigned char b_11[2] __attribute__((aligned)); /* WS-STRIP-RESULT-STRING-SIZE */
static unsigned char b_12[2] __attribute__((aligned)); /* WS-MAX-ENVIRON-VALUE-SIZE */
/* attributes */
static cob_field_attr a_1 = {33, 0, 0, 0, NULL};
static cob_field_attr a_2 = {17, 10, 0, 0, NULL};
static cob_field_attr a_3 = {17, 4, 0, 1, NULL};
/* fields */
static cob_field f_11 = {2, b_11, &a_3}; /* WS-STRIP-RESULT-STRING-SIZE */
static cob_field f_10 = {160, b_10, &a_1}; /* WS-STRIP-RESULT-STRING */
static cob_field f_9 = {4, b_9, &a_2}; /* WS-RESULT-STRING-POINTER */
static cob_field f_5 = {4, b_5, &a_1}; /* ENVTAG */
static cob_field f_6 = {11, b_6, &a_1}; /* ENVSTR */
/* local/external fields */
static cob_field f_13 = {160, NULL, &a_1}; /* WS-RESULT-STRING */
/* constants */
static cob_field c_1 = {30, (unsigned char *)"Environment string to be set: ", &a_1};
static cob_field c_2 = {37, (unsigned char *)"Need to retrieve ENVIRONMENT VARIABLE", &a_1};
static cob_field c_3 = {42, (unsigned char *)"Attempt to retrieve environment variable: ", &a_1};
static cob_field c_4 = {31, (unsigned char *)"Environment value returned for ", &a_1};
static cob_field c_5 = {5, (unsigned char *)" is: ", &a_1};
static cob_field c_6 = {20, (unsigned char *)"pointer is not null ", &a_1};
static cob_field c_7 = {14, (unsigned char *)"string is NULL", &a_1};
static cob_field c_8 = {3, (unsigned char *)"End", &a_1};
/* ---------------------------------------------- */
BTW - the original code was using MF cobgetenv in the code but when we started converting we did not see anything documented in OC that would replace this function.
----------------------------------------------------------------
Fixed in current 1.1 tarball.
I screwed up the non-aligned architecture case.
Re. cobgetenv, see -
http://supportline.microfocus.com/Documentation/books/oc41books/printf.htm#012
Capital 10.9.6
Excerpt -
***
In COBOL, the following syntax enables you to read and change the environment at run time.
DISPLAY ... UPON ENVIRONMENT-NAME ...
ACCEPT ... FROM ENVIRONMENT-NAME ...
You can also call the following routines from C to do the same things:
cobgetenv cobputenv cobrescanenv
Use the COBOL syntax in preference to the C routines.
***
Also see 10.9.6.1 Example
Excerpt -
***
The following example demonstrates calling a C routine directly from a COBOL program using the cobgetenv routine. (This is only for example purposes. We recommend you do not use cobgetenv from COBOL.)
***
Also from example -
***
"cobgetenv" expects a pointer to an array of characters
terminated by a low-value.
***
As indeed does "getenv".
Note that the example is NOT correct in it's reference
to "errno".
Some (all?) current libc implementations do NOT
have "errno" externalized as an "int". Instead,
the "errno.h" include does something like this -
#define errno (*__errno_location ())
Note OC supports the MF ACCEPT/DISPLAY extensions as well
as the more succint ACU variant -
ACCEPT dataitem FROM ENVIRONMENT identifier_or_literal
Roger
----------------------------------------------------------------
Just to clear up this environment issue.
The preferred (and easiest) way to set/get environment
variables is to use the OC (ACU) extensions -
SET ENVIRONMENT identifier_or_literal TO identifier_or_literal
ACCEPT identifier FROM ENVIRONMENT identifier_or_literal
This has the advantage that you do not have to worry about
null termination.
For the ACCEPT, the identifier will be space-filled/truncated according to definition (assuming presence of the variable).
Roger
----------------------------------------------------------------
Subject: Return a POINTER to a Cobol Program - how?
Hi,
how do you return a pointer to a cobol program?
CALL "myCfun" USING
BY VALUE INBUF-PTR
RETURNING HANDLE-PTR.
does not work.
Error: Invalid MOVE statement
Unexpected tree tag 0
codegen.c:2756: Internal compiler error
----------------------------------------------------------------
That's an OC bug.
Working on a fix.
Will post when I have something.
Roger
----------------------------------------------------------------
OK. Fixed in current 1.1 tarball.
(For alignment tolerant machines ie. x86(_64))
I need to think out the non-tolerant machine implications.
Note, I think you need to rethink your
passing BY VALUE of what appears to be a pointer.
That will not work.
(At least not compatibly)
The normal way to pass Cobol params is BY REFERENCE
and if you need to interpret these in C, then
do the appropiate casts.
This is exactly what MF/ACU do.
Roger
----------------------------------------------------------------
Thanks very much.
Where is the tar-ball?
OpenCOBOL 1.1 prerelease has Submitted Date: 2007/12/27
this seems a bit old.
Juergen
----------------------------------------------------------------
Yea, it's a bit confusing.
The submitted date is when the link was set up.
What it points to is of course actual.
Roger
----------------------------------------------------------------
Addendum to BY VALUE.
I have now changed the whole BY VALUE/CONTENT processing
so passing BY VALUE should now work.
1.1 tarball updated.
Roger
----------------------------------------------------------------
Subject: BINARY BY VALUE parameters
Hi,
I'd like to call Cobol from C and transfer pointers and integer lengths.
In C speak the Cobol program should be like
extern int ptrcob(char *, int);
So I tried this program
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. ptrcob.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
01 DATA-PTR USAGE IS POINTER.
01 DATA-LEN PIC S9(9) USAGE IS BINARY.
PROCEDURE DIVISION USING DATA-PTR BY VALUE DATA-LEN.
DISPLAY "HELLO WORLD."
EXIT PROGRAM.
[/code]
This generates this function
[code]
int
ptrcob (unsigned char *b_5, int i_6)
{
return ptrcob_ (0, b_5, (unsigned char *) &i_6);
}
[/code]
The parameters seem right, but the cast to (unsigned char *) is wrong, isn't it?
Thanks,
Juergen
----------------------------------------------------------------
No, that is perfectly OK.
Look at the definition of ptrcob_.
Put in a DISPLAY of DATA-LEN and
you will see what happens.
Roger
----------------------------------------------------------------
Subject: ADDRESS OF wrong
Hi,
I continued playing.
I'd expect the code below to output
OPNAME
but it doesn't.
Anybody an idea what is wrong?
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. addr.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 OPNAME PIC X(30) VALUE "OPNAME".
01 OPNAME-PTR USAGE IS POINTER.
PROCEDURE DIVISION.
SET OPNAME-PTR TO ADDRESS OF OPNAME.
CALL "cfun" USING
OPNAME-PTR.
EXIT PROGRAM.
[/code]
[code]#include
#include
cfun(char *s)
{
char b[50];
strncpy(b,s,30);
printf("%s\n",b);
}[/code]
cobc -x addr.cob caddr.c
SET OPNAME-PTR TO ADDRESS OF OPNAME.
generates
(*(unsigned char **) (b_6)) = (b_5);
Is that correct? Shouldn't that be &b_5 ?
Thanks,
Juergen
----------------------------------------------------------------
No, the Cobol code is correct.
BY REFERENCE parameters are passed
by pointer. Here you are passing a pointer
field. So what you have is
an "address of address of" field.
So the C code should look like this -
#include
#include
cfun(unsigned char *s)
{
char **ptr;
char b[50];
ptr = (char **)s;
strncpy(b,s,30);
printf("%s\n",*ptr);
}
Roger
----------------------------------------------------------------
Roger, thanks for helping me.
I tried your changes in z/OS 1.7, there they work:
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. "addr".
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 OPNAME PIC X(30) VALUE "OPNAME".
01 OPNAME-PTR USAGE IS POINTER.
PROCEDURE DIVISION.
SET OPNAME-PTR TO ADDRESS OF OPNAME.
DISPLAY "OPNAME=" OPNAME.
CALL "cfun" USING OPNAME-PTR.
STOP RUN.
[/code]
[code]#include
#include
cfun(char *s)
{
char **ptr;
char b[50];
printf("start cfun\n");
ptr = (char **)s;
strncpy(b,*ptr,30);
printf("%s\n",b);
printf("end cfun\n");
}
[/code]
[code] $ cob2 -qpgmname\(longmixed\) addr.cbl cfun.o
PP 5655-G53 IBM Enterprise COBOL for z/OS 3.3.0 in progress ...
End of compilation 1, program addr, no statements flagged.
$ a.out
OPNAME=OPNAME
start cfun
OPNAME
end cfun
[/code]
With opencobol, there is still something wrong, looks like the pointer is one off:
[code]
OPNAME=OPNAME
start cfun
3PNAME ð
end cfun
[/code]
My original C version (directly use the pointer) works in z/OS with USING BY VALUE, too:
[code]
CALL "cfun" USING BY VALUE OPNAME-PTR.
cfun(char *s)
{
char b[50];
printf("start cfun\n");
strncpy(b,s,30);
printf("%s\n",b);
printf("end cfun\n");
}
[/code]
This compiles with opencobol, too, but segfaults.
Greetings,
Juergen
----------------------------------------------------------------
The printf is scribbling places where it should not be.
strncpy stops when it hits a null byte (not true) or
when it hits the count (true = 30). In the last
case a null-byte is NOT appended.
Try doing a
memset (b, 0, sizeof(b));
before the strncpy.
Roger
----------------------------------------------------------------
[quote]
simrw wrote:
The printf is scribbling places where it should not be.
strncpy stops when it hits a null byte (not true) or
when it hits the count (true = 30). In the last
case a null-byte is NOT appended.
Try doing a
memset (b, 0, sizeof(b));
before the strncpy.
Roger[/quote]
Yes, but the strange thing is, the *first* character is wrong, too.
Juergen
----------------------------------------------------------------
What is strange about it?
You are printing uninitialized stack which could
include binary representation of any character
including such things as carriage-returns,
back-spaces and any other control character.
Roger
----------------------------------------------------------------
Subject: CALL "c" USING PTR to PIC S9(9)
Hi again,
I tried to pass a pointer to a binary integer from Cobol to C with the code below. This works with z/OS Cobol, but not with OpenCobol. Is that a bug?
Thanks,
Juergen
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. "rdintcob".
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MYINT PIC S9(9) USAGE IS BINARY.
01 PTR USAGE IS POINTER.
PROCEDURE DIVISION.
MOVE 20080106 TO MYINT.
DISPLAY "MYINT=" MYINT.
SET PTR TO ADDRESS OF MYINT.
CALL "rdint" USING PTR.
DISPLAY "MYINT=" MYINT.
STOP RUN.
[/code]
[code]#include
#include
rdint(int **s)
{
printf("start rdint, **s=%d\n", **s);
(**s) ++;
printf("end rdint, **s = %d\n",**s);
}
[/code]
z/OS output:
[code]
$ cob2 -qpgmname\(longmixed\) rdintcob.cbl rdint.c
PP 5655-G53 IBM Enterprise COBOL for z/OS 3.3.0 in progress ...
End of compilation 1, program rdintcob, no statements flagged.
$ a.out
MYINT=020080106
start rdint, **s=20080106
end rdint, **s = 20080107
MYINT=020080107
[/code]
OpenCobol output
[code]$cobc -x rdintcob.cob rdintc.c
$rdintcob
MYINT=+020080106
start rdint, **s=-362466815
end rdint, **s = -362466814
MYINT=+036857322
[/code]
----------------------------------------------------------------
USAGE BINARY (aka COMP) is
big-endian order.
Change to USAGE COMP-5 and
everything will be OK.
Alternatively you can use the 2002 syntax -
01 MYINT USAGE BINARY-LONG SIGNED.
Roger
----------------------------------------------------------------
I must have been blind, thanks for pointing it out.
I left Cobol alone and changed C by slightly misusing ntohl(), this version of rdint.c works with opencobol on Linux and with IBM's cobol on z/OS:
[code]
#include
#include
#include
rdint(int **s)
{
int a = ntohl(**s);
printf("start rdint, a=%d\n", a);
a ++;
printf("end rdint, a = %d\n",a);
**s = htonl(a);
}
[/code]
----------------------------------------------------------------
Yes, well assuming the passed parameter
is aligned :-)
If it's on 01/77, then it will work on
on any architecture.
BUT -
01 ...
03 FILLER PIC X.
03 MYPTR USAGE POINTER.
CALL .. USING (BY VALUE) MYPTR.
C code works fine on alignment-tolerant
architectures (eg. X86(_64), and others), but
will bomb out spectacularly otherwise!
That means that you either know the exact alignment
of parameters to C routines or not.
If the former, OK., if the latter then you
must code in C defensively.
Roger
----------------------------------------------------------------
Subject: OpenCOBOL 1.1 wishlist
As per subject.
(This applies to things not there
in 1.0, do not post unless you have
tested/installed 1.0)
Post away!
Roger
----------------------------------------------------------------
Debugging support would be great. I think one should teach Cobol to gdb (Using GDB with Different Languages: http://sources.redhat.com/gdb/current/onlinedocs/gdb_13.html#SEC144).
I am not overly good at reading Portugese, but the
TC-gui.pdf from
http://wiki.tinycobol.org/cobol.html
describes how you can debug Tinycobol programs with ddd and gdb.
As Tinycobol is GPLed, too, it should be possible to use its debugging code for OpenCobol, too.
Anyway, you should be able to do a session like this (manipulated C ;-) session:
[code]
(gdb) list
10 IDENTIFICATION DIVISION.
11 PROGRAM-ID. "cobmain".
12 DATA DIVISION.
13 WORKING-STORAGE SECTION.
14 01 MYVAR PIC X(20).
15 PROCEDURE DIVISION.
16 DisplayPrompt.
17 MOVE "HELLO" to MYVAR
18 DISPLAY "Hello, world.".
19 STOP RUN.
(gdb) break cobmain.cbl:18
Breakpoint 1 at 0x80483b8: file cobmain.cbl, line 18.
(gdb) run
Starting program: /home/cobol/a.out
Breakpoint 1, main (argc=1, argv=0xbfcc7624) at cobmain.cbl:18
19 DISPLAY "Hello, world.".
(gdb) print MYVAR
$1 = "HELLO"
(gdb)
[/code]
http://www.opencobol.org/modules/bwiki/index.php?cmd=read&page=UserManual%2F5
----------------------------------------------------------------
There should be Win32 Visual Studio built binaries available. This should vastly enhance OpenCobol's user base.
See also "configure fails in Windows XP"
http://www.opencobol.org/modules/newbb/viewtopic.php?topic_id=178&forum=1
----------------------------------------------------------------
To mail 2 -
Of course you can use gdb.
To be meaningful, you normally would
compile with the -g and -debug options.
To mail 3 -
Sergey Kashyrin will be hosting OC 1.0
pre-prepared binaries for a number of systems
including Native Win within the near future.
Will post (or he will) when available.
Note this will/does not include MinGW
or Cygwin ports.
Cygwin can be seen as a normal UNIX installation.
Be sure to install all required prerequisites
(both runtime AND development).
For MinGW, you must prepare/make/install the
prerequisites yourself.
Roger
----------------------------------------------------------------
[quote]
simrw wrote:
Of course you can use gdb.
To be meaningful, you normally would compile with the -g and -debug options.
[/quote]
I am sorry, I had overlooked the -debug option.
Anyway, it looks like you see no stdout of your program and you cannot display data:
So, I change my vote to enhance debugging suppport.
Thanks,
Juergen
[code]
~/cobol cobc -g -debug -x cobmain.cbl
~/cobol ./cobmain
Hello, world.
MYVAR=HELLO
~/cobol ./cobmain
Hello, world.
MYVAR=HELLO
~/cobol gdb cobmain
GNU gdb Red Hat Linux (6.5-16.el5rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/i686/nosegneg/libthread_db.so.1".
(gdb) list
13 /tmp/cob21935_0.c: No such file or directory.
in /tmp/cob21935_0.c
(gdb) break cobmain.cbl:20
Breakpoint 1 at 0x80489d7: file cobmain.cbl, line 20.
(gdb) run
Starting program: /home/intuser/cobol/cobmain
[Thread debugging using libthread_db enabled]
[New Thread -1208407856 (LWP 22132)]
[Switching to Thread -1208407856 (LWP 22132)]
Breakpoint 1, cobmain_ (entry=0) at cobmain.cbl:20
20 STOP RUN.
(gdb) print MYVAR
No symbol "MYVAR" in current context.
(gdb) list
15 PROCEDURE DIVISION.
16 DisplayPrompt.
17 DISPLAY "Hello, world.".
18 MOVE "HELLO" to MYVAR
19 DISPLAY "MYVAR=" MYVAR.
20 STOP RUN.
21
[/code]
----------------------------------------------------------------
[New Thread 1076823904 (LWP 4574)]
Hello, world.
Program exited normally.
Works fine here :-)
Roger
----------------------------------------------------------------
Addendum to mail 3 -
It is anticipated that for 1.1 we
will provide a "winbuild" directory
(or something) that allows a native
MSVC build. Note this will NOT include
building anything for the prerequisites such
as GMP etc.
Roger
----------------------------------------------------------------
I tried again, now, it works, too. No idea what went wrong the first time.
Thanks for helping,
Juergen
----------------------------------------------------------------
OK. No probs. But you should open
then a new subject/thread :-)
That is/was not to do with 1.1 :-)
Roger
----------------------------------------------------------------
1. Debugging can only be done using gdb debugger commands and with c code. The big "enhancement" for OC 1.1 would be to debug with the "COBOL-Source", being enabled to set breakpoints or jump to the code, seeing and modifying vars in a way COBOL sees them (I'm just dreaming, maybe this is possible some day...).
2. Have unimplemented Functions of MF/ACU implemented (is there a list of all Functions / CALL C$XYZ / etc. available in MF/ACU and showing what works in OC?)
3. There were different request about native XML-Support for OC in the forum, maybe it's possible to add a frontend to some GPLed XML-read/write-library for OC?.
----------------------------------------------------------------
1) But you have the info. If you compile
with -g -debug, the you have "#line" directives :-)
2) For what is implemented, see
libcob/system.def
3) Dunno.
Roger
----------------------------------------------------------------
No replies uptil now.
Hmm. Everybody satisfied with
OC 1.0 or ?
No, can not be - lets hear from people.
Roger
----------------------------------------------------------------
I saw somewhere in the wiki that screen section in tinycobol has better support. That means we can mix part of TC ? Last time I tried to install TC I had errors during "make install"
in scan.c ...
I'm not a "screen-section" supporter, my whishes goes to complete display/accept with colors, boxes and control key handling, etc. popup screens will be marvelous !
As I am not a C programmer, how can I contribute to make things go on ?
PS All these are whishes, not reproaches ...
----------------------------------------------------------------
I'd still like to see the functionality that when compiled in 'mainframe mode' that the main program can have parms passed via the command line like the mainframe allows. Last time I asked you just replied something like, "It's not possible." But I don't understand why it's not possible.
----------------------------------------------------------------
[quote]There were different request about native XML-Support for OC in the forum, [...][so] add [...][native] XML-read/write-[...][support] for OC [is a wish].[/quote]
----------------------------------------------------------------
If the written code is not very well formed OC prompts messages like [quote]Error: syntax error, unexpected INPUT_OUTPUT, expecting $end[/quote]. Better would be something like: 'ENVIRONMENT DIVISION. is missing'. I think there are other hard-to-understand-messages.
The wish is a clear message that says what is wrong.
----------------------------------------------------------------
A small one: Have a nice logo for OC. And another: put something behind the FAQ link at the top or remove it.
Maybe a bigger one: Distribute not only makefiles but also Visual Studio Project Files.
----------------------------------------------------------------
Per last post -
Small one - OK. Will see what
I (or Keisuke) can do.
Big one - Maybe not so big, it
is intended to provide a winbuild
for 1.1 ie. Native MSVC, (NOT Cygwin, MinGW
which are straight-forward UNIX ports).
Note, this will NOT include any build for
the OC dependencies (GMP et al.)
Roger
----------------------------------------------------------------
Re: Better would be something like: 'ENVIRONMENT DIVISION. is missing'. I think there are other hard-to-understand-messages.
Answered in another thread.
Roger
----------------------------------------------------------------
Re:
-----
I saw somewhere in the wiki that screen section in tinycobol has better support. That means we can mix part of TC ? Last time I tried to install TC I had errors during "make install"
in scan.c ...
I'm not a "screen-section" supporter, my whishes goes to complete display/accept with colors, boxes and control key handling, etc. popup screens will be marvelous !
-----
To part 1, yes TC has super screen I/O support
(but TC is ONLY on x86; I am not sure if TC works
correctly on x86_64)
We can not "mix" TC and OC.
The ACCEPT/DISPLAY syntax that you refer to is
a MF extension that is not part of any standard that
I know about.
Yes, OC has the parser to do this syntax.
Problem is to get the runtime code in :-)
As usual, lack of time and lack of developers
are the major problems as far as OC is concerned.
Suggestions welcome :-)
Roger
----------------------------------------------------------------
I would like to see a more flexible handling of upper/lowercase filenames, similar to the fold-call-name and fold-copy-name options in Microfocus.
Traditionally, COBOL source code is in all uppercase. Also traditionally, Unix filenames are all lowercase.
So I would like to be able to write
PROGRAM-ID. MYPROG.
...
COPY "MYCPY".
...
CALL MYSUB1
CALL "MYSUB2"
in a file myprog.cbl, to include mycpy.cpy and call mysub1.so and mysub2.so (which are compiled from mysub1.cbl and mysub2.cbl).
I found a discussion of this topic two years ago on the mailing list, but there seemed to be no consensus.
Regards,
Alex
----------------------------------------------------------------
Why not
copy "MYCPY".
call "MYSUB"
move "MYSUB" to wprogram
call wprogram ...
I think its better so.
Of course there is another way using configuration files
"a la acucobol" - why not ?
Regards
----------------------------------------------------------------
Some other wishes for the list:
- an option to have all the key files together with the data in one file
- If I'm right, there is a problem with memory handling: other COBOL systems unload programs from memory if there is a CANCEL 'MYPROG', OC does not, does it? The wish is a functional unloading on CANCEL operations.
By the way: Is there a possible release date for OC 1.1 and / or other versions? Maybe a plan of mile stones / features that should be implemented?
----------------------------------------------------------------
Hi Roger,
I'll split my wishes into separate messages.
USAGE NATIONAL and everything connected to that.
It should not be complicated, but still amount of work mostly duplicating existing functions.
Regards,
Sergey
----------------------------------------------------------------
low-value terminated strings, i.e.
MOVE Z"ABC" TO STR.
----------------------------------------------------------------
That can be split into several stages.
STAGE 1
To keep the names of the variables like original in C
i.e. if we have
01 X.
02 F-1 PIC X(4).
02 F-2 PIC S9(7) COMP-4.
instead of generating
static char b123[8];
to generate
#pragma pack(1)
static struct s_X {
char F_1[4];
char F_2[4];
} X;
and the appropriate references, i.e. instead of
b123 + 4
just
X.F_2
----------------------------------------------------------------
STAGE 2
Switch to the appropriate types where possible in C, i.e. if it's BIG_ENDIAN (and COMP-4 is native int), produce
#pragma pack(1)
static struct s_X {
char F_1[4];
int F_2;
} X;
----------------------------------------------------------------
STAGE 3
Switch from C to C++ and in the following case
01 X.
02 I-1 PIC S9(7) COMP-4.
02 P-1 PIC S9(5)V9(2) COMP-3.
produce
struct s_X {
COMP4<4> I_1;
COMP3<7,2> P_1;
} X;
and of course
MOVE I-1 TO P-1
will be just
X.P_1 = X.I_1;
Easy ? NO
Possible ? YES
----------------------------------------------------------------
Also can be split into 2 stages
1. Get rid of static dependencies in runtime to be able to work in multithread environment
2. To introduce kind of "multithread mode" in which case all WORKING-STORAGE become a thread-local storage, like Fujitsu did in their .NET version.
All of this might be important for people who want to mix their new java apps with an old legacy code and not to run several copies as a processes but do multithreading and just call Cobol code natively.
----------------------------------------------------------------
Re: -
> low-value terminated strings, i.e.
> MOVE Z"ABC" TO STR.
You can already do this -
MOVE "ABC" & X"00" TO STR.
:-)
Roger
----------------------------------------------------------------
OK so this is mine :
libcob:
Convert packed to int are a nightmare. libcob have theses functions (cob_get_packed) but use cob_field structure, with user defined function don't have (CALL use the unsigned char b_1 as parameters.
modify generated C:
make possible to include file generated code. For exemple, i want my cobol program use my own cob_resolve_1 function, if i use -D, it don't work (-D'cob_resolve_1 my_resolve_1' transform 'cob_resolve_1' in 'myresolve_1 1' .
I have to add #define in .c.h : (in makefile)
cobc -C test.cob
echo "#define cob_resolve_1 my_resolve_1' >> test.c.h
cobc test.c myresolve.o -o test
This first is probably more interesting, it need to modify call architecture (and break compatibility)...
Regards
----------------------------------------------------------------
Both of the suggestions in previous post are rejected.
I have no idea what on earth you are trying to do.
You should never be using the internal OC functions.
(Except as described in the documentation)
Roger
----------------------------------------------------------------
libcob:
I want to write a C function (aka cobol sub program), taking as parameters COMP and COMP-3 variable.
But i have some trouble to handle them (COMP-5 is not enough)
I need to write my own function to transform them to C understandable data. Opencobol already had these functions, so why not use them ?
Ex:
I receive a S9(6) COMP variable
i do :
int get_from_packed(char *data) {
cob_field_attr a = {18,6,0,1,NULL};
cob_field f= {4,data,&a};
return cob_get_packed_int(&f);
}
Works!!! (not use about the 18, but you get the idea..)
Only a proposal...
What is the best solution, write my own function (which will be only compatible with opencobol..) or use the solution with libcob ?
modify generated C:
As i said in my message, i think this is not so important for all users, i only propose. Perhaps someone could have a more interesting feature with it...
And i had my work around (but it is quite ugly)
Regards
----------------------------------------------------------------
a) My code looks like[code]perform varying a from 1 by 1
until a > 99
if a = b or d = e
perform something
end-if
end-perform[/code], the listing looks like [quote]perform varying a from 1 by 1
until a > 99
if a = b or d = e
perform something
end-if
end-perform[/quote]
I'd like to have indention kept in list files, because the generated list files would be easier to read.
b) I'd would like to have all relevant parameters for compiling at top of the list file, with full cobc line, environment vars, oc-version, ...
This is very helpful if one need to compile again and does not know what the environment was set before or how the cobc line looked like.
----------------------------------------------------------------
a) No can do. (At least not easily)
"listing" is really a misnomer. What it really is,
is the output from the preprocessor phase
(which has been normalized to free format) and then
reindented to column 8/12.
b) Done. Updated in current 1.1 tarball.
Let me know if you need any other info there.
Roger
----------------------------------------------------------------
To a) ... sounds a little bit weird. I understand that this is not so easy to fix.
To b) Sounds good, I'll have a look and like to have c) also available in list file (if possible)
New point c) I'd like to have a 'Build on [DATE]' in [code]cobc -version[/code] to be able to see when the used OC was build (because the output is always '1.1')
What do you think of moving all feature requests and bug reporting to sf-site? And (I know that this was asked before, but maybe you change your mind about this) what do you think of moving the pre-release OC 1.1 to SF, too (as package OpenCobol pre-release)? What about moving/copying the pre-build OC binaries from kiska.net to SF, too? And last question for today: What about removing or enabling the not working FAQ at this site (top)?
By the way: OC 1.1 is really good work!
----------------------------------------------------------------
Re. (c) -
Yep, OK. Got something in test. Will post when
tarball available. (Should also reflect in
the listing option, -t )
Re SF site.
Problem is that SF only knows about releases and
not anything else (pre-release or such).
Not sure what we can do here.
Roger
----------------------------------------------------------------
We can make a new release part called "prereleases", like the experimental builds winmerge on SF does (about every week before a new release occurs): http://sourceforge.net/project/showfiles.php?group_id=13216
The really nice thing about that: Everybody knows, when there is a new tarball because of the release-date.
----------------------------------------------------------------
Re: (c) - Build date is now part of version info.
Tarball updated.
Roger
----------------------------------------------------------------
I tried the current 1.1 tarball, version and compile info in listing output are fine.
Is it possible to place the warnings/errors at the related places in the list file or if it is not then place at the end of the list file?
----------------------------------------------------------------
Hi, sometimes it might be useful to disable all displays (for performance reasons in servers).
What about a compiler option -fsuppress-console-output ?
Greetings,
Juergen
----------------------------------------------------------------
Reply to weberjn -
Why? You have enough possibilities in the source
code and/or the environment to achieve this.
Roger
----------------------------------------------------------------
Excuse me if this first part is in an inappropriate thread, but having experienced OC 1.0 last week and OC 1.1 today, I'd just like to wish you and your team all the best.
Well done. I haven't seriously COBOLed since the early 80's and this system is working out great.
And a wishlist wish (or at least request for information); what are the plans for Report Writer? I've only barely skimmed the docs that I could find and haven't seen any mention other than a "'REPORT' reserved word, but not supported yet" error message (and the "yet" piqued my curiosity).
Thanks, and wishing you well,
Brian Tiffin
----------------------------------------------------------------
Well, of course, the word "yet" is subjective.
It is a global message from the parser that we may at some time support this feature.
Actually, you are the first person to inquire about
Report Writer.
I do not have any plans to implement this.
I have never had a request for this.
(Of course, if some customer came along and said we
will pay for this development, then OK. :-))
Roger
----------------------------------------------------------------
My history with COBOL is report writing. :)
During my time, wayy back in the day, I wrote quite a few reports from scratch and never got a chance to try REPORT SECTION and GENERATE. I changed course completely and became a polyFORTH programmer; so think of this Wish List entry as little more than nostalgic from an OpenCOBOL new user wishing on a star.
Cheers
----------------------------------------------------------------
Before 1.1 goes out of the door, I will review
these messages and try to produce something
that may be meaningful as to intentions (or not as the case may be).
Roger
----------------------------------------------------------------
Like I posted in http://www.opencobol.org/modules/newbb/viewtopic.php?topic_id=254&forum=1&start=10
It would be nice to have some markers (for example in column 73 if using fixed format) like[code] perform mf-things MARKMF
perform 85-things MARK85
perform 2002-things MARK02[/code] For Doing things like[code]
cobc -x -Wall -std=mf -inclMark=MARKMF -exclMark=MARK85 -exclMark=MARK02 prog.cob
cobc -x -Wall -std=cobol85 -inclMark=MARK85 -exclMark=MARKMF -exclMark=MARK02 prog.cob
cobc -x -Wall -std=cobol2002 -inclMark=MARK02 -exclMark=MARKMF -exclMark=MARK85 prog.cob[/code]
(the -exclMark should be commented out, the -inclMark should be commented in)
I think ACU had something like that. Has anybody an idea for doing that stuff in free format?
With techniques like that we could have samples working on all std's
----------------------------------------------------------------
Human, NAK on that. I have the Cobol standard conditional
compilation directives on my TODO list.
ie.
>>IF whatever
>>ELSE
>>END-IF
Roger
----------------------------------------------------------------
I do not understand what you wanted to say... But sounds like you wanted to do something about that, so I'll just wait. (No matter what, I would really like to have column 73-directives implemented for fix format, because preparsing the cbl-file to do that is not so easy, but I'll wait for your respond to that before I'll beg you again with this topic.)
----------------------------------------------------------------
I am saying that conditional code generation will be handled using the Cobol standard directives feature.
I am not going to do anything with col 73.
It is easy enough to do that externally.
eg.
Assume you have a template prog with MARKMF/MARK85/MARK02/MARKOC in column 73, then feed your template prog into a shell script something like -
# Template program as param 1, output as param 2
# Activate OC lines, deactivate MF, 85, 02 lines
sed -s 's/^\(......\).\(.\{65\}\)MARKMF/\1\*\2MARKMF/
s/^\(......\).\(.\{65\}\)MARK02/\1\*\2MARK02/
s/^\(......\).\(.\{65\}\)MARK85/\1\*\2MARK85/
s/^\(......\).\(.\{65\}\)MARKOC/\1\ \2MARKOC/' <$1 >$2
To activate all OC and deactivate the other 3.
Then -
myscript template.cob myocprog.cob
You can then have scripts to activate the other 3 by minimal modification (It can even be the same script, just linked with a different name and tested for within the script -
eg.
case `basename $0` in
"cobconvoc")
# Do OC sed
;;
"cobconv85")
# Do 85 sed
....
....
esac
Roger
----------------------------------------------------------------
I'm just a beginner with sed, but this seem to be all that is necessary for replacing the special ACU-Flags. Thank you!
----------------------------------------------------------------
Here is another sed version that is perhaps
a little easier on the eye and a bit easier to understand -
sed -s 's@^\(......\).\(.\{65\}MARKMF\)@\1\*\2@
s@^\(......\).\(.\{65\}MARK02\)@\1\*\2@
s@^\(......\).\(.\{65\}MARK85\)@\1\*\2@
s@^\(......\).\(.\{65\}MARKOC\)@\1\ \2@' <$1 >$2
Roger
----------------------------------------------------------------
Recent activities have kind of buried this thread. This is just a ping post to bubble it up to the top so everyone knows it's still here.
----------------------------------------------------------------
Request for new OpenCOBOL reserved word.
NEWLINE
For usage such as
[code]
DISPLAY
thing NEWLINE otherthing
WITH NO ADVANCING
END-DISPLAY
[/code]
Or is
01 NEWLINE CONSTANT AS x"0a".
acceptable across platforms?
Cheers,
Brian
----------------------------------------------------------------
I don't know an easy way to remove DISPLAYs. I have just now commented out all DISPLAYs of a program, search and replace does not really cope with the indentation. And, sometimes I need the DISPLAYs, again.
In C I'd just use an #ifdef DEBUG but in Cobol I have to comment out, have I?
So with -fsuppress-console-output I could program with lot of debug output and could run in production without debug output.
Thanks,
Juergen
[quote]
simrw wrote:
Reply to weberjn -
Why? You have enough possibilities in the source
code and/or the environment to achieve this.
[quote] Hi, sometimes it might be useful to disable all displays (for performance reasons in servers).
What about a compiler option -fsuppress-console-output ?
[/quote]
[/quote]
----------------------------------------------------------------
[b]For using the compiler[/b] see [url=http://opencobol.add1tocobol.com/ocfaq.html#does-opencobol-support-d-indicator-debug-lines ]OpenCOBOL FAQ / Debug Indicator[/url]
If you want to have different outputs in debug / normal mode use a fake if 1 = 1 like[code] D IF 1 = 1
D DISPLAY "Debug Line" END-DISPLAY
D ELSE
DISPLAY "Normal Line" END-DISPLAY
D END-IF[/code]
This sample is missing in the OpenCOBOL Manual (the new name for the OpenCOBOL FAQ). If one of the manual peoples read this, you maybe want to add it.
[b]For using the environment[/b] Just define [code]
01 debugmode pic x.
88 debugmode-on values 'O', 'Y', 'J', 'o', 'y', 'j', '1'.[/code] put an [code] accept debugmode from Environment "DEBUGMODE"
end-accept[/code] at the beginning of each program (or define debugmode as external) and use it in your programs like[code] IF debugmode-on
DISPLAY "Debug Line" END-DISPLAY
ELSE
DISPLAY "Normal Line" END-DISPLAY
END-IF[/code]
human
----------------------------------------------------------------
Yes, a flag works. But you still have code for the flag testing at runtime, and the source code is cluttered (the latter is the case in C, too).
A compiler flag to ignore DISPLAY statements would produce a faster code and source code would look better.
But, your solution allows to switch at runtime.
----------------------------------------------------------------
For having no debug code in runtime you can combine these two: [code] D 01 debugmode pic x.
D 88 debugmode-on values 'O', 'Y', 'J', 'o', 'y', 'j', '1'.
...
D accept debugmode from Environment "DEBUGMODE"
D end-accept
...
D IF debugmode-on
D DISPLAY "Debug Line" END-DISPLAY
D ELSE
DISPLAY "Normal Line" END-DISPLAY
D END-IF[/code] In this way you have fast code at runtime (if not compiled with -fdebugging-line) and can switch the output during development.
The advantages over a compiler switch to disable the displays are:
- You can always use display in your program, not only for debug information
- You see in the code what you do
- If compiled with lines that have 'D' indicator you can switch at runtime
- If compiled without lines that have 'D' indicator you can have faster and smaller modules.
----------------------------------------------------------------
I didn't know about 'D' indicators (blush), this is a fine concept.
I checked on z/OS, to activate D lines you have to add
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-370 WITH DEBUGGING MODE.
This does not enable them with OpenCobol, not even for -std=mvs
Should it?
Thanks,
Juergen
----------------------------------------------------------------
human; I've added your debug tricks to the FAQ/Manual.
Cheers,
Brian
----------------------------------------------------------------
Also note that there is an OC extension for debugging.
That is the "floating debug directive" which is the
3 characters ">>D".
This allows debugging stuff which will compile in
both fixed and free format source code.
Note that usually directives should be specified on or after
column 8 so as to be compilable in both fixed and free format.
Here you can play a small trick :-)
Set columns 1 to 4 as spaces and 5 to 7 as the floating
debug directive. That works in both fixed and free format :-)
(As columns 1 to 6 are ignored in fixed format and column 7
is the indicator column).
Roger
----------------------------------------------------------------
Subject: Multicore-Features and how to optimize the code
Does anybody has a working solution for better using multicores? I have to convert large files on a multicore and using 100% of only one core.
----------------------------------------------------------------
Well, really there is not enough info.
What OS? What OS version?
If Linux, what does "cat /proc/interrupts" show?
If you are just converting files, then I would expect
that I/O is limiting factor and not CPU.
(Depending on the complexity of transformation)
However, that depends on how the
program is coded.
1) Make sure that all
indicators/switches/subscripts/counters are on
the 01 level.
2) Define the above as PIC S9(8) COMP-5
(alternatively as USAGE BINARY-LONG SIGNED)
3) Compile with "-std=mf -O2"
ifff you are not dealing with COMP fields
in the files. Note the various "-std=" change
the size AND handling of COMP fields.
The above applies to any architecture but especially
x86(_64).
If you use the 2002 standard BINARY-xxx,
then the "-std=' is irrelevant.
Roger
----------------------------------------------------------------
I'm using a normal Intel machine, WinXP[cygwin] and Linux with two cores. The transformation is very complex and done in 3 Steps:
1. Read the old files line per line, do analyses about the input and put it into ISAM (in case of OC: BDB) files (needs quite a lot of time).
2. Do some transformations for some of the ISAM files (works quite fast).
3. Export the files in some new structures (needs quite a lot of time too, because of transformation in an xml-like syntax.)
Some counters are not on level 01, most on 77 (These a faster than 01 in COBOL/OC, aren't they?)
Is it better to have "-std=mf -O2" or counters with USAGE BINARY-LONG SIGNED?
----------------------------------------------------------------
-O2 is a given to produce optimal code
(although that is highly dependant on the code).
USAGE BINARY-xxx [SIGNED/UNSIGNED] means
that REGARDLESS of the -std (or lack thereof)
that these fields will be optimally handled
in native machine format (and have defined sizes).
Note, however, this is only true when these fields
are aligned ie 01 or 77 (there is no difference)
OR you are on an alignment tolerant machine.
OK. and now to the root of the problem.
Cygwin is a very slow emulation layer.
It's fine (and I use it myself) to do some
fairly normal stuff. It Is not OK when an
app is processor and/or I/O intensive.
I would suggest installing a Linux variant alongside.
Modern Linux installs offer at the installation stage
an option to resize your Win partition. If you are
not strapped for space, then this is the way. Then you get really native speeds.
I do this regularly on my boxen.
Roger
----------------------------------------------------------------
You do what regularly? Setup a new OS?
What std-option is standard? Why do you suggest mf?
I will try with -O2, with a virtual machine (should be no big problem with virtualisation features of CPU) and with OpenSuse on an old harddisk.
By the way: are substring comparisons slower in OC than a normal one? For example
[code]evaluate var-a (10:20)
when 'ABCD'
perform abcd
when 'DEFG'
perform defg
...
end-evaluate[/code]
(there could also be a move of the substring to another string)
----------------------------------------------------------------
> You do what regularly? Setup a new OS?
Sure, I do multiple OS installs, otherwise
I could not even start on the problems
here and on SourceFourge.
Recipe -
Win first- then the real OS :-)
Works every time :-)
Every new box with pre-installed Win
(or -not) is easily bi-installed with
eg. OpenSuse 10.2(3).
(Which I do as a matter of course).
Roger
----------------------------------------------------------------
Compile with -O2 and running the program does not helped. I may try COMP fields later, but I think the main problem is I/O. Is there a possibility to fasten BDB (I need no locking during the transformation) or maybe a document how to set up VBISAM as the used ISAM?
----------------------------------------------------------------
Subject: "./configure" fails in Windows XP
The first line of the "OpenCOBOL Manual" webpage says that "OpenCOBOL is an open-source COBOL compiler, which translates COBOL programs to C code and compiles it using GCC." As I have some legacy Cobol programs on my PC (running Windows XP) and the configuration of my old Cobol compiler was lost on a corrupt hard-drive, I thought OpenCobol answered my prayers ...
I have just spent three hours downloading 1.0, then realising it has no Windows interface, downloading 0.33 plus add-ons from Sergei Kiska's website, then entering Windows XP Command Prompt, following the instructions on the "Install Guide" webpage as far as "./configure". This returns "'.' is not recognised as an internal or external command". "Configure" without the "./" returns the equivalent message.
When I looked on the Forum for a possible explanation, I found the "Win32 Compilation - 'cl'" post which suggests I also need a C compiler, but I didn't see anywhere obvious that it says this. Does that mean I also need a knowledge of C (or at least how to run the compiler)? -- I have absolutely none. If I DO need to know C, OpenCobol is of no use to me.
If I don't need C knowledge, can anyone suggest what is wrong please? DIR shows "configure" as dated 02/08/2007 13:15 with size of 889,776 bytes.
Thanks in anticpation :-?
----------------------------------------------------------------
The home page states -
OpenCOBOL translates COBOL into C and compiles the translated code using the native C compiler. You can build your COBOL programs on various platforms, including Unix/Linux, Mac OS X, and Microsoft Windows.
:-)
See the "native C compiler"?
However, see the other thread regarding wishlist.
** The above statement is relevant**
As stated many times in the past,
I support OC in my spare time.
Other people are enormously contributing to
OC and, in the meantime, we have world-wide successful OC
implemtations on a grand scale.
To answer this,
no, you can not do a "./configure" on Win
native :-)
Geez, what can "cmd.exe" actually do.
Do you really expect that native Win will
do POSIX configures?
:-)
Roger
----------------------------------------------------------------
In other words: you need cygwin if you want to do things like that on Windows.
----------------------------------------------------------------
Or MinGW/MSYS plus prerequisites.
Roger
----------------------------------------------------------------
Subject: indexed files
Is Isam implimented in open cobol? I am trying to create an Indexed file, and get a filestatus of 35 on open output. I am not sure how to create a new Isam file (if Isam is indeed implimented)
Donald
----------------------------------------------------------------
Donald,
Post the program.
Mail to me config.log and config.h
Roger
----------------------------------------------------------------
The program stub looks like so: I get a file status 35 on the first try, a 30 on the open output, and a 35 the second try as well
IDENTIFICATION DIVISION.
PROGRAM-ID. "COBOL-SCREENS".
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
Select smart-name-file
assign to smart-file-name
organization is indexed
access mode is dynamic
file status is smart-status
record key is smart-key.
DATA DIVISION.
FILE SECTION.
FD smart-name-file.
01 smart-name-line.
02 smart-key picture x(16).
02 screen-width picture 999.
02 screen-height picture 999.
02 screen-background-c picture 99.
02 screen-foreground-c PICTURE 99.
WORKING-STORAGE SECTION.
01 Sequential-input-name picture x(75)
value "/home/donald/Library/cobol/mydata".
01 smart-status picture xx.
PROCEDURE DIVISION.
start-paragraph.
open input smart-name-file.
display smart-status.
if smart-status is not equal to '00'
perform fix-smart-status.
close smart-name-file.
display "Screens Version 1.00".
display "Copyright(C), 2008, Donald L. Tees."
display "Screens Version 1.00, normal exit".
STOP RUN.
fix-smart-status.
display 'smart-status=' smart-status.
if smart-status is equal to '35'
close smart-name-file
open i-o smart-name-file
display 'after open i-o ' smart-status
move "SCREENS" to smart-key
move 132 to screen-width
move 50 to screen-height
move 0 to screen-background-c
move 7 to screen-foreground-c
write smart-name-line invalid key
display 'could not create '
Sequential-input-name
stop run.
display 'after write ' smart-status
close smart-name-file.
display 'after close ' smart-status.
----------------------------------------------------------------
P.S. What is your mail address?
Donald
----------------------------------------------------------------
You lied :-)
You are not opening output,
you are opening i-o :-)
So, 35, 30, 35 is correct.
Roger
----------------------------------------------------------------
Actually, I tried both with the same result. The code I sent you was the second try ... changed it and forgot to change it back before clipping and sending it to you. Sorry about that.
Donald
----------------------------------------------------------------
Here's your problem -
assign to smart-file-name
You don't define smart-file-name yourself
so you get an implicit W/S field created
(ala. MF)
However, you do not put any value into
smart-file-name.
Roger
----------------------------------------------------------------
That took care of the problem, ty. I should have noticed it myself, or deduced it from the strange data name that appeared.
I've never quite figured out how to avoid the "string at something obvious and not seeing it" problem. :(
Donald
----------------------------------------------------------------
Yes, I think we should warn about this if
-Wall is specified.
I will cook up a patch.
Roger
----------------------------------------------------------------
Subject: return code
when you do a call to "system", is there a return code? If so, what is the data name and picture?
Thanks
Donald
----------------------------------------------------------------
Yes, the status is available in RETURN-CODE -
IDENTIFICATION DIVISION.
PROGRAM-ID. ac7.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
AA-MAIN SECTION.
A00.
CALL "system" USING "ls -l ac7.cob" & X'00'.
DISPLAY "Return Status " RETURN-CODE.
CALL "SYSTEM" USING "ls -l ac7.cob".
DISPLAY "Return Status " RETURN-CODE.
CALL "system" USING "ls -l doesnotexist" & X'00'.
DISPLAY "Return Status " RETURN-CODE.
CALL "SYSTEM" USING "ls -l doesnotexist".
DISPLAY "Return Status " RETURN-CODE.
STOP RUN.
./ac7
-rw-r--r-- 1 root root 716 Jan 25 05:57 ac7.cob
Return Status +000000000
-rw-r--r-- 1 root root 716 Jan 25 05:57 ac7.cob
Return Status +000000000
ls: doesnotexist: No such file or directory
Return Status +000000512
ls: doesnotexist: No such file or directory
Return Status +000000512
Note that string literals and/or alphanumeric fields
passed to C library routines are expected to be
null terminated (ie. for "system"). This is not necessary
when using the OC "SYSTEM" library routine (ala MF).
You can also specify a RETURNING clause to define
your own (numeric) status field -
01 MYRETURN PIC 9(4).
....
CALL "SYSTEM" USING "ls -l doesnotexist"
RETURNING MYRETURN.
DISPLAY "Return Status " RETURN-CODE.
DISPLAY "Return Status " MYRETURN.
ls: doesnotexist: No such file or directory
Return Status +000000512
Return Status 0512
Roger
----------------------------------------------------------------
I suspect there is a bug in there somewhere, and the 512 in your example return should be a 2.
[donald@localhost test]$ cat one.cob
IDENTIFICATION DIVISION.
PROGRAM-ID. "one".
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
77 program-status picture 999.
PROCEDURE DIVISION.
start-paragraph.
display "this is one".
call "system" using "./two" returning
program-status.
display program-status.
DISPLAY RETURN-CODE.
STOP RUN.
[donald@localhost test]$ cat two.cob
IDENTIFICATION DIVISION.
PROGRAM-ID. "two".
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
start-paragraph.
MOVE 1 TO RETURN-CODE.
display "this is two".
STOP run.
[donald@localhost test]$ cobc -x one.cob
[donald@localhost test]$ cobc -x two.cob
[donald@localhost test]$ ./one
this is one
this is two
256
+000000256
The only arguement that I can pass *FROM* cobol correctly is zero. 1 gives 256, 2 gives 512, etc. The negative results are even stranger. Maybe a misalignment problem?
Donald
----------------------------------------------------------------
No, everything is correct.
What you are getting is the return status
of "system".
Do a "man system" to see why you get
the values that you see.
Here is an excerpt from the system man
pages --
RETURN VALUE
The value returned is -1 on error (e.g. fork failed), and the return status of the command otherwise. This latter return status is in the format
specified in wait(2). Thus, the exit code of the command will be WEXIT-STATUS(status). In case /bin/sh could not be executed, the exit status will be that of a command that does exit(127).
--
I know its weird but that is what "system" does.
Roger
----------------------------------------------------------------
OK, thank you. It definitely is weird ... looks like I have some more reading to do.
Donald
----------------------------------------------------------------
Subject: OpenCobol > Java byte code - interested?
Hi.
Is someone interested on this compiler?
Regards.
----------------------------------------------------------------
Hi,
This could be interesting. We have a lot of COBOL programs which we would like to migrate to the java world with re-writing everything.
Do you have such compiler ?
Regards
----------------------------------------------------------------
No, still not.
There is a commercial one (percobol I think) but is too expensive and not OS.
My first intention is a full java compiler for COBOL language but may be OpenCobol can emit Java instead of C: instead of develop a full compiler just write the back-end.
The problem with this approach is that new back-end should be write in C which I don't dominate because I'm primary a java developer.
May be the AST can be streamed in some intermediate code (XML) from C front-end to java writen back-end.
Thoughts?
Ideas?
Regards.
----------------------------------------------------------------
Subject: Unicode
Hi,
I would like to know if OC supports Unicode (USAGE NATIONAL).
Thanks in advance,
Pierre
----------------------------------------------------------------
Subject: OpenCobol on Solaris
Hi everyone, We are interested in using OpenCobol instead of Microfocus Cobol (ServerExpress 2.0.11) on our new Solaris 10 (sparc) hosts.
Can we expect it to work?
What sort of code changes do you think we'd need to make? (Ideally we'd like to make none, but I do and try live in the real world.) ;-)
Our code is fairly all standard stuff but does call the occasional 'C' function that gets linked into the executable. Is that going to be a problem (we mainly pass fixed length strings)?
We do also use indexed files sometimes.
I know this is all a bit general at the moment, but any pointers at this stage would be gladly received.
Thanks,
Michael
----------------------------------------------------------------
It is hard to say if everything will compile and work as expected since each compiler maker has putting its own lanuage extensions. The best way to check is compiling a bunch of sources and see which errors you got.
Your bigger problem will be the data files format and conversion. AFAIK (I'm not OC expert) OC uses sleepy cat's berkley db and Micro Focus has its own format.
What is the porpuse of the change?
Reduce license costs?
Regards.
----------------------------------------------------------------
Thanks for your reply.
Yes the purpose would solely be to save some money, but if the time taken to do the conversion and testing is too great it won't be worth it.
Converting the indexed files won't be an issue as we'd let them be recreated from scratch by the programs.
Much of this Cobol was previously converted from a main-frame so hopefully the much of the 'weird' non-standard stuff got smoothed out then. But there's no telling till we give it a try.
----------------------------------------------------------------
> Yes the purpose would solely be to save some money
How much is the cost of the Micro Focus license?
How many programs?
How many lines of source code?
Are they batch oriented only or there is screen I/O?
Almost forget:
One of the biggest issues in the projects I participated about compiler change / migration and/or language migration is that sometimes there is lost sources. This is an (almost) inevitable consequence of entropy: As more years pass is more likely to happend.
Regards.
----------------------------------------------------------------
Really good questions from ssamayoa. Why don't you put all your sources in a folder, compile all the stuff (via batch and "for all *.cbl") over night (add the mistakes in the batch to a huge file together) and take a BIG coffee the next morning while inspecting the error file.
Then you'll see what your work is about.
Files are not THAT big thing to convert: unload all files to line sequential one's via old compiler and then load the line sequential file into BDB via OC.
By the way: compiler change from MF is more easy than from others like ACU because OC is very near to MF.
----------------------------------------------------------------
Our Unix systems people are still struggling to install Open Cobol. In fact they haven't even started in the OpenCobol install, they are still trying to get the pre-requisite libraries to install properly on Solaris 10 (it's actually a host with Solaris 10 zones.) :-)
The license costs for the new hosts are going to cost around 10,000 GBP I've been told.
Not sure how long they will carry on fighting with it, they may just give up and spend the money instead.
----------------------------------------------------------------
I have been trying to do the same install. I have been able to get GMP and OC installed, but have been having issues with BerkeleyDB.
I have found that shared needs to be disabled.
Before doing any installs, I add these environment variables.
#Needed for m4 (I think, it's been a few weeks)
export PATH=/usr/sfw/bin:/usr/ccs/bin:$PATH
#Since installing to non-standard location
export C_INCLUDE_PATH=/db01/pm/opencobol/local/include
export CPLUS_INCLUDE_PATH=/db01/pm/opencobol/local/include
export LIBRARY_PATH=/db01/pm/opencobol/local/lib
export LIBPATH=/db01/pm/opencobol/local/lib
#Needed for 64-bit
export OBJECT_MODE=64
export LD_LIBRARY_PATH=/usr/sfw/lib/sparcv9
export LD_LIBRARY_PATH_64=/usr/sfw/lib/sparcv9
#To point to known temp directory (had some space issues)
export TMP=/db01/pm/opencobol/temp
export TMPDIR=/db01/pm/opencobol/temp
#Installing GMP
#Not sure if the LDFLAGS are needed. Its there from previous failed attempts. After the enable and disable were added it worked.
./configure --prefix=/db01/pm/opencobol/local ABI=64 --disable-shared --enable-static LDFLAGS='-Wl,-L/usr/sfw/lib/sparcv9'
#Installing OC
./configure --prefix=/db01/pm/opencobol/local CC='gcc -m64 -mptr64' CFLAGS=' -O2 ' LIBS=' -lpthread' CONFIG_SHELL='/bin/bash' --enable-cxx --disable-shared -without-db
I have not been able to install OC with Berkeley DB. Here is the configure I used and the error message from the OC configure.
#BerkeleyDB.
#From the build_unix directory
../dist/configure --prefix=/db01/pm/opencobol/local CC='gcc -m64 -mptr64' --disable-shared --enable-static --disable-largefile
Undefined first referenced
symbol in file
bind /db01/pm/opencobol/local/lib/libdb-4.5.a(repmgr_net.o)
send /db01/pm/opencobol/local/lib/libdb-4.5.a(repmgr_sel.o)
accept /db01/pm/opencobol/local/lib/libdb-4.5.a(repmgr_sel.o)
listen /db01/pm/opencobol/local/lib/libdb-4.5.a(repmgr_net.o)
socket /db01/pm/opencobol/local/lib/libdb-4.5.a(repmgr_net.o)
fdatasync /db01/pm/opencobol/local/lib/libdb-4.5.a(os_fsync.o)
setsockopt /db01/pm/opencobol/local/lib/libdb-4.5.a(repmgr_net.o)
getsockopt /db01/pm/opencobol/local/lib/libdb-4.5.a(repmgr_posix.o)
connect /db01/pm/opencobol/local/lib/libdb-4.5.a(repmgr_sel.o)
getaddrinfo /db01/pm/opencobol/local/lib/libdb-4.5.a(getaddrinfo.o)
freeaddrinfo /db01/pm/opencobol/local/lib/libdb-4.5.a(getaddrinfo.o)
gai_strerror /db01/pm/opencobol/local/lib/libdb-4.5.a(getaddrinfo.o)
ld: fatal: Symbol referencing errors. No output written to conftest
collect2: ld returned 1 exit status
----------------------------------------------------------------
> The license costs for the new hosts are going to cost around 10,000 GBP I've been told.
Is almost US$20K!
How many cobol programs are?
What kind?
Batch processing?
Data entry?
Both?
How many C routines they call?
Do you have the sources of such C routines?
For such money may be I can hire two good Java developers (Swing and/or JSF) and migrate all your application from COBOL to Java, Swing based (client/server) and/or JSF based (Web)
Regards.
----------------------------------------------------------------
Sergey has ports available at -
http://www.kiska.net/opencobol/
Roger
----------------------------------------------------------------
Subject: Problem HP-UX 11.11
Dear all,
I have installed open-cobol on HP-UX just fo fun at home.
When I compile a program I get:
# cobc -x hello.cob
gcc: unrecognized option `-R/usr/local/lib'
I am running
# gcc -v
Reading specs from /usr/local/lib/gcc/hppa2.0w-hp-hpux11.11/3.4.2/specs
Configured with: /scratch/njs/pkgbuild/3.3.1/hpux-11/gcc-3.4.2/configure --enabl
e-languages=c,c++ --enable-threads=posix --disable-nls --with-gnu-as --without-g
nu-ld --with-as=/usr/local/bin/as --with-ld=/usr/ccs/bin/ld --with-libiconv-pref
ix=/usr/local --prefix=/usr/local
Thread model: posix
gcc version 3.4.2
Lars
PS
I used to program in Cobol 1976--- On a Univac 1100 mainfram
----------------------------------------------------------------
Subject: REDEFINES in LINKAGE SECTION
Hello,
I try to compile some cobol programs of a professional project, but sub programs have a redefines clause in their linkage section, and OpenCOBOL don't like that.
I like to know why it is forbidden.
Exemple:
LINKAGE SECTION.
01 ZOO1.
10 FILLER PIC X(00200).
01 Z001-Z002 REDEFINES Z001.
10 Z001-TOTO PIC X(5).
10 Z001-TOTO2 PIC X(6).
...
I look in the source, and the parser made an error if it seen that. I can comment the line but...
Thanks
----------------------------------------------------------------
What OC version?
What compile options?
Please supply the complete program.
Roger
----------------------------------------------------------------
Hi,
I'm pretty busy, so it take me a long time to answer...
I cannot post the original program, but i find that :
LINKAGE SECTION.
01 ZCOM.
15 FILLER PIC X(18).
01 Z001 REDEFINES ZCOM.
10 MT-A PIC 9(6).
10 MT-B PIC 9(6).
10 RES PIC 9(6).
PROCEDURE DIVISION USING ZCOM.
MOVE MT-A TO RES.
ADD MT-B TO RES.
GOBACK.
This works.
LINKAGE SECTION.
01 ZCOM.
15 FILLER PIC X(18).
01 Z001 REDEFINES ZCOM.
10 MT-A PIC 9(6).
10 MT-B PIC 9(6).
10 RES PIC 9(6).
PROCEDURE DIVISION USING Z001.
MOVE MT-A TO RES.
ADD MT-B TO RES.
GOBACK.
This one cannot compile (Z001 / ZCOM in PROCEDURE DIVISION USING) :
addi.cob:14: Error: 'Z001' REDEFINES field not allowed here
It works with :
IBM Enterprise COBOL for z/OS 3.3.1
MicroFocus Server Express 4.0
I have OC 1.0
I try with all -std parameters
Regards
----------------------------------------------------------------
I'm not sure why there is an error but if You do not need ZCOM on program B you can delete ZCOM from linkage section and just define Z001 instead.
----------------------------------------------------------------
Subject: Initialize with Reference Modification
I've never seen an initialize like that before, maybe it is not well formed:[code]initialize mybigvar (15491:4500)[/code] This is compiled by OC (also 1.1 prerelease). Is this according to COBOL 85? With an old version of OC (cannot post the big program here and cannot test it with OC 1.1 prerelease, the old one was a later 0.33 prerelease) there was ANOTHER variable initialized that was about 18000 Bytes BEFORE mybigvar.
A small test program with 1.1 prerelease does not has that problem but I'm not sure
a) if this code is OK so that OC should compile it and
b) if this mistake couldn't occur in newer releases.
Maybe someone has noticed things like that or know if there were some changes about that in OC since the last year.
PS: After changing the code to [code]move spaces to mybigvar (15491:4500)[/code] all was fine but I did not realized that a wrong variable was changed...
----------------------------------------------------------------
Well, if I am understanding the 2002 standard
correctly, this is valid.
HOWEVER, we have a bug in OC -
01 D99 PIC X(50000).
PROCEDURE DIVISION.
INITIALIZE D99 (15491:4500).
MOVE SPACES TO D99 (15491:4500).
This generates -
/* TST.cob:12: INITIALIZE */
{
memset (b_10 + 15490, 32, 50000);
}
/* TST.cob:13: MOVE */
{
memset (b_10 + 15490, 32, 4500);
}
Which, of course, is wrong for the INITIALIZE.
I am testing a fix now.
I will post when a new tarball is available.
Roger
----------------------------------------------------------------
Preliminary fix included in current
1.1 tarball.
Please download/test.
Thanks for reporting this.
Roger
----------------------------------------------------------------
Subject: RECORD CONTAINS 0
On the mainframe, if you code record contains 0 on the fd statement, you can read in fb files of any length up to and including the size you give for the 01 level for that file(i.e. the file needn't be vb). But in OC, this doesn't work. It throws an error that the it came to the end of line too early.
Should record contains 0 behave the way it does in OC or the way it does in the cobol that comes with the mainframe?
----------------------------------------------------------------
Actually, it should not compile.
I have fixed this in the 1.1 tarball.
Roger
----------------------------------------------------------------
Why do you say it shouldn't compile? This compiles and runs in more than one version of COBOL I've used. Here is one page showing HP either supports it or is in the process. I'm not sure what status 'D' stands for.
http://docs.hp.com/cgi-bin/doc3k/BB243390012.12979/86
----------------------------------------------------------------
From HP Docs -
Implementation Status of the Feature
(space) Fully implemented.
I Fully implemented, but another directive* (not the
dialect one) enables it.
U Syntax support but no run time support in some
environments.
D Implemented as documentary.
G A group of features.
:-) :-)
Roger
----------------------------------------------------------------
Subject: Problem with LINE SEQUENTIAL and RECORD IS VARYING
The following program compiles and runs fine under HP,Acucobol and Kobol but does not compile under Opencobol. I believe this is a bug.
IDENTIFICATION DIVISION.
PROGRAM-ID. test01.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT INFILE ASSIGN INPUT-FILE
ORGANIZATION IS LINE SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS INPUT-STATUS .
SELECT OUTFILE ASSIGN OUTPUT-FILE
ORGANIZATION IS LINE SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS OUTPUT-STATUS .
DATA DIVISION.
FILE SECTION.
FD INFILE
RECORD VARYING FROM 1 TO 4096 CHARACTERS
DEPENDING ON INPUT-LEN
.
01 INPUT-REC PIC X(4096).
FD OUTFILE
RECORD VARYING FROM 1 TO 4096 CHARACTERS
DEPENDING ON OUTPUT-LEN
.
01 OUTPUT-REC PIC X(4096).
WORKING-STORAGE SECTION.
01 INPUT-FILE PIC X(196) VALUE 'IN'.
01 INPUT-STATUS PIC XX.
01 INPUT-LEN UNSIGNED-SHORT VALUE 4096 .
01 OUTPUT-FILE PIC X(196) VALUE 'OUT'.
01 OUTPUT-STATUS PIC XX.
01 OUTPUT-LEN UNSIGNED-SHORT VALUE 4096 .
PROCEDURE DIVISION.
A000-BEGIN.
OPEN INPUT INFILE.
OPEN OUTPUT OUTFILE.
READ INFILE
AT END
STOP RUN
NOT AT END
MOVE INPUT-LEN TO OUTPUT-LEN
MOVE INPUT-REC TO OUTPUT-REC
END-READ.
WRITE OUTPUT-REC
CLOSE INFILE.
CLOSE OUTFILE.
STOP RUN.
----------------------------------------------------------------
Not a bug.
LINE SEQUENTIAL is not part of any standard.
I believe it was invented by MF.
L/S files are neither fixed nor variable in
the Cobol sense (And that is how MF document it).
So the RECORD clause is not allowed.
Roger
----------------------------------------------------------------
How else can a program read in a text file and know the bytes read? Or for that matter if you wish to write a text file of a fixed length (with trailing spaces)? Yes you can hard code an FD for each required record length but it is much better to handle it with a "RECORD IS VARYING FROM X TO Y BYTES DEPENDING ON Z". Then when you read or write a record, you the programmer can control the record sizes.
----------------------------------------------------------------
You obviously do not understand what LINE SEQUENTIAL is.
You want to write a "text file" of "fixed length"?
Easy, define it as your desired fixed length
(not LINE SEQUENTIAL) and put the trailing new-line yourself as the last byte in the record.
When L/S records are written, trailing spaces are
removed and a new-line is automatically appended.
When L/S records are read, bytes are transferred to
the record area until a new-line is hit. The remaining
bytes in the record area are initialized to space.
What's the problem?
This incidentally is exactly what MF and ACU do.
Roger
----------------------------------------------------------------
Subject: OC and z/Linux
Has anyone tried to install OC on z/Linux?
I'm waiting to get access to the box, so I thought I would check beforehand.
----------------------------------------------------------------
Should not be any problem.
Make sure all the prerequisites are
in place (see README).
Recommend you use OC 1.1.
General z/Linux info on wikipedia -
http://en.wikipedia.org/wiki/Linux_on_zSeries
Scrolling down to "Developer Resources", I notice
that IBM offer "test drive" facilities. Interesting.
I may look at that myself.
Roger
----------------------------------------------------------------
Subject: install problem
Hi,
i've an installation problem on a linux redhat 6.2
i've installed libgmp and opencobol 1.1
when i complie a program and run ...
this is the error
error in loading shared libraries:libcob.so.1
cannot open shared object file: no such file o directory
the file exist in /usr/local/lib/
and i linked it manually in etc/profile but the problem continue
tks for an help
Lu
----------------------------------------------------------------
Read the README :-)
In particularly, the part regarding ldconfig.
Roger
----------------------------------------------------------------
I've installed gmp
But, when I try ./configure for open-cobol-1.0 :
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking gmp.h usability... no
checking gmp.h presence... no
checking for gmp.h... no
configure: error: gmp.h is required
How gmp must be installed ?
Thanks for your help.
----------------------------------------------------------------
It might help if you reported -
a) For which system
b) How you installed GMP
You did notice this in the README? -
----
o GNU MP (libgmp) 4.1.2 or later
http://gmplib.org
*** Note - Recent Linux distributions have runtime
AND development packages; BOTH are required ***
----
Roger
----------------------------------------------------------------
Subject: Reading DAT and IDX files from Micro Focus cobol
Hi, i've been browsing this site and i'm trying to read (and maybe even write to) DAT and IDX files from a legacy Micro Focus cobol application. Can i use OpenCobol to do this?
Thanks in advance...
Chris
----------------------------------------------------------------
If I am right: This is not possible. I would suggest to unload the files via MF into a text file and load this file via OC into one of the possible index sequential files (I think BDB is the standard type).
----------------------------------------------------------------
Most likely the index (IDX) file is completely worthless to you. It is, however, likely that the DAT file is just data. You may need to look at it with an advanced editor or even a hex editor to know whether it is ASCII or EBCIDIC, and how it has encoded things like packed numbers.
I haven't used MicroFocus since '95, but then, I think the DAT files were just fixed length data. It's been a while, though :lol: .
----------------------------------------------------------------
Thanks for the help, although its not really good news!
----------------------------------------------------------------
Subject: Problem with compiling (newbie)
I'm working with cygwin on Vista, and running into a problem with the standard Hello World program. I've tested gcc and it works fine for C programs, but when trying to compile a COBOL program I get the following.
$ more hello.cob
IDENTIFICATION DIVISION.
PROGRAM-ID. hello.
PROCEDURE DIVISION.
DISPLAY "Hello World!".
STOP RUN.
$ cobc -x hello.cob
hello.cob:1: Warning: Invalid indicator 'I' at column 7
It does create an executable, but it does not display anything when it is run.
Has anyone run into a problem like this before?
----------------------------------------------------------------
Try "cobc -x -free hello.cob"
----------------------------------------------------------------
Thank you, that solved the problem.
----------------------------------------------------------------
indent your code with 7 spaces, this is an old throwback to the required formatting for cobol, the 1st 7 characters were reserved for line numbers.
----------------------------------------------------------------
Subject: MVS port
Is anyone interested in porting OpenCobol to MVS? There has been a recent breakthrough on MVS. The freely available MVS 3.8j (24-bit) has been converted into MVS/380 which allows 31-bit programming with more than 16 MB of memory (something like 700 MB is allowed) with the caveat that only one application at a time that uses that above-the-line memory can be run at a time.
In addition, it comes with a port of GCC 3.2.3 which is now a conforming compiler if you don't count the odd bug that hasn't been fixed yet, and also the C runtime library provided is not quite conforming too. Which may or may not affect Open Cobol.
There may be some actual real MVS sites out there with a legacy app written in Cobol that needs more than 16 MB of memory and they may be able to run it on Open Cobol running under MVS/380 if it were available. It would be nice to have some "real" users. :-)
MVS/380 is available here:
http://mvs380.sourceforge.net
Source for the supplied applications is on different sourceforge sites. I tried downloading Open Cobol 1.0 to see if it compiled on GCCMVS but couldn't even get it to compile on my Windows Vista system with Cygwin (various errors in configure which I'd have to investigate).
Can anyone tell me if OpenCobol uses any extensions to C90 at all? I had a look at some of the code and it looks clean.
I did a grep and found some mention of MVS, but I know it is not listed as a supported platform. What do you think would be required to get it to the point where it can at least compile and run simple Cobol programs that read from a sequential dataset and produce a report to the printer? That would at least provide a basis on which to work.
Note that Bison 1.35 and Flex 2.5.4a have also been ported to MVS/380. But not Bison 1.875 which is listed as a requirement. I think that contains non-C90 stuff like fork().
BFN. Paul.
----------------------------------------------------------------
Paul,
I did z/OS (OMVS) OC 0.33 port once, but that was mostly to check if OC can work in EBCDIC environment. I think nobody used it for real. If your C/C++/libraries are limited, OC will be the least of your worries. It was a big headache to build GMP and BDB even with a native "cc" under OMVS.
Regards,
Sergey
----------------------------------------------------------------
Hi Sergey. Does the procedure you used to do the z/OS port still exist? Perhaps it could be documented and made part of current Open Cobol?
I don't have C++ libraries, just C libraries. Does some component use C++? The C library is pretty complete (close to C90 standard).
Can you tell me something about the GMP and BDB problems?
I assume you overcame these problems, so do you have a patch of some sort with your changes?
BFN. Paul.
----------------------------------------------------------------
Hi Paul,
BDB (4.4.20) went relatively easy - small patch in log.c and tweaking of configure and small editing of Makefile after...
GMP (4.2.1) is another story. For whatever reason z/OS can't link if you have 2 object filenames with the same name, even in a different directories. Some dependencies on CSECT generation... So you have to rename all mpn/, mpq/, and mpz/ source files (or to have a symbolic links with a different names, that's how I did) to have a different names.
Of course you can't use Makefile-s produced by configure, so it was better just to write shell scripts for compile/link
And of course about 7 different source patches :-)
If you want to see this stuff, grab it from z/OS part of this page:
http://www.kiska.net/opencobol/0.33/index.html
Regards,
Sergey
----------------------------------------------------------------
Sergey, interesting to see your port. Given that you've already made all the code work on z/OS, then what do you believe I would need to do to port this to a pure C90 environment on MVS 3.8j/380?
As I see it, I need to:
1. Create JCL to do all the compiles.
2. Potentially replace open() with fopen() etc if people have used Posix instead of C90 functions. Note that I already have such routines which I needed to do to port GCC itself to MVS 3.8j/380.
Can you tell me if there is anything fundamental I am missing? E.g. if OpenCob generates non-standard C code relying on fork() to exist or something like that, then I will not attempt to proceed. But if OpenCob generates standard C90 code or close, then it would seem doable.
BTW, what's the reason this was required?
s390\gmp-4.2.1\mpz>diff inp_str.c.orig inp_str.c
83c83
< if (c == '-')
---
> if (c == (unsigned char)'-')
98c98
< if (c == '0')
---
> if (c == (unsigned char)'0')
103c103
< if (c == 'x' || c == 'X')
---
> if (c == (unsigned char)'x' || c == (unsigned char)'X')
109c109
< else if (c == 'b' || c == 'B')
---
> else if (c == (unsigned char)'b' || c == (unsigned char)'B')
119c119
< while (c == '0')
---
> while (c == (unsigned char)'0')
I've never seen a need to do something like that before and I would have assumed that that change would have had no functional effect.
BFN. Paul.
----------------------------------------------------------------
Hi Paul,
1. OpenCobol is not using fork(). There is no fork() on Windows too. It uses "system" call to call components of the compilation process (i.e. cobc, c compiler, linker).
2. BDB (that might be critical) is actively using multithreading and pthread library. If you don't have that, than you need to think how to implement ISAM files...
3. > I've never seen a need to do something like that
< if (c == '0')
---
> if (c == (unsigned char)'0')
If you force "char" to be "unsigned" (which is actually default in IBM C on z/OS), you might get another problems because I saw part of the code relying on "signed"...(If you saw my build files you should see "-Wc,LONGLONG,CHARS(SIGNED)"
OC itself should not have this problem (I've actually never checked), but I believe GMP and BDB might have.
Otherwise the value of '0' is negative in EBCDIC :-)
Regards,
Sergey
----------------------------------------------------------------
Ok, I will need to replace the system() to the linker etc and instead get OpenCobol to finish as soon as the C code has been generated. It will be a separate job step to do the C compile, and the assemble, and the link. Passing the appropriate intermediate files between programs is best done (and pretty much only possible to be done) via JCL. Otherwise you can't specify all the DCB attributes and space requirements, things like that.
If BDB is using multithreading, and there's no easy way to switch that off, I might just skip support for ISAM files. I'm more interested in having Cobol reporting programs that read sequential files working. ISAM can be added another day. Or does sequential file access go through BDB too?
Wow, I would have never guessed that chars were being forced to being signed on an EBCDIC machine. That's actually against the C standard. The basic character set must be represented as positive numbers. Something else needs to change if that doesn't work.
Ok, I think I'll give it a go. I'll need to know which C files to compile for MVS. I'll assume all of them need to be compiled and delete any if I find errors.
Is there any reliance on C++? I don't have C++ available, so that would put an immediate end to the attempt.
BFN. Paul.
----------------------------------------------------------------
> signed on an EBCDIC machine. That's actually against the C standard
IBM compilers have char-s unsigned by default. All other compilers by default using signed char. It's not in C standard I think.
> Is there any reliance on C+
No. At least so far no.
> get OpenCobol to finish as soon as the C code has been generated
There is "-C" option for that. You can use it and make system() call just void function. But the same limitation will be in Cobol runtime if you want to "run the unit".
Regards,
Sergey
----------------------------------------------------------------
>> signed on an EBCDIC machine. That's actually against the C standard
> IBM compilers have char-s unsigned by default.
> All other compilers by default using signed char.
> It's not in C standard I think.
The C standard is that the basic character set must
be positive values. If a signed char can do that,
that's fine, and on most ASCII compilers that will
be the case, and that's what they use as a default.
But EBCDIC machines can't do that as a signed char,
so the default is unsigned char, and if you switch
that to signed char, then the compiler will cease
to be conforming (on that platform).
A C program that relies on chars to be signed by
default is non-conforming.
> There is "-C" option for that. You can use it and make
> system() call just void function. But the same limitation
> will be in Cobol runtime if you want to "run the unit".
Can you explain this please? The Cobol runtime will
be statically linked into the executable the same
way that the C runtime library is, won't it? Or is
that not supported?
BFN. Paul.
----------------------------------------------------------------
> "run the unit".
I mean that in Cobol you have a functions to spawn a separate process (CALL SYSTEM, etc) which uses of course underlying "system()" function.
Cobol also has "dynamic" calls, which resolved thru "dlopen" and etc functions (or equivalent LoadLibrary on Win) - do you have that in MVS ?
Otherwise you should rewrite those parts of runtime too.
Regards,
Sergey
----------------------------------------------------------------
> I mean that in Cobol you have a functions to spawn a
> separate process (CALL SYSTEM, etc) which uses of course
> underlying "system()" function.
Ok, for that I'll just say "call system" is not
supported in this subset.
> Cobol also has "dynamic" calls, which resolved
> thru "dlopen" and etc functions (or equivalent
> LoadLibrary on Win) - do you have that in MVS ?
Certainly I don't have it at the moment, but that
should be able to be added in the future too.
> Otherwise you should rewrite those parts of runtime too.
But to run a simple Cobol reporting program, I don't
need to worry about this now, right? Everything that
is needed to compile and run it just needs a standard
C90 compiler, right?
Note that the specifics of what system() actually
does is outside the scope of C90, so I'm not
concerned that I don't support that functionality.
BFN. Paul.
----------------------------------------------------------------
I've been hoping for an mvs port for a long time. Don't forget to post back if you get it working.
----------------------------------------------------------------
[quote]
jasorn wrote:
I've been hoping for an mvs port for a long time. Don't forget to post back if you get it working.[/quote]
I've only had a quick look at it, and there are things like cobc.c including sys/stat.h, so it's apparently not C90-compliant.
Meanwhile, I have been working on PDPCLIB, bringing it up to C90-compliance. That has now been achieved, so we have a free C90 compiler available on MVS. Not only that, but MVS/380 has just been released so now you have a free MVS without memory restrictions. And a new version of GCCMVS too.
So the underlying components are now in place and can be obtained from:
http://mvs380.sourceforge.net
http://gccmvs.sourceforge.net
http://pdos.sourceforge.net
I haven't decided which project to start on yet.
An OpenCobol port to MVS/380 is certainly one
possibility, but other interesting things are
getting PDPCLIB to support more compilers (e.g.
IBM C), upgrading GCC from 3.2.3 to 3.4.6
level, getting GCC ported to some more
environments - specifically DOS/VSE and MUSIC/SP,
and creating a 380 (31-bit) version of DOS/VS.
A lot also depends on what other people are doing.
If others are working on something that I can
assist with, I generally prefer to do that as
it provides more results. The current burst of
activity is people trying to use GCC + PDPCLIB
in different aspects of VM/CMS, so I'll probably
be assisting there until they run out of steam.
BFN. Paul.
----------------------------------------------------------------
Subject: [fixed] 1.1 - undefined symbol: cob_save_call_params (newbie)
I'll switch to 1.0, but I get this error:
$ cobc -x hello.cob
$ ./hello
./hello: symbol lookup error: ./hello: undefined symbol: cob_save_call_params
$ cat hello.cob
* Hello World Program
* GPL Copyleft Jonathan Riddell 2001
IDENTIFICATION DIVISION.
PROGRAM-ID. hello.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
DISPLAY "hello ," WITH NO ADVANCING
DISPLAY "world!"
STOP RUN.
----------------------------------------------------------------
I get the same thing in 1.0. I'm running on Gentoo Linux.
----------------------------------------------------------------
[quote]
cat test01.cbl
* Hello World Program
* GPL Copyleft Jonathan Riddell 2001
IDENTIFICATION DIVISION.
PROGRAM-ID. hello.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
DISPLAY "hello ," WITH NO ADVANCING
DISPLAY "world!"
STOP RUN.
$ cobc -x -free test01.cbl
$ ./test01
hello ,world!
[/quote]
Your Program works on my System (Debian Etch, OC 1.1)
Is that your 1rst installation ?
Uninstall previous release correctly ?
Regards
Bear
----------------------------------------------------------------
[quote]
Uninstall previous release correctly ?
[/quote]
That was it. I had gentoo emerged 0.32 before installing the 1.1. Fixed.
----------------------------------------------------------------
Subject: Newb: Error: syntax error, unexpected TOK_FILE, expecting $end
Ok so I had to write a program for school in percobol and it compiles just fine. But I wanted it to run on linux in native code instead of java (juk). However opencobol gives an error that I don't quite understand:
ProjectOverzicht-ErikDeRijcke.cbl:12: Error: syntax error, unexpected TOK_FILE, expecting $end
link to the full program code:
http://pastebin.com/m7ec8d95c
I'm still a total cobol noob so hints and tips on how to succesfully compile and improve my code would be greatly appreciated.
----------------------------------------------------------------
1. Which OC-version are you using? (cobc -v)
2. remove "record contains 80 characters", because the record size is defined with first entry after your fd-clause
3. If you like, you could write [code]
move low-values to projectkeuze, outputkeuze, totaletijd[/code]
4. In alleprojekten and enkelproject there are some performs, that are allways done. Maybe you want to put them after end-evaluate.
5. I personally prefer sections instead of paragraphs when using perform.
----------------------------------------------------------------
cobc (OpenCOBOL) 1.0.0
Copyright (C) 2001-2007 Keisuke Nishida
Copyright (C) 2007 Roger While
I managed to rewrite my original percobol code and now the error is gone. No idea what caused it though :s Now I get errors on the embedded sql, opencobol doesn't support it I guess?
Anyway thanks for the tips, I'll make sure to change my code accordingly! :)
----------------------------------------------------------------
The original program has the following problems -
1) The "data division" starts in column 7.
As "d" in the indicator column (7) denotes a debugging
line, this line is ignored (per default) causing the original error.
2) The RECORD CONTAINS clause is invlaid for LINE
SEQUENTIAL files (This has been relaxed to a warning
in OC 1.1)
3) Level 77 entries are not allowed in FD clauses.
(Should be 01)
4) The "EQUALS" keyword is not Cobol standard.
(It is accepted in OC 1.1)
5) EXEC-xxx is not supported.
Roger
----------------------------------------------------------------
Subject: screen section not identified
Hi,
I am using SCREEN SECTION in my program and the error is : unexpected SCREEN expecting WORD or LITERAL.
pls let me know if there is any changes in defining a SCREEN SECTION.
thanks
sm
----------------------------------------------------------------
There is no support for Screen Section in OC.
@simrw: Maybe a good thing for a compiler message 'Screen Section not supported'?
----------------------------------------------------------------
Subject: Re: REDEFINES in LINKAGE SECTION
I think that i have some solutions :
- Use the first program (in USING clause, ZCOM and not Z001)
- Define ZCOM as group containing Z001
I think those two solutions are similar (ie when i change a value in Z001, ZCOM change too).
But i have a lot of program like that, and i need to find an automatic procedure.
Regards
----------------------------------------------------------------
Sorry, seems i click on new topic, and not reply to...
----------------------------------------------------------------
The Cobol standard is quite clear in this respect
(85 and 2002).
Excerpt from USING clause -
Data-name-1 shall be defined as a level 01 entry or a level 77 entry in the linkage section. A particular
user-defined word shall not appear more than once as data-name-1. The data description entry for
data-name-1 shall not contain a BASED clause or a REDEFINES clause.
End excerpt.
Do not think that you can take out the check
in the parser. That will not work.
Roger
----------------------------------------------------------------
I think i can use ZCOM in USING clause.
If i made a modification in Z001, modification will be reported to Z001 ???
This code is generated by a IBM tools.
I just post in case you want to make opencobol compatible with IBM Compiler and microfocus compiler...
Regards
----------------------------------------------------------------
Just change all your programs via command line tools, like sed in unix environment and make them work according to the cobol standards. This would help you to compile them on OC, MF, ACU, IBM etc.
Non-standard stuff works only in some environments.
----------------------------------------------------------------
If that stuff is generated by IBM tools, then I would
complain very loudly to IBM for not following
the standards.
Roger
----------------------------------------------------------------
Subject: What are these command line options for? (solved)
[quote]cobc
-fstatic-linkage Statically allocate non-USING LINKAGE parameters
-fstack-check PERFORM stack checking[/quote]What does these parameter are helpful for, should they be set normally?
Edit: Thank you!
----------------------------------------------------------------
To answer the second question first, no, you
would not normally need to set these parameters.
-fstack-check
On a Cobol per-module basis, PERFORM processing
is done by pushing/popping information onto
a locally declared stack. This has a fixed size of 255.
The -fstack-check generates code to detect if the
stack overflows.
This option is automatically turned on if you
specify one or both of "-g", "-debug".
-fstatic-linkage
As stated in the help, this only applies to
LINKAGE data items that are not referenced in
the PROCEDURE DIVISION USING clause.
Normally, LINKAGE items lose their validity
when exiting the module (they are local).
This option causes these data items to be statically
allocated thus retaining their validity after the module
has exited.
Roger
----------------------------------------------------------------
Subject: Emtpy programs are compiled without an error
I think this program should not be compiled, because of missing procedure division, but OC does. Is this wanted?[code] IDENTIFICATION DIVISION.
PROGRAM-ID. shorttest.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.[/code]
----------------------------------------------------------------
This is perfectly OK.
According to the standard, the minimum valid
program is the one-liner :
PROGRAM-ID. shortest.
Which is valid either as a main program
or as a callable module.
:-)
Roger
----------------------------------------------------------------
Can we invent a new warning (not set by -Wall)?
-Wempty
----------------------------------------------------------------
Why?
Neither MF nor ACU produce any warning.
Roger
----------------------------------------------------------------
Because a warning would be a nice feature for everybody who doesn't like to have such programs. Y/N?
----------------------------------------------------------------
N :-)
Why produce a warning for a valid program?
Roger
----------------------------------------------------------------
Subject: debug with gdb
Hi:
Can open-cobol debug with gdb?
I test it, but I found it uses generated C source file rather than Cobol source file for debugging.
Is it possible to trace through the cobol source code?
open-cobol version 1.1
Thank you very much :)
----------------------------------------------------------------
Can anyone tell me some information about this?
Can the gdb debugger trace through the cobol source code?
Thank you so much!
----------------------------------------------------------------
No, only the C code.
Until recently, we did have #line directives
(optionally) generated. BUT, this did not work.
gdb (and other variants eg. ddd) got confused with
the #line directives referring to eg.
#line 10 "abc.cob"
after returning, gdb would complain that current line
number was out of range.
(Clearly the case with the C code, as the C line number
is way bigger)
Roger
----------------------------------------------------------------
That's OK.
Thanks for your reply :-)
----------------------------------------------------------------
Just curious..
What are the plans to make it work? It seems that it technically possible because it works with the Fortran compiler, Isn't it?
Thanks!
----------------------------------------------------------------
Fortran is a front-end for gcc :-)
Actually, if you use the -ftraceall compile
option in latest OC 1.1, you will get a statement
trace on stderr. And the generated C code reflects
this, so you can see it with gdb; eg.
/* roger.cob:19: SET */
cob_set_location ("roger", "roger.cob", 19, "MAIN SECTION", "MAIN PARAGRAPH", "SET");
Roger
----------------------------------------------------------------
OK, thank you very much :)
Jason
----------------------------------------------------------------
Also with current OC 1.1, if you specify
"-g" and/or "-debug", the "cob_set_location" calls
will be generated. There will be no print to stderr
unless you specify "-ftraceall".
Roger
----------------------------------------------------------------
Subject: Migrating MF to OC: INVALID KEY
Hi,
I'm new to OC and I'm trying to migrate my cobol sources from MF to OC.
In one of my sources I have a structure like this:
WRITE F1LIGNE
INVALID KEY DISPLAY "ERROR"
GO EXIT-PROGRAM
END-WRITE
which causes the error INVALID KEY clause invalid with this file type. Before it was succesfully compiled by MF.
Best regards,
Geert
----------------------------------------------------------------
Please submit the full INPUT-OUTPUT SECTION and FILE SECTION to the mentioned program. If the file is not indexed, the message would be right.
----------------------------------------------------------------
Ok, here is my Input-Output and File section.
INPUT-OUTPUT SECTION.
*=====================
FILE-CONTROL.
SELECT F1 ASSIGN TO DYNAMIC FILIMP
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
*==============
FILE SECTION.
*=============
FD F1 RECORD IS VARYING IN SIZE
FROM 1 TO 132 CHARACTERS
DEPENDING ON LONREC.
01 F1LIGNE PIC X(132).
Thanks in advance,
Geert
----------------------------------------------------------------
As I said before: there is no key on line sequential files and therefore no need for your piece of [code]INVALID KEY DISPLAY "ERROR"
GO EXIT-PROGRAM[/code]. Just delete it, this will work with oc and mf.
----------------------------------------------------------------
Indeed, the clause is invalid.
Note that if the write is changed to a read,
then MF produces -
simlinux:~ # cob mffile.cob
33 read infile invalid key go to start-100.
* 368-S**************************** **
** Exception phrase inappropriate
This is very clearly a MF deficiency.
I will raise a bug report against MF SE (2.2and 4.x).
And you should do the same.
The syntax is invalid for WRITE to a SEQUENTIAL file
both according to Cobol standard and MF documentation.
Roger
----------------------------------------------------------------
Thanks for your quick answer.
Is there a way to detect if this write is invalid? Or is it something like "IF NOT ACCES-OK"?
Regards
----------------------------------------------------------------
You can compare the file status, see mf-docu at http://supportline.microfocus.com/documentation/books/nx50/lhtocc.htm 'ANSI File Status Summary' --> 'I/O-STATUS'
Status '00' means always operation successful.
----------------------------------------------------------------
Subject: Migrating from MF to OC: "Indexed by"
Hi all,
in my cobol programs I have a variable with an index:
01 EUXXV.
...
07 TABDIN OCCURS 00020 INDEXED BY NUMDIN.
when I want to put this index on 1 like the following line, I got an error from cobc.
SET NUMDIN OF EUXXV TO 1.
Error: 'NUMDIN' in 'EUXXV' undefined
This isn't normal, is it? I think it is a bug, I created already a bug report on the sourceforge page (request ID:1939997)
Is there a workaround for this problem?
Best regards,
Geert
----------------------------------------------------------------
Hi,
I found the problem. When using an indexed by the INDEXED BY construction cobc will create a global variable in his generated C-code and this must be logically unique. There is no need to specify the table.
In my case this results in:
SET NUMDIN TO 1.
Best regards,
Geert
----------------------------------------------------------------
Actually, according to the standard, qualification
of an INDEXED BY item is allowed.
So, the following is valid code and should
be correctly interpreted by OC (I have a fix in test) -
01 AA.
03 BB PIC X OCCURS 10 INDEXED BY ZZ.
01 CC.
03 DD PIC X OCCURS 10 INDEXED BY ZZ.
Note that the 2 "ZZ" items are 2 unique fields.
SET ZZ OF BB OF AA TO 1.
or (in this case)
SET ZZ OF AA TO 1.
Also qualification is allowed even if the
referenced item is unique.
I will post when the fixes have been
included in the 1.1 tarball.
Roger
----------------------------------------------------------------
OK. Fix applied.
OC 1.1 tarball updated.
Roger
----------------------------------------------------------------
Subject: roadmap for open cobol ?
Hi, I am new one here. I have installed OC1.1 under Linux and
tried to convert 2 typical mf-sources:
a) the first accept/display related with diverse mf-extensions like "with size, with secure, with grid, etc."
b) the second with i-o work - split keys etc.
I could change the a) source to compile without error, but
the execution is very poor (function keys makes big problems)
The b) source could not be compiled to the end, because OC
does not support the "split keys" - it is since essential
since 25 years
My question is if there is a roadmap to point b) ?
----------------------------------------------------------------
What I did was the following:
the split key with the fields key-part-1a and key-part-1b
05 key-part-1a pic x.
05 key-part-1b pic x.
changed to split key key-part-1
05 key-part-1.
10 key-part-1a pic x.
10 key-part-1b pic x.
I do not know for sure if this is the only working solution, but it works for now.
----------------------------------------------------------------
Hi, I'd like to know if the feature about the "Split Keys"'s support is viable for next OpenCobol's implementations?
Thanks!
----------------------------------------------------------------
Subject: file status on concurrent access
I noticed strange behaviour on a program during migration.
This program opens a text file for input and an indexed file for output. I ran many times successfully until I made a mistake and ran it again without paying attention that the first process was not terminated.
My problem is that nothing happened : no message, no error,
so I modified the lock mode, declaratives, and tried again. Same results as if there were two different programs running for two different indexed
files.
I suppose I've forgot something ?
My system Debian Etch
OpenCobol 1.1.0 April 2008 (latest tarball)
Regards
----------------------------------------------------------------
Assuming you are using BDB.
For multi-user access/locking with BDB,
you need to activate BDB concurrency.
This is done by setting/exporting the
environment variable "DB_HOME" to a
directory that is read/writable for all
users that should be able to access the files.
Notes -
a) This requires BDB version >= 4.1
b) Files that do not resolve to an absolute
path will be created in the above directory.
Also note the above is not OC specific, this
is general BDB usage.
(I am considering defaulting DB_HOME to something or other
if not defined by the user)
Roger
----------------------------------------------------------------
Thank You Roger,
I was only concentrated in my OC environment, and of course I have no idea how BDB works ;-).
Yes I'm working with BDB >=4.1
My working directory (in witch I store all my OC files) looks like "/users/something" : so I will test again.
Best Regards.
Bear
Is someone kind enough to tell me where can I find BDB documentation / information useful for OC (and for me).
Thanks
----------------------------------------------------------------
Hi,
Setting DB_HOME to my working directory gives great results.
I added some lines in my program in order to display file status after every IO statement.
I ran first process (more than 250 000 items to be loaded on a indexed file) - Ok
As this process was still working, I ran same program : this time I have a file status = 61 on open output for my indexed file.
then every write statement is invalid (which is normal) and
gives up a status of 48 (which is understandable).
what is file status 61 ?
Best regards
----------------------------------------------------------------
This is an interesting question. MF says nothing about status 61 http://supportline.microfocus.com/documentation/books/nx50/lhpdf613.htm
----------------------------------------------------------------
Excerpt from the Cobol standard -
*****
9.1.12.7 Record operation conflict condition with unsuccessful completion
1) I-O status = 51. The input-output statement is unsuccessful due to an attempt to access a record that is
currently locked by another file connector.
2) I-O status = 52. The input-output statement is unsuccessful due to a deadlock. The implementor shall specify
under what conditions a deadlock is detected.
3) I-O status = 53. The input-output statement is unsuccessful because the statement requested a record lock, but
this run unit holds the maximum number of locks allowed by this implementation.
4) I-O status = 54. The input-output statement is unsuccessful because the statement requested a record lock, but
this file connector holds the maximum number of locks allowed by this implementation.
9.1.12.8 File sharing conflict condition with unsuccessful completion
1) I-O status = 61. A file sharing conflict condition exists because an OPEN statement is attempted on a physical
file and that physical file is already open by another file connector in a manner that conflicts with this request.
The possible violations are:
a) An attempt is made to open a physical file that is currently open by another file connector in the sharing
with no other mode.
b) An attempt is made to open a physical file in the sharing with no other mode and the physical file is
currently open by another file connector.
c) An attempt is made to open a physical file for I-O or extend and the physical file is currently open by
another file connector in the sharing with read only mode.
d) An attempt is made to open a physical file in the sharing with read only mode and the physical file is
currently open by another file connector in the I-O or extend mode.
e) An attempt is made to open a physical file in the output mode and the physical file is currently open by
another file connector.
*****
Roger
----------------------------------------------------------------
Is there a public access to the quoted standard?
----------------------------------------------------------------
No, you have to pay for both the 85 and the 2002
standard.
Roger
----------------------------------------------------------------
Thank you Roger ...
By the way I see that human has great interest for OC .
Good Job
----------------------------------------------------------------
The working document for the next proposed
standard from the J4 committee is publicly available at :
http://www.cobolstandard.info/j4/files/std.zip
Roger
----------------------------------------------------------------
Subject: Moving values to packed numerics defined with decimals
Hello,
we're migrating from MicroFocus to OpenCobol at the moment.
Seems like we've discovered the following problem.
Example program:
[code]WORKING-STORAGE SECTION.
01 W-FIELDS.
05 W-TEST1 PIC S9(06)V9(06) COMP-3 VALUE ZERO.
05 W-TEST2 PIC S9(06)V9(06) VALUE ZERO.
05 W-TEST3 PIC S9(06) COMP-3 VALUE ZERO.
05 W-TEST4 PIC S9(06) VALUE ZERO.
05 W-TEST5 PIC 9(06) COMP-3 VALUE ZERO.
05 W-TEST6 PIC 9(06) VALUE ZERO.
05 W-TEST7 PIC 9(06)V9(06) COMP-3 VALUE ZERO.
05 W-TEST8 PIC 9(06)V9(06) VALUE ZERO.
PROCEDURE DIVISION.
MOVE 999999 TO W-TEST1.
MOVE 999999 TO W-TEST2.
MOVE 999999 TO W-TEST3.
MOVE 999999 TO W-TEST4.
MOVE 999999 TO W-TEST5.
MOVE 999999 TO W-TEST6.
MOVE 999999 TO W-TEST7.
MOVE 999999 TO W-TEST8.
DISPLAY 'W-TEST1 [' W-TEST1 ']'.
DISPLAY 'W-TEST2 [' W-TEST2 ']'.
DISPLAY 'W-TEST3 [' W-TEST3 ']'.
DISPLAY 'W-TEST4 [' W-TEST4 ']'.
DISPLAY 'W-TEST5 [' W-TEST5 ']'.
DISPLAY 'W-TEST6 [' W-TEST6 ']'.
DISPLAY 'W-TEST7 [' W-TEST7 ']'.
DISPLAY 'W-TEST8 [' W-TEST8 ']'.
MOVE 999999,0 TO W-TEST1.
MOVE 999999,0 TO W-TEST7.
DISPLAY 'W-TEST1 2nd time [' W-TEST1 ']'.
DISPLAY 'W-TEST7 2nd time [' W-TEST7 ']'.[/code]
Output:
[code]W-TEST1 [000728379968-] <-- what happened here?
W-TEST2 [999999000000+]
W-TEST3 [999999+]
W-TEST4 [999999+]
W-TEST5 [999999]
W-TEST6 [999999]
W-TEST7 [000728379968] <-- what happened here?
W-TEST8 [999999000000]
W-TEST1 2nd time [999999000000+] <-- now it's ok
W-TEST7 2nd time [999999000000] <-- now it's ok[/code]
Expected Output:
[code]W-TEST1 [999999000000+]
W-TEST2 [999999000000+]
W-TEST3 [999999+]
W-TEST4 [999999+]
W-TEST5 [999999]
W-TEST6 [999999]
W-TEST7 [999999000000]
W-TEST8 [999999000000]
W-TEST1 2nd time [999999000000+]
W-TEST7 2nd time [999999000000][/code]
cobc (OpenCOBOL) 1.0.0
using the -std=mf flag
HP-UX machinename B.11.31 U ia64 3567537583 unlimited-user license
Thanks for help...
LeBoepp
----------------------------------------------------------------
Can you try with OC 1.1.0 ?
----------------------------------------------------------------
We are now going to install OC 1.1.0 pre-release.
I'll inform you on the results.
Alternatively, we'll have to change all our sources. :-(
Thanks!
----------------------------------------------------------------
Yep, bug in OC.
I have just put a preliminary fix into the
code and updated the 1.1 tarball.
If you have downloaded prior to the date/time of
this post, then please redownload.
Roger
----------------------------------------------------------------
It works! :-D
Output looks like expected now:
[code]W-TEST1 [999999000000+]
W-TEST2 [999999000000+]
W-TEST3 [999999+]
W-TEST4 [999999+]
W-TEST5 [999999]
W-TEST6 [999999]
W-TEST7 [999999000000]
W-TEST8 [999999000000]
W-TEST1 2nd time [999999000000+]
W-TEST7 2nd time [999999000000][/code]
Thanks a lot!
LeBoepp
----------------------------------------------------------------
Hm... there is no entry for that in cobc/ChangeLog
----------------------------------------------------------------
Subject: Migrating MF -> OC: Occurs with Depending on
Hi,
We have a strange problem with the execution of a program generated by OC.
In our Worker data we have a table (TABROU) which has a dynamical length (NBR-ROUTINES).
03 TABROU OCCURS 0 TO 9999 TIMES
DEPENDING ON NBR-ROUTINES.
This variable length (NBR-ROUTINES) causes very strange generated c code.
When changing this variable length by a fixed length everything works like it should be.
Is this a bug in OC?
Best regards,
Geert
----------------------------------------------------------------
Sorry, it's not clear what your problem is.
Please post some code.
There are no known problems with variable length.
Roger
----------------------------------------------------------------
Hi,
I created a little cobol program as an example to show you what I mean with my previous post.
[code]
IDENTIFICATION DIVISION.
*===========================*
PROGRAM-ID. EXAMPLE.
AUTHOR. GEERT.
ENVIRONMENT DIVISION.
*===========================*
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNIX.
OBJECT-COMPUTER. UNIX.
SPECIAL-NAMES. DECIMAL-POINT IS COMMA.
DATA DIVISION.
*===========================*
WORKING-STORAGE SECTION.
01 WORKER.
03 ENDFIC PIC X.
03 NBRROU PIC 9(03).
03 NBR-ROUTINES PIC 9(04).
03 TABROU OCCURS 0 TO 9999 TIMES
[b]DEPENDING ON NBR-ROUTINES[/b].
05 NOMROU PIC 9(04).
PROCEDURE DIVISION.
*====================*
MOVE 100 TO NBR-ROUTINES.
MOVE ZEROES TO NBRROU.
MOVE "N" TO ENDFIC OF WORKER.
PERFORM UNTIL ENDFIC OF WORKER = "Y"
IF NBRROU OF WORKER < NBR-ROUTINES
ADD 1 TO NBRROU
ELSE
MOVE "Y" TO ENDFIC OF WORKER
END-IF
END-PERFORM.
STOP RUN.
[/code]
When creating the table TABROU we use a variable for the length of it. This length will be assigned when executing the program.
In my company we have a large cobol program which has the same structure. This cobol sources compiles, but it goes wrong when the table is declared with a variable length. When changing this variable length by a fixed length everything runs like it should.
Best regards,
Geert
----------------------------------------------------------------
I modified my example to a working program which shows the problem.
[code]
IDENTIFICATION DIVISION.
*===========================*
PROGRAM-ID. EXAMPLE.
AUTHOR. GEERT.
ENVIRONMENT DIVISION.
*===========================*
CONFIGURATION SECTION.
SOURCE-COMPUTER. UNIX.
OBJECT-COMPUTER. UNIX.
SPECIAL-NAMES. DECIMAL-POINT IS COMMA.
DATA DIVISION.
*===========================*
WORKING-STORAGE SECTION.
01 WORKER.
03 EOF PIC X.
03 CTR PIC 9(03).
03 TABLESIZE PIC 9(03) VALUE ZEROS.
03 MYTABLE OCCURS 9 TIMES
DEPENDING ON TABLESIZE.
05 TABLECONTENT PIC X(03).
03 MYDISP PIC X(100) VALUE "Hello world".
PROCEDURE DIVISION.
*====================*
MOVE 5 TO TABLESIZE.
MOVE ZEROES TO CTR.
MOVE "N" TO EOF.
PERFORM UNTIL EOF = "Y"
ADD 1 TO CTR
IF CTR > TABLESIZE
ADD 1 TO TABLESIZE GIVING TABLESIZE
END-IF
MOVE "GGE"
TO TABLECONTENT (CTR)
IF TABLESIZE > 7
MOVE "Y" TO EOF
END-IF
DISPLAY "------------------------------"
DISPLAY "EOF : " EOF
DISPLAY "CTR : " CTR
DISPLAY "TABLESIZE : " TABLESIZE
DISPLAY "TABLECONTENT : " TABLECONTENT(1)
DISPLAY "MYDISPL : " MYDISP
END-PERFORM.
STOP RUN.
[/code]
When executing you can see in the output that the program creates MYTABLE with just one time TABLESIZE. The first time it adds the right value. But afterwards, it just overwrites every variable which follows in stead of making MYTABLE bigger for every time that value will be added.
Is there a workaround for this?
Regards,
Geert
----------------------------------------------------------------
Fixed in current OC 1.1.
Note that an ODO item normally should be
the last item in the group. In fact, this
program will not compile unless using
"-std=mf".
We forgot to take into account the ODO
offset in this case.
Roger
----------------------------------------------------------------
Ok thanks a lot.
How do I get the last update of the OC sources?
Should I use CVS or is the OpenCOBOL 1.1 pre-release always updated?
Best regards,
Geert
----------------------------------------------------------------
The OC 1.1 pre-release is always the first to
be updated. CVS follows somewhat later
(which may be days or even weeks) depending on
the time I have to perform further tests/
update doc/implement further OC tests for bugs/features.
CVS commits are always preceeded with a pre-release.
Roger
----------------------------------------------------------------
Subject: Does open-cobol support WORKING STORAGE CLEAR option?
Hello:
Cobol compiler like IBM cobol supports an option -qWSCLEAR for WORKING STORAGE CLEAR, so does open-cobol has such a similar option?
I didn't find it in man pages.
Thanks,
Jason
----------------------------------------------------------------
It's done automatically.
ie. W/S items that are not implicitly/explicitly
defined with values will be initialized according
to their storage.
Roger
----------------------------------------------------------------
Good, Thanks :-)
----------------------------------------------------------------
Subject: Segmentation fault with OC 1.1
There where no problem or warnings (-Wall) on compiling but the program results in [quote]Exception: STATUS_ACCESS_VIOLATION at eip=61D865A0
eax=000347B1 ebx=0002DE0E ecx=00000002 edx=00428DC2 esi=00488000 edi=00428DC2
ebp=61DA7380 esp=0022C410 program=myprog.exe, pid 3092, thread main
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame Function Args
61DA7380 61D865A0 (00425038, 00000000, 00000000, 00000000)
7619 [main] myprog 3092 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)[/quote]I had never any problems in my environment (cygwin), before. What can I do now? Restarting the computer and try again gave the same results. Any suggestions?
----------------------------------------------------------------
Try compiling with "-g -debug -ftraceall".
This might give some indication.
If not, post the prog.
Roger
----------------------------------------------------------------
./myprog.exe 2> output.txt
showed the wrong behavior: [quote]Length of 'bigvar' out of bounds[/quote]
Is there another way to avoid segmentation faults than compile with -debug?
----------------------------------------------------------------
????
What do you think "-debug" is for? :-)
You don't "avoid" faults, you "fix" them :-)
Generally, when trying any progs for the
first time with OC, you should specify "-debug".
This will catch most of the simpler programming
errors.
(MF has a similar feature)
Roger
----------------------------------------------------------------
The same program had no crashes with OC 0.33. But there was a clear mistake like[code]perform varying a from 1 by x
string mytexta (a:b)
delimited by somedeli
into mytextb
end-string
end-perform[/code]Program fixed - all fine.
I just like to have a compiler option for checking indexed out of bounds etc. without setting -debug, because debug includes all lines with D in column 7.
By the way:
How can I write to error-stream from an OC program?
----------------------------------------------------------------
In current OC 1.1, "-debug" does NOT include
lines with "D" in column 7. You must specifically
use "-fdebugging-line".
To output to stderr -
In SPECIAL-NAMES :
SYSERR IS MYERROR
Then :
DISPLAY .... UPON MYERROR
Roger
----------------------------------------------------------------
Subject: Open-Cobol 1.0 Installation Problem..plz help
Hi i am abhijith ,a total newbie to the world of Linux and COBOL , we do have cobol and unix as our academic subjects this time, at our college we use Softek cobol v1.003 which runs under unix OS, for practicing at Home i tried searching for the softek compiler but couldn find anywhere or on net,and while searching i came to know about this OPen-cobol 1.0 compiler & downloaded and tried hard to install on my FEDORA 8
but was not successful ,
As i am new to both unix and cobol i hardly know how to install on linux and all that...
Below i have mentioned how i tried installing...
-- i logged in as Root , and in the terminal window i changed to the path of directory where open-cobol files were there
-- then i ran 1 by 1
./configure
make
make check
make install
-- i had downloaded gmp lib 4.12 ,libltdl and berkeley db RPM's .. (i doubled clicked the rpm's it installed i dunoo how and where it installs)
-- then i wrote a CObol program and saved it as disp.cob
and tried compiling it as $cobc disp.cob
it should have compiled and then tried executing it as
$./disp
it shows = symbol lookup error :./disp :undefined symbol :cob_call_params
--even tried $cobcrun disp
but it shows libcob : ./disp.so :undefined symbol: disp
-- on this forum i read that we got to edit
etc/ld.so.conf and add "/usr/local/lib" to the file.
and Rerun "ldconfig" .. i did but no effect
-- i even ran the tests which will be in the dir "Tests"
which is "open cobol 1.0 :test suite "
it showed "35. cobcrun validation failed (misc at:199) "
===*** I am a total newbie please help me ,i haven understood a bit of it, plz explain the procedure to install the compiler from A to Z, coz my exams are coming up shortly i need to study and make sure i know something to pass in the exams Atleast...plz help :-(
and even please write about compiling and executing *.cob files...
I Thankyou in anticipation ....
waiting for ur valuable replies and suggestions.
Abhijith
----------------------------------------------------------------
Please read the README.
(In particular the part that references "ldconfig")
Roger
----------------------------------------------------------------
i read that ldconfig .. dint really understood .. i told u na i am a total newbie .. its been a month or so since i have been working on unix and cob.. plz be precise sir
----------------------------------------------------------------
As root:
Edit /etc/ld.so.conf and add
/usr/local/lib
to the file.
Rerun "ldconfig".
----------------------------------------------------------------
Subject: C$TOUPPER information needed
Hello,
I use this function in a ACU called program like this.
[code]call "C$TOUPPER" using x-IoWin-Options value 80[/code]
when compiling the same line with OC
[code] attention : passing argument 2 of ‘CBL_TOUPPER’ makes integer from pointer without a cast[/code]
And of course C$TOLOWER does the same.
I don't understand what's wrong with my code ?
Best Regards
Bear
----------------------------------------------------------------
Nothing is wrong with your code :-)
I screwed up BY VALUE processing.
Fixed in current OC 1.1.
(It was actually OK in 1.0)
Roger
----------------------------------------------------------------
Subject: Make check of OC 1.1
Hi,
when executing 'make check' of the lastest version of OC 1.1 I have 16 errors in the run test. The other tests pass without a problem. Is this normal?
32: LOCAL-STORAGE FAILED (misc.at:72)
33: EXTERNAL data item FAILED (misc.at:113)
34: EXTERNAL AS data item FAILED (misc.at:154)
35: cobcrun validation FAILED (misc.at:194)
47: CALL m1. CALL m2. CALL m1. FAILED (misc.at:480)
48: CALL binary literal parameter/LENGTH OF FAILED (misc.at:525)
74: Sticky LINKAGE FAILED (misc.at:1296)
75: COB_PRE_LOAD test FAILED (misc.at:1320)
76: COB_LOAD_CASE=UPPER test FAILED (misc.at:1342)
80: CALL with OMITTED parameter FAILED (misc.at:1445)
81: ANY LENGTH FAILED (misc.at:1481)
90: CALL USING file-name FAILED (extensions.at:367)
91: CALL unusual program-id. FAILED (extensions.at:415)
97: NUMBER-OF-CALL-PARAMETERS FAILED (extensions.at:625)
98: PROCEDURE DIVISION USING BY ... FAILED (extensions.at:677)
107: RETURN-CODE passing FAILED (return-code.at:76)
I managed to install the lastest version of OC 1.1 and to compile the sources which are also compiled with the previous version.
Best regards,
Geert
----------------------------------------------------------------
No, this is not normal.
A "make check" must run OK.
Go to the tests/run.dir directory.
There you will find sub-directories for the
failed tests with names "032", "033", etc.
Within each of these sub-directories there
is a file "run.log".
Post the contents of these files.
(ie. from the tests/run.dir directory, do
"cat */*.log" and send the output. You can chop
out the lines that begin "---" and "+++")
Also, what is your environment? OS versdion etc.
Roger
----------------------------------------------------------------
Hi,
Here are some data of my environment:
[code]
uname -m = 005AA76A4C00
uname -r = 2
uname -s = AIX
uname -v = 5
/usr/bin/uname -p = powerpc
/usr/bin/oslevel = 5.2.0.0
gcc (GCC) 3.3.2
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[/code]
The following lines contain the output of the log files.
[code]
32. misc.at:46: testing ...
misc.at:72: ${COMPILE_MODULE} callee.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
32. misc.at:46: 32. LOCAL-STORAGE (misc.at:46): FAILED (misc.at:72)
33. misc.at:84: testing ...
misc.at:113: ${COMPILE_MODULE} callee.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
33. misc.at:84: 33. EXTERNAL data item (misc.at:84): FAILED (misc.at:113)
34. misc.at:123: testing ...
misc.at:154: ${COMPILE_MODULE} callee.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
34. misc.at:123: 34. EXTERNAL AS data item (misc.at:123): FAILED (misc.at:154)
35. misc.at:165: testing ...
misc.at:194: ${COMPILE_MODULE} callee.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
35. misc.at:165: 35. cobcrun validation (misc.at:165): FAILED (misc.at:194)
47. misc.at:446: testing ...
misc.at:480: ${COMPILE_MODULE} m1.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
47. misc.at:446: 47. CALL m1. CALL m2. CALL m1. (misc.at:446): FAILED (misc.at:480)
48. misc.at:492: testing ...
misc.at:525: ${COMPILE_MODULE} dump.c
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
48. misc.at:492: 48. CALL binary literal parameter/LENGTH OF (misc.at:492): FAILED (misc.at:525)
74. misc.at:1257: testing ...
misc.at:1296: ${COMPILE_MODULE} -conf=test.conf callee.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
74. misc.at:1257: 74. Sticky LINKAGE (misc.at:1257): FAILED (misc.at:1296)
75. misc.at:1304: testing ...
misc.at:1320: ${COMPILE_MODULE} callee.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
75. misc.at:1304: 75. COB_PRE_LOAD test (misc.at:1304): FAILED (misc.at:1320)
76. misc.at:1326: testing ...
misc.at:1342: ${COMPILE_MODULE} CALLEE.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
76. misc.at:1326: 76. COB_LOAD_CASE=UPPER test (misc.at:1326): FAILED (misc.at:1342)
80. misc.at:1417: testing ...
misc.at:1445: ${COMPILE_MODULE} callee.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
80. misc.at:1417: 80. CALL with OMITTED parameter (misc.at:1417): FAILED (misc.at:1445)
81. misc.at:1453: testing ...
misc.at:1481: ${COMPILE_MODULE} callee.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
81. misc.at:1453: 81. ANY LENGTH (misc.at:1453): FAILED (misc.at:1481)
90. extensions.at:333: testing ...
extensions.at:367: ${COMPILE_MODULE} setfilename.c
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
90. extensions.at:333: 90. CALL USING file-name (extensions.at:333): FAILED (extensions.at:367)
91. extensions.at:374: testing ...
extensions.at:415: ${COMPILE_MODULE} A@B.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
91. extensions.at:374: 91. CALL unusual program-id. (extensions.at:374): FAILED (extensions.at:415)
97. extensions.at:589: testing ...
extensions.at:624: ${COMPILE} caller.cob
extensions.at:625: ${COMPILE_MODULE} callee.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
97. extensions.at:589: 97. NUMBER-OF-CALL-PARAMETERS (extensions.at:589): FAILED (extensions.at:625)
98. extensions.at:639: testing ...
extensions.at:676: ${COMPILE} caller.cob
extensions.at:677: ${COMPILE_MODULE} callee.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
98. extensions.at:639: 98. PROCEDURE DIVISION USING BY ... (extensions.at:639): FAILED (extensions.at:677)
107. return-code.at:46: testing ...
return-code.at:76: ${COMPILE_MODULE} mod1.cob
0a1,5
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: ._GLOBAL__DD
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DI
> ld: 0711-224 WARNING: Duplicate symbol: _GLOBAL__DD
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
107. return-code.at:46: 107. RETURN-CODE passing (return-code.at:46): FAILED (return-code.at:76)
[/code]
Best regards,
Geert
----------------------------------------------------------------
Don't see any problems with XLC as well as with GCC 3.4.1
It might be GCC issue which is very bad on Power.
Are you linking with static library or shared ?
I saw only warnings. Have you tried to repeate some of those tests manually ? It might work and maybe it's just the matter of script reacting on warnings.
Regards,
Sergey
----------------------------------------------------------------
Subject: Size & Colors in Screen Management
Do we have any possibility to avoid artistic coding like this following lines ?
Of course it works, but passing foreground / background color values thru an identifier instead of an integer at each time would be nice.
[code]
*> How the SIZE is managed (Screen is supposed to be 80 characters wide)
if x-labels-size NOT = 0
continue
else
move 0 to L
inspect x-labels-value tallying L for trailing spaces
compute x-labels-size = 80 - L
end-compute
end-if
*> Then comes colors integers (all these may be shorter ...)
evaluate x-labels-FColor
when 0
evaluate x-labels-BColor
when 0
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 00
background-color 00
end-display
when 1
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 00
background-color 01
end-display
when 2
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 00
background-color 02
end-display
when 3
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 00
background-color 03
end-display
when 4
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 00
background-color 04
end-display
when 5
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 00
background-color 05
end-display
when 6
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 00
background-color 06
end-display
when 7
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 00
background-color 07
end-display
end-evaluate
when 1
evaluate x-labels-BColor
when 0
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 01
background-color 00
end-display
when 1
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 01
background-color 01
end-display
when 2
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 01
background-color 02
end-display
when 3
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 01
background-color 03
end-display
when 4
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 01
background-color 04
end-display
when 5
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 01
background-color 05
end-display
when 6
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 01
background-color 06
end-display
when 7
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 01
background-color 07
end-display
end-evaluate
when 2
evaluate x-labels-BColor
when 0
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 02
background-color 00
end-display
when 1
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 02
background-color 01
end-display
when 2
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 02
background-color 02
end-display
when 3
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 02
background-color 03
end-display
when 4
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 02
background-color 04
end-display
when 5
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 02
background-color 05
end-display
when 6
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 02
background-color 06
end-display
when 7
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 02
background-color 07
end-display
end-evaluate
when 3
evaluate x-labels-BColor
when 0
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 03
background-color 00
end-display
when 1
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 03
background-color 01
end-display
when 2
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 03
background-color 02
end-display
when 3
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 03
background-color 03
end-display
when 4
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 03
background-color 04
end-display
when 5
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 03
background-color 05
end-display
when 6
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 03
background-color 06
end-display
when 7
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 03
background-color 07
end-display
end-evaluate
when 4
evaluate x-labels-BColor
when 0
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 04
background-color 00
end-display
when 1
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 04
background-color 01
end-display
when 2
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 04
background-color 02
end-display
when 3
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 04
background-color 03
end-display
when 4
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 04
background-color 04
end-display
when 5
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 04
background-color 05
end-display
when 6
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 04
background-color 06
end-display
when 7
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 04
background-color 07
end-display
end-evaluate
when 5
evaluate x-labels-BColor
when 0
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 05
background-color 00
end-display
when 1
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 05
background-color 01
end-display
when 2
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 05
background-color 02
end-display
when 3
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 05
background-color 03
end-display
when 4
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 05
background-color 04
end-display
when 5
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 05
background-color 05
end-display
when 6
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 05
background-color 06
end-display
when 7
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 05
background-color 07
end-display
end-evaluate
when 6
evaluate x-labels-BColor
when 0
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 02
background-color 00
end-display
when 1
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 02
background-color 01
end-display
when 6
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 06
background-color 02
end-display
when 3
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 06
background-color 03
end-display
when 4
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 06
background-color 04
end-display
when 5
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 06
background-color 05
end-display
when 6
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 06
background-color 06
end-display
when 7
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 06
background-color 07
end-display
end-evaluate
when 7
evaluate x-labels-BColor
when 0
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 07
background-color 00
end-display
when 1
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 07
background-color 01
end-display
when 2
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 07
background-color 02
end-display
when 3
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 07
background-color 03
end-display
when 4
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 07
background-color 04
end-display
when 5
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 07
background-color 05
end-display
when 6
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 07
background-color 06
end-display
when 7
display x-labels-value (1:x-labels-size)
line x-labels-line column x-labels-position
with foreground-color 07
background-color 07
end-display
end-evaluate
end-evaluate
.[/code]
I think it's very easy to code
[code]
display x-label-value
line x-labels-line column x-labels-position
(with) size x-labels-size
foreground-color x-labels-Fcolor
background-color x-labels-BColor
end-display
.
[/code]
Best regards
Bear
----------------------------------------------------------------
A couple of comments -
This syntax is not part of any standard.
The alternative ACCEPT/DISPLAY syntax is a
MF extension.
(Also note that SCREEN SECTION etc. is only
an optional component according to the standard).
In the case of colours on ACCEPT/DISPLAY, MF
allows only integers here.
However, I will take a look, time permitting.
Re. SIZE.
Yes, this clause is currently missing.
However, for your particular example you can do -
DISPLAY FUNCTION TRIM (x-label-value TRAILING) ....
and delete the INSPECT.
Roger
----------------------------------------------------------------
Thank You
I do not understand what you meant by :
[code]
DISPLAY FUNCTION TRIM (x-label-value TRAILING) ....
[/code]
In the other side I think I must learn C to be able to create my own screen manager. I saw demo with windows and subwindows with ncurses with results very close to my AcuCobol programs...
Best regards
Bear
----------------------------------------------------------------
FUNCTION TRIM is an intrinsic function
proposed/defined in the new 2008/working document.
Excerpt -
----------------
The TRIM function returns a character string that contains the characters in the argument with leading spaces,
trailing spaces, or both, deleted.
1) Argument-1 shall be a data item of class alphanumeric.
15.88.3 Returned values
1) If LEADING is specified, the returned value is a character string that consists of the characters in argument-1
beginning from the leftmost character position that does not contain a space character through the rightmost
character position.
2) If TRAILING is specified, the returned value is a character string that consists of the characters in argument-1
beginning from the leftmost character position through the rightmost character position that does not contain
a space character.
3) If neither LEADING nor TRAILING is specified, the returned value is a character string that consists of the
characters in argument-1 beginning from the leftmost character position that does not contain a space
character through the rightmost character position that does not contain a space character.
--------------------
Try it :-)
Roger
----------------------------------------------------------------
Thank you Roger
All these informations are very important. My Cobol programming was very poor on functions, so I caught some more time to see a set of intrinsic functions allowed by OC.
So in this particular case, I need the size variable so
[code]
move function stored-char-length (x-labels-value) to x-labels-size
[/code]
Does not solve my color problem, but some of my modules turned out to be lighter.
I hope you'll have time to see a bit ACCEPT/DISPLAY statements in order to allow color management better than the strict standard.
Best regards
Bear
----------------------------------------------------------------
Subject: Linkage section using Variable
Hi all,
I searched the forum for a error I had with OC on the linkage section in executable programs. I found a solution for this: replace the "LINKAGE SECTION USING VAR" by "LINKAGE SECTION" and "ACCEPT VAR FROM COMMAND-LINE". Which works fine, but I have to change more then 2000 sources if I want that OC compiles them succesfully.
I wonder if there is a possibility to add an option to the OC compiler so it will succesfully compile the "LINKAGE SECTION USING VAR" line. Maybe there is a possibility to add it into the MF dialect.
We have had earlier tests with an older version of OC (0.29) which succesfully compiled those sources. With the lastest version there is added a check in the source code of OC, maybe there is a possibility to disable this check?
Best regards,
Geert
----------------------------------------------------------------
?????
LINKAGE SECTION USING
What is that??
Not known to me.
Roger
----------------------------------------------------------------
I'm sorry, I meant I searched on this forum a way to replace:
[code]
PROCEDURE DIVISION USING VAR.
[/code]
So I had to replace it by:
[code]
PROCEDURE DIVISION.
ACCEPT VAR FROM COMMAND-LINE.
[/code]
Which works fine, but I have to change more then 2000 sources if I want that OC compiles them succesfully.
I wonder if there is a possibility to add an option to the OC compiler so it will succesfully compile the "PROCEDURE DIVISION USING VAR" line. Maybe there is a possibility to add it into the MF dialect.
We have had earlier tests with an older version of OC (0.29) which succesfully compiled those sources. With the lastest version there is added a check in the source code of OC, maybe there is a possibility to disable this check?
Best regards,
Geert
----------------------------------------------------------------
Hello Geert,
I never had problems with linking programs. You must keep
[code]
identification division.
program-id. goeswell.
linkage section.
01 linkvar.
02 var1 pic ...
02 ...
procedure division using linkvar.
[/code]
when compiling this program you should not use the "x" flag.
but let cobc compile as a module ... (extension .so)
Tell COB_LIBRARY_PATH to find modules in your library .
Things must go better
Bear
----------------------------------------------------------------
Hello,
Thanks, but I have also some sources with the same structure as your example and it compiles when I don't use the -x option.
But for the sources where I have the problem, in my case I need to use the -x option. OC has to create executable files.
Geert
----------------------------------------------------------------
If nothing helps:
- write a simple program in oc, that reads all your .cbl as line sequential file and rewrites the phrase mentioned above
- use another tool to replace your phrase (for example a self written unix shell with read/cut/if/...)
----------------------------------------------------------------
I tried with ACU runnig this program,
[code]
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. PARSER.
000500*
000600* TEST DU LINKAGE
000700*
000800 ENVIRONMENT DIVISION.
000900 CONFIGURATION SECTION.
001000 SOURCE-COMPUTER. DELL.
001100 OBJECT-COMPUTER. DELL.
DATA DIVISION.
003900 WORKING-STORAGE SECTION.
77 I pic X.
linkage section.
77 wprog pic X(8).
77 wlink pic X(10).
004200 PROCEDURE DIVISION using wprog wlink.
004300 DEBUT.
call wprog using wlink
on exception
display "NIET !"
not on exception
display "OK"
end-call
accept i
.
ULTIME.
EXIT PROGRAM.
[/code]
Runtime sends me back a runtime error like similar to :
[code]
Use of a linkage data item not passed by the caller
[/code]
BUT this program works
[code]
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. PARSER.
000300 AUTHOR. HINIGER
000400 DATE-WRITTEN. Mai-08.
000500*
000600* TEST DU LINKAGE
000700*
000800 ENVIRONMENT DIVISION.
000900 CONFIGURATION SECTION.
001000 SOURCE-COMPUTER. DELL.
001100 OBJECT-COMPUTER. DELL.
DATA DIVISION.
003900 WORKING-STORAGE SECTION.
77 I pic X.
77 wprog pic X(8).
77 wlink pic X(10).
77 wcmdline pic X(80).
004200 PROCEDURE DIVISION.
004300 DEBUT.
accept wcmdline from command-line
unstring wcmdline
delimited by "%" into wprog wlink
end-unstring
call wprog using wlink
on exception
display "NIET !"
not on exception
display "OK"
end-call
accept i
.
ULTIME.
EXIT PROGRAM.
[/code]
You can also try "C$NARG" in order to test # of arguments ...
Best Regards
Bear
----------------------------------------------------------------
Geert, can you explain why you think that
a program with PROCEDURE DIVISION USING ...
can/should be executed as a main program?
Roger
----------------------------------------------------------------
Hi Roger,
I think I know your point of view over this matter, I read a discussion about it on this forum. And I'm supporting your point of view. I also read in the documents of MF that this 'PROCEDURE DIVISION USING ...' should be used in case a cobol program calls another cobol program. But somehow MF has always permitted the use of 'PROCEDURE DIVISION USING ...' in main programs,which is actually not entirely correct. The sources I was talking about, are "succesfully" compiled by MF and a cobol compiler from IBM for mainframe.
I believe the OC compiler is a very good compiler and my intentions are certainly not to change something about this. I'm only wondering if there is a possibility to add this into the dialect of MF. I know there has come a check in your sources of OC (since version 0.29), which checks if you're compiling a main program or not. Is it possible to pass this check without touching the integrity of OC?
Best regards,
Geert
----------------------------------------------------------------
* MF has always permitted the use of 'PROCEDURE DIVISION USING ...' in main programs,which is actually not entirely correct *
It is not correct at all. And the behaviour with
MF (assuming the prog accesses the USING parameter)
is indeterminate.
So, no, I cannot allow a USING for a main prog as
that would in OC cause an immediate seg fault.
Having said that, ACU (and OC) have a syntax which
allows what you appear to want -
PROCEDURE DIVISION CHAINING dataitem.
dataitem must be in W/S (Not LINKAGE).
CHAINING is only allowed for a main program.
dataitem is filled with the command line parameters
following the program execution call.
Roger
----------------------------------------------------------------
I still don't understand why you say this isn't correct at all. But sometimes I miss the little bits. Seems perfectly proper behavior to me for a main program. Doesn't seem logic for a sub program.
Isn't a main program a program that gets called by the OS? And why shouldn't the system pass it parms?
Is it a technical reason OC can't do this?
Yes, CHAINING seems to be similar but not exactly. The issue comes in when two main programs call each other. If the main program can't have linkage, it becomes difficult to pass parms .
That's what I don't understand. Why shouldn't two main programs be able to call each other and pass parm to each other via linkage?
----------------------------------------------------------------
Indeed. If there is no technical reason, I do not see a reason why OC should not allow it.
I know it's not the standard, but I don't see why a main program can not accept LINKAGE parameters. It could be an added value for OC too, if it's compatible with all other major cobol compilers.
Regards,
Joeri
----------------------------------------------------------------
But it is the standard on the mainframe.
But isn't it also the standard period? Can't main programs call other main programs and pass parms while at the same time get called from the OS which passes on the parms from the cli?
----------------------------------------------------------------
NO, it is NOT the standard.
Please read COBOL syntax.
Roger
----------------------------------------------------------------
Subject: Attempting to compile MicroFocus COBOL code with OpenCobol
I am attempting to compile our MicroFocus COBOL code with OpenCobol, but I am encountering a few problems:
1. I have a problem with a linkage statement that is redefined, error message is "Error: REDEFINES clause must follow entry-name". Snippet of code that is causing problems:
05 REDEF PIC S9(9) COMP.
05 CONTEXT-POINTER USAGE IS POINTER REDEFINES REDEF.
2. Are there functions in OpenCobol what will set and get environment variables? MicroFocus has functions cobgetenv() and cobsetenv() that we are currently using in our applications.
Any suggestions would be greatly appreciated.
:-)
----------------------------------------------------------------
Below applies to OC 1.1 -
1) Error message is correct. The REDEFINES
should follow the data name according to the standard.
ie. 05 CONTEXT-POINTER REDEFINES REDEF USAGE POINTER.
However, if you compile with "-std=mf", this will get reduced to a warning.
You do know that this code may have problems? -
POINTER is 4 bytes on 32-bit systems and 8 bytes on 64-bit.
2) Yes, see the MF (and ACU) extended ACCEPT/DISPLAY syntax
for manipulating environment variables.
Roger
----------------------------------------------------------------
Subject: Dialect compatibilities
Hi there,
We are evaluating the possibility of migrating from MF to OC.
An issue we have encountered is keyword compatibility. Our source is based on Cobol 85 and uses at least two variables names that are now considered keywords (INITIALIZED and NORMAL).
For MF we use the -ans85 flag. I have tried using the -std=mf and I have tried using the -std=cobol85 flags for OC but using either flag still causes errors to be generated when the variable names (nee keywords) are detected.
My question is, when using the -std=cobol85 compile flag, should this flag limit the keyword set to that of the Cobol 85 keyword set? OC doesn't appear to do this.
Any thoughts or suggestions are appreciated.
Thanks,
Darin Ritchie.
----------------------------------------------------------------
You can do it with a config file.
Copy and rename an existing conf file -
eg. config/mf.conf -> /tmp/myconf.conf
Edit /tmp/myconf.conf and add following lines
somewhere at the end -
not-reserved: INITIALIZED
not-reserved: NORMAL
Then compile with "-conf=/tmp/myconf.conf"
If you want to compile with "-std=myconf" and
not use the "-conf=", then
copy "myconf.conf" to the install directory
for the config files which is per default
/usr/local/share/open-cobol/config.
An example of "not-reserved" already exists in
"config/mvs.conf". These definitions for various
dialects are on my todo list.
Roger
----------------------------------------------------------------
Subject: reference list
Hi all,
I wonder whether ther is some kind of [b]reference list[/b] for OpenCobol, listing the companies that use it.
I require this information for our managers.
If not, I would like to ask you to tell me the companies that us it. This is just for internal use at my company.
I`d like to start the list with the company I work for:
Leoni AG - http://www.leoni.com/
If you prefer not to name your company in public, I`d appreciate if you send me this information by mail to [i]patric[/i] D0T [i]sperling[/i] ADD [i]leoni[/i] D0T [i]com[/i] (dot and at are intentionally misspelled).
Kind regards,
Patric
----------------------------------------------------------------
Subject: PRINTER and literal
Hi All,
I am a newbie in cobol.
I have chosen open-cobol 1.1.0 for my linux box
at home (ubuntu-gutsy).
I have some problems in compiling
a program (consist of several copyfiles)
which was compiled well in sun.
1) PRINTER as in:
SELECT LLLFILE ASSIGN TO PRINTER LLL-TXT
FILE STATUS IS FFFF-LLL.
the cobc complains with error message:
Error: syntax error, unexpected "Identifier", expecting SEQUENCE
2) literal as in:
03 FILLER PIC X(20) VALUE '12345678901234567890'.
the cobc complains with error message:
Error: syntax error, unexpected "Identifier", expecting EXTERNAL or GLOBAL
Could you please suggest any correction or equivalent syntax in open cobol?
Thank you,
Ade
----------------------------------------------------------------
Sorry, I can not reproduce this.
eg.
IDENTIFICATION DIVISION.
PROGRAM-ID. jtest.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT LLL-PRINT ASSIGN TO PRINTER LLL-TXT
FILE STATUS IS LLL-STAT.
DATA DIVISION.
FILE SECTION.
FD LLL-PRINT.
01 RAW-PRINT PIC X(132).
WORKING-STORAGE SECTION.
01 LLL-STAT PIC XX.
01 LLL-TXT PIC X(20).
01 RAWSTAT2.
03 FILLER PIC X(20)VALUE '12345678901234567890'.
PROCEDURE DIVISION.
001-MAIN-PROCEDURE.
STOP RUN.
roglinux:~ # cobc --version
cobc (OpenCOBOL) 1.1.0 Build date Apr 23 2008 09:46:37
Copyright (C) 2001-2008 Keisuke Nishida / Roger While
roglinux:~ # cobc -x jtest.cob
roglinux:~ #
Please post the preprocessed source of your program.
ie.
cobc -E yourprog.cob >preproc
Then post the contents of preproc.
Roger
----------------------------------------------------------------
I tried to compile your prog and I had the error message :
[code]
JTEST.CBL:16: Error: Invalid picture string
JTEST.CBL:16: Error: syntax error, unexpected "Literal", expecting EXTERNAL or GLOBAL
[/code]
... just because there is no space between
PIC X(20) and VALUE
Best regards
Bear
----------------------------------------------------------------
Dear Roger and Bear,
thank you for your reply.
After seeing your cobc --version,
i found out that my open-cobol 1.1.0 is not
the same as yours because my previous
cobc --version will give me:
cobc (OpenCOBOL) 1.1.0
Copyright (C) 2001-2007 Keisuke Nishida
Copyright (C) 2007 Roger While
So, i download the latest 1.1.0, and compiled it.
Now, the PRINTER keyword is fine,
and i found an example where the second error may occur.
In my code, I have many indentation as shown below.
It seem the empty spaces between keyword FILLER and PIC
are too long. It give error message:
TestError.cbl:16: Error: syntax error, unexpected "end of file", expecting EXTERNAL or GLOBAL
Is it the current syntax restriction of open-cobol?
meanwhile i just try to fix my code layout,
removing any too long empty spaces between keyword.
It works so far.
Here is the example code which generate the error.
IDENTIFICATION DIVISION.
PROGRAM-ID. jtest.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT LLL-PRINT ASSIGN TO PRINTER LLL-TXT
FILE STATUS IS LLL-STAT.
DATA DIVISION.
FILE SECTION.
FD LLL-PRINT.
01 RAW-PRINT PIC X(132).
WORKING-STORAGE SECTION.
01 LLL-STAT PIC XX.
01 LLL-TXT PIC X(20).
01 RAWSTAT2.
03 FILLER PIC X(20)VALUE '12345678901234567890'.
PROCEDURE DIVISION.
001-MAIN-PROCEDURE.
STOP RUN.
Kind regards,
Ade Azurat
----------------------------------------------------------------
03 FILLER PIC X(20)VALUE '12345678901234567890'.
There is a space missing between the closing
bracket and VALUE.
Roger
----------------------------------------------------------------
Sorry, i found that this forum editor eliminate the additional space that i made. To show the different,
i replace the additional empty space with underscore.
The error appear if i put too much spaces between FILLER and PIC, as seen below
03 FILLER _______________PIC X(20) VALUE '12345678901234567890'.
PROCEDURE DIVISION.
How ever if the space is still less than the length of
PROCEDURE DIVISION, such as:
03 FILLER _____ PIC X(20) VALUE '12345678901234567890'.
PROCEDURE DIVISION.
it can be compiled. Otherwise no with error message:
Error: syntax error, unexpected "end of file", expecting EXTERNAL or GLOBAL
in some cases it says "unexpected "Identifier"
Thank you,
Ade Azurat
----------------------------------------------------------------
You are compiling with default fixed format,
right?
Assuming the "03" starts in column 12, then
the statement overflows column 72
(Columns 73 to end of line get ignored).
Roger
----------------------------------------------------------------
Thank you Roger,
Now, some of the programs are compiled well.
However, I still have small problem in SCREEN SECTION.
SCREEN SECTION.
01 SCR-ROW-1.
03 LINE 01 PIC X(79) USING DISPLAY-TITLE-01.
01 SCR-ERROR.
03 LINE 23 VALUE IS x'07'.
03 PIC X(20) FROM ERR-MSG.
03 COL PLUS 3 VALUE IS 'Press Enter to continue... '.
03 PIC X TO ANY-CHAR.
01 SCR-CLEAR-ERROR.
03 LINE 23 BLANK LINE.
perhaps the code above does not comply with
the standard cobol. Could somebody please tell
me the equivalent statements in openCobol?
Another information is that the error message
only says:
"Invalid picture string"
only one line,
and pointed to the line after the above code.
Thank you,
ade
----------------------------------------------------------------
Subject: segmentation error
Hello,
I was trying this program :
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. COLORS.
*>
*> TEST DES COULEURS
*>
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. DELL.
OBJECT-COMPUTER. DELL.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 I pic X.
*>78 noir value 01.
*>78 bleu value 02.
*>78 vert value 03.
*>78 rouge value 04.
*>78 magenta value 05.
*>78 marron value 06.
*>78 blanc value 07.
PROCEDURE DIVISION.
DEBUT.
display "Bonjour"
line 12 column 36
with foreground-color 2
background-color 5
end-display
display
"Monsieur"
line 13 column 36
with foreground-color 1
background-color 7
end-display
display
"Le Professeur"
line 14 column 35
with foreground-color 6
background-color 3
end-display
.
accept I line 24 column 30
with foreground-color 2
background-color 3
end-accept
.
ULTIME.
EXIT PROGRAM.
[/code]
cobc -x -free -debug -ftraceall colors.cbl
./colors
[code]
PROGRAM-ID: COLORS: ENTRY COLORS
PROGRAM-ID: COLORS: MAIN SECTION
PROGRAM-ID: COLORS: DEBUT
PROGRAM-ID: COLORS Line: 26 Statement: DISPLAY
Erreur de segmentation
[/code]
Is there something I did wrong ?
cobc (OpenCOBOL) 1.1.0 Build date May 7 2008 10:32:08
Copyright (C) 2001-2008 Keisuke Nishida / Roger While
downloaded/installed today
Best regards
Bear
----------------------------------------------------------------
You know why ?
because program-id is named COLORS.
I changed to TSTCLR.CBL, compiled, and everything turned out to be OK
Enjoy
Bear
----------------------------------------------------------------
PROGRAM-ID should not be any reserved word (COLORS=reserved?). Compilercheck needed.
----------------------------------------------------------------
Actually, the problem is rather interesting
and raises a serious question.
There is NO reason why "COLORS" should
NOT be a valid PROG-ID.
And, in fact, this is NOTHING to do with
reserved words.
The problem lies in the (n)curses library.
This has a field "COLORS" in the BSS section.
So, when the screen initialization is done,
the cob entry point "COLORS" is overriding
the curses definition (being the first in the
symbol resolution sequence).
BANG!
Now the question here is why is the (n)curses
library making this symbol visible? AFAICS, this
is not a user accessible element.
It looks as though that (n)curses is not taking
any particular care to restrict visible symbols.
On GCC based implementations, one can do this with -
__attribute__ ((visibility("hidden")))
(which we actually do in OC to restrict the OC library
visible symbols to a minimum).
So, what to do; nothing.
There is no way to produce some sort of
PROG-ID exception list considering all externalized
symbols in curses, ncurses, pdcurses, BDB, GMP, (G)LIBC,
etc.
Note that MF/ACU carry their own internal versions
of many packages. However, it is quite easy with
MF to provoke with a PROG-ID that duplicates some symbol.
Roger
----------------------------------------------------------------
Subject: File Open error
We are attempting to open a sequencial file that does not exist with the EXTEND keyword. We are migrating from MF to OC.
we get a status = 35 file does not exist error or if the file does exist, we get a status 44 = buffer overflow.
How do we resolve this issue, any suggestions. They would be greatly appreciated.
----------------------------------------------------------------
Not enough information.
Post the program, OC version and compile
options.
Roger
----------------------------------------------------------------
Issue:
When the program is run and the TESTBATCH file does not exist, an error status=35 file does not exist occurs. When we compile this using MicroFocus and the file does not exist, it is created with a status of 5.
OC version: 1.1
compiled using: cobc -x coboltest.cbl
Program:
IDENTIFICATION DIVISION.
PROGRAM-ID. simpleFileTest.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-RS-6000.
OBJECT-COMPUTER. IBM-RS-6000.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT OUTPUT-FILE
ASSIGN TO EXTERNAL TESTBATCH
ORGANIZATION IS LINE SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS WS-FILE-STATUS.
/
DATA DIVISION.
FILE SECTION.
FD OUTPUT-FILE.
01 OUTPUT-LINE PIC X(256).
WORKING-STORAGE SECTION.
01 WS-PROG-ID PIC X(16)
VALUE "simpleFileTest".
01 WS-FILE-STATUS PIC X(02) VALUE "00".
88 IO-OK VALUE "00", "05".
88 END-OF-FILE VALUE "10".
88 NOT-FOUND VALUE "23".
88 SEVERE-ERROR VALUE "01" THRU "04"
"06" THRU "09"
"11" THRU "22"
"24" THRU "99".
01 WS-TEST-LINE.
05 RESULT-OUT PIC X(20)
VALUE "Test File Line ".
05 FILLER PIC X(14)
VALUE "FILE STATUS = ".
05 WS-FILE-ERROR-STATUS PIC X(02).
/************************************************************************
* Mainline Routine
*************************************************************************
PROCEDURE DIVISION.
MAINLINE.
OPEN EXTEND OUTPUT-FILE
MOVE WS-FILE-STATUS TO WS-FILE-ERROR-STATUS
IF IO-OK OF WS-FILE-STATUS
MOVE WS-TEST-LINE TO OUTPUT-LINE
WRITE OUTPUT-LINE
CLOSE OUTPUT-FILE
ELSE
MOVE "file NOT Created " to RESULT-OUT
DISPLAY WS-TEST-LINE
END-IF.
STOP RUN.
Any suggestions would be greatly appreciated.
Thanks :-)
----------------------------------------------------------------
I changed:
SELECT OUTPUT-FILE
to:
SELECT OPTIONAL OUTPUT-FILE
The program compiled and ran as expected. This is the same behavior as with IBM's AIX Cobol.
Curt
----------------------------------------------------------------
I will try that, but can you explain why "OPTIONAL" was added.
What does it do?
Thanks :-)
----------------------------------------------------------------
"OPTIONAL" just tells the application that the physical file may not exist at run time and, if not, continue processing.
In the case of "OPEN EXTEND", without "OPTIONAL" the application looks at the missing file as some kind of failure. As a result no additional file processing is attempted, such as creating the file.
Curt
----------------------------------------------------------------
Yes, and the behaviour is correct.
The standard says (excerpt from SELECT) -
*****
The OPTIONAL phrase applies only to files opened in the input, I-O, or extend mode. Its specification is
required for physical files that are not necessarily present each time the runtime element is executed.
*****
Roger
----------------------------------------------------------------
Subject: HOWTO OpenCobol 1.0 + Oracle Pro*Cobol 10.2.0.1 and higher
HOWTO OpenCobol 1.0 + Oracle Pro*Cobol 10.2.0.1 and higher
==========================================================
0. OpenCobol has to be installed on the system
* On 64bit systems it must be a 64bit executable
which cobc | xargs file
--> /usr/local/bin/cobc: ELF 64-bit LSB executable.....
* a softlink to cob has to be generated in the same
directory where cobc is located:
which cobc
--> /usr/local/bin/cobc
ln -s /usr/local/bin/cobc /usr/local/bin/cob
which cob
--> /usr/local/bin/cob: symbolic link to `/usr/local/bin/cobc'
1. Oracle does *NOT* support officially OpenCobol
List of certified compilers can be found inside Oracle
Certified Compilers
2. HOWTO describes setup on
- 10gR2 (10.2.0.1)
- 11gR1 (11.1.0.6)
- OS: Linux x86 & x86-64
2. To get OpenCobol and Pro*Cobol running,
Pro*Cobol has to be installed properly including
* the 64bit Pro*Cobol (when used on Linux x86-64)
* the samples & makefiles contained in the
- companion CD (10g) or
- example CD (11g)
how to do that, see
Precompiler FAQ's in 10gR2 (10.2.0.1)
Precompiler FAQ's in 11gR1 (11.1.0.6)
-> See end of the HOWTO
--------------------------------
Linux x86-64
============
Please note that Pro*Cobol is supported on Linux x86-64
starting with 10.2.0.3 and that it hs to be explicitly
build by doing
cd $ORACLE_HOME/precomp/lib
make -f ins_precomp.mk procob
--------------------------------
3. Login as Oracle software owner
4. When everything is installed properly,
the three listed files should be found:
$ORACLE_HOME/precomp/demo/procob2/sample1.pco
$ORACLE_HOME/precomp/demo/procob2/demo_procob.mk
$ORACLE_HOME/precomp/lib/env_precomp.mk
5. generate a testdirectory and copy cobol samples
mkdir $HOME/mytest
cd $HOME/mytest
cp $ORACLE_HOME/precomp/demo/procob2/* .
cp $ORACLE_HOME/precomp/lib/*.mk .
6. edit $HOME/mytest/demo_procob.mk
i. change
include $(ORACLE_HOME)/precomp/lib/env_precomp.mk
to
include env_precomp.mk
ii. change
MAKEFILE=$(ORACLE_HOME)/precomp/demo/procob2/demo_procob.mk
to
MAKEFILE=demo_procob.mk
iii. add following lines at the bottom of the file
# MICROFOCUS
# COBFLAGS=-C IBMCOMP -C NESTCALL -t -x
# OPENCOBOL
COBFLAGS=-x
7. edit $HOME/mytest/env_precomp.mk
i. replace
DEMO_PROCOB_BUILD_SHARED=$(COB) $(COBFLAGS) -o $(EXE) $(COBS) $(LDPATHFLAG)$(LIBHOME) $(COBSQLINTF) $(COBOL_PROLDLIBS)
DEMO_PROCOB_BUILD_STATIC=$(COB) $(COBFLAGS) -o $(EXE) $(COBS) $(LDPATHFLAG)$(LIBHOME) $(COBSQLINTF) $(COBOL_STATICPROLDLIBS)
by
##### MICROFOCUS
#DEMO_PROCOB_BUILD_SHARED=$(COB) $(COBFLAGS) -o $(EXE) $(COBS) $(LDPATHFLAG)$(LIBHOME) $(COBSQLINTF) $(COBOL_PROLDLIBS)
##### OPENCOBOL
DEMO_PROCOB_BUILD_SHARED=$(COB) $(COBFLAGS) $(COBS) $(LDPATHFLAG)$(LIBHOME) $(COBSQLINTF) $(COBOL_PROLDLIBS)
##### MICROFOCUS
#DEMO_PROCOB_BUILD_STATIC=$(COB) $(COBFLAGS) -o $(EXE) $(COBS) $(LDPATHFLAG)$(LIBHOME) $(COBSQLINTF) $(COBOL_STATICPROLDLIBS)
##### OPENCOBOL
DEMO_PROCOB_BUILD_STATIC=$(COB) $(COBFLAGS) $(COBS) $(LDPATHFLAG)$(LIBHOME) $(COBSQLINTF) $(COBOL_STATICPROLDLIBS)
8. create $HOME/mytest/doit with following lines
#!/bin/sh
SAMPL=$1
export SAMPL
rm -rf $SAMPL
rm -rf $SAMPL".cob"
rm -rf $SAMPL".lis"
COBDIR=/usr/local
export COBDIR
PATH=$PATH:$COBDIR/bin
export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
which cob
which cob | xargs file
make -f demo_procob.mk build COBS=$SAMPL".cob" EXE=$SAMPL
file ./$SAMPL
./$SAMPL
rm -rf $SAMPL
rm -rf $SAMPL".cob"
rm -rf $SAMPL".lis"
9. chmod u+x $HOME/mytest/doit
10. to build sample1.pco (or another sample) use
Important: do not add the *.pco to the file to be build !
cd $HOME/mytest
./doit sample1
OUTPUT
======
/usr/local/bin/cob
/usr/local/bin/cob: symbolic link to `/usr/local/bin/cobc'
procob iname=sample1.pco
Pro*COBOL: Release 10.2.0.4.0 - Production on Thu May 8 10:37:45 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
System default option values taken from: /raid/home/vmware/64/oracle/db102x/app/
oracle/product/102/precomp/admin/pcbcfg.cfg
cob -x sample1.cob -L/raid/home/vmware/64/oracle/db102x/app/oracle/product/102/l
ib/ /raid/home/vmware/64/oracle/db102x/app/oracle/product/102/precomp/lib/cobsql
intf.o -lclntsh `cat /raid/home/vmware/64/oracle/db102x/app/oracle/product/102/l
ib/ldflags` `cat /raid/home/vmware/64/oracle/db102x/app/oracle/product/102/lib
/sysliblist` -ldl -lm
sample1.cob:17: Warning: 'GLOBAL' not implemented
sample1.cob:21: Warning: 'GLOBAL' not implemented
sample1.cob:25: Warning: 'GLOBAL' not implemented
sample1.cob:28: Warning: 'GLOBAL' not implemented
sample1.cob:67: Warning: 'GLOBAL' not implemented
sample1.cob:192: Warning: 'GLOBAL' not implemented
./sample1: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linu
x 2.4.0, dynamically linked (uses shared libs), not stripped
CONNECTED TO ORACLE AS USER: SCOTT
ENTER EMP NUMBER (0 TO QUIT): 7788
EMPLOYEE SALARY COMMISSION
-------- ------ ----------
SCOTT 3000.00 NULL
ENTER EMP NUMBER (0 TO QUIT): 0
TOTAL NUMBER QUERIED WAS 0001.
HAVE A GOOD DAY.
11. Please note that two samples wont work -
OpenCobol looks to be not supporting some MF capabilities.
12. Have a lots of fun -
Tested the stuff on Linux x86/x86-64bit & Solaris Sparc 64bit
and works.
-----------------------------
Precompiler FAQ's in 10gR2 (10.2.0.1)
Questions and Answers
Q: What precompilers are installed when "Database Installation" is choosen ?
A: Since 10gR2 only component "Precompilers" is showen in the Universal Installer - no separation of Pro*C, Pro*Cobol etc. By default Pro*C and Pro*Cobol are installed - independant if target is 32bit or 64bit OS. Furtheron, in case of 64bit OS only the 32bit Pro*Cobol is installed. If there is the need for 64bit Pro*Cobol , it is required to re-install from the "Client Installation" (*NOT* "Instant Client") and custom install type the Precompilers from the product "Oracle Programmer" on a former Database Installation - this will apply the Pro*Cobol 64bit (64bit OS) and the Pro*Fortran and SQL*Module for Ada additionally.
Better strategy is to apply a separate Client because this contains directly the full Precompilers (except demos etc - see below). In cases where a patch has to be applied to a Client component, the Database can be up and running - otherwise has to be shutdown for relink.
Q: Where are the makefiles and demos in 10gR2 ?
A: Since Oracle 10gR1 there is a separate installation disk called "Companion CD" containg the makefiles and the demos. To get a complete Precompiler-Installation, in 9iR2 it was only needed to choose the Precompilers during Database Installation - to obtain this in 10gR2 it is needed first to install the Database software including Precompilers, then re-install the Precompilers from Client Installation and apply as last step the Companion Products including the makefiles and samples. Goal was to save time during normal installations and space on devices to provide customer more flexibility. After Installtion of the Companion CD the demos, makefiles and headers could be found at the same place as in 9iR2 - $ORACLE_HOME/precomp
Q: There is no Pro*Cobol 10.2.0.1.0 Manual - only 9.2 - is this correct ?
A: Yes. Pro*Cobol 10.2.0.1.0 has the same features as Pro*Cobol 9.2 and there was no need to provide a new manual. Same issue was questioned many time when Pro*C 8.1.7 was released - but only Pro*C 8.1.6 manual was shipped.
References
-------------------------------
Precompiler FAQ's in 11gR1 (11.1.0.6)
Questions and Answers
Q: What precompilers are installed when "Database Installation" is choosen ?
A: Since 10gR1 (10.1.0.2) only component "Precompilers" is showen in the Universal Installer - no separation of Pro*C, Pro*Cobol etc. By default Pro*C and Pro*Cobol are installed - independant if target is 32bit or 64bit OS. Furtheron, in case of 64bit OS only the 32bit Pro*Cobol is installed. If there is the need for 64bit Pro*Cobol , it is required to re-install from the "Client Installation" (*NOT* "Instant Client") and custom install type the Precompilers from the product "Oracle Programmer" on a former Database Installation - this will apply the Pro*Cobol 64bit (64bit OS) and the Pro*Fortran and SQL*Module for Ada additionally.
Better strategy is to apply a separate Client because this contains directly the full Precompilers (except demos etc - see below). In cases where a patch has to be applied to a Client component, the Database can be up and running - otherwise has to be shutdown for relink.
Q: Where are the makefiles and demos in 11gR1 ?
A: In Oracle 10gR1 (10.1.0.2) and Oracle 10gR2(10.2.0.1) there is a separate installation disk called "Companion CD" containg the makefiles and the demos. In Oracle 11gR1(11.1.0.6) the "Companion CD" was renamed to "Example CD". To get a complete Precompiler-Installation, in 9iR2 it was only needed to choose the Precompilers during Database Installation - to obtain this in 11gR1 it is needed first to install the Database software including Precompilers, then re-install the Precompilers from Client Installation and apply as last step the Example CD Products including the makefiles and samples. Goal was to save time during normal installations and space on devices to provide customer more flexibility. After Installtion of the Example CD the demos, makefiles and headers could be found at the same place as in 9iR2 - $ORACLE_HOME/precomp
Q: Using valid SQL statements for the RDBMS with same release then Pro*C or Pro*Cobol could result in a error during precompilation and / or runtime - Why ?
A: Precompilers and RDBMS parser were different in the past - beginning with 11.1.0.6 a sort of unified parser has been implemented which allows to use in a Precompiler application the same SQL statements as issued from SQL*Plus. The unified parser can be invoked by using precompiler option common_parser=yes.
Q: Where is Pro*Cobol 1.8.x in $ORACLE_HOME/bin ?
A: Pro*Cobol 1.8.x has been discontinued with Oracle 10.1.0.x and higher - Please use Pro*Cobol 11.1.0.6 instead.
----------------------------------------------------------------
Nice.
Re: (11) - Which samples create problems and
what are the problems?
Roger
----------------------------------------------------------------
Oracle 10gR2:
sample5.pco
-----------
.....
sample5.cob:229: Error: Executable program requested but PROCEDURE/ENTRY has USI
NG clause
.....
sample13.pco
------------
.....
sample13.cob:295: Error: 'SQL-ITERS' undefined
sample13.cob:296: Error: 'SQL-OFFSET' undefined
sample13.cob:297: Error: 'SQL-OCCURS' undefined
sample13.cob:299: Error: 'SQLCUD' undefined
sample13.cob:300: Error: 'SQL-CUD' undefined
sample13.cob:302: Error: 'SQLCA' undefined
sample13.cob:303: Error: 'SQL-SQLEST' undefined
sample13.cob:304: Error: 'SQL-SQLETY' undefined
sample13.cob:310: Error: 'SQL-SQHSTV' undefined
sample13.cob:311: Error: 'SQL-SQHSTL' undefined
sample13.cob:312: Error: 'SQL-SQHSTS' undefined
sample13.cob:313: Error: 'SQL-SQINDV' undefined
sample13.cob:314: Error: 'SQL-SQINDS' undefined
sample13.cob:315: Error: 'SQL-SQHARM' undefined
sample13.cob:321: Error: 'SQL-SQHSTV' undefined
sample13.cob:322: Error: 'SQL-SQHSTL' undefined
sample13.cob:323: Error: 'SQL-SQHSTS' undefined
sample13.cob:324: Error: 'SQL-SQINDV' undefined
sample13.cob:325: Error: 'SQL-SQINDS' undefined
sample13.cob:326: Error: 'SQL-SQHARM' undefined
sample13.cob:328: Error: 'SQL-SQHSTV' undefined
sample13.cob:329: Error: 'SQL-SQPHSV' undefined
sample13.cob:331: Error: 'SQL-SQHSTL' undefined
sample13.cob:332: Error: 'SQL-SQPHSL' undefined
sample13.cob:334: Error: 'SQL-SQHSTS' undefined
sample13.cob:335: Error: 'SQL-SQPHSS' undefined
sample13.cob:337: Error: 'SQL-SQINDV' undefined
sample13.cob:338: Error: 'SQL-SQPIND' undefined
sample13.cob:340: Error: 'SQL-SQINDS' undefined
sample13.cob:341: Error: 'SQL-SQPINS' undefined
sample13.cob:343: Error: 'SQL-SQHARM' undefined
sample13.cob:344: Error: 'SQL-SQPARM' undefined
sample13.cob:346: Error: 'SQL-SQHARC' undefined
sample13.cob:347: Error: 'SQL-SQPARC' undefined
sample13.cob:350: Error: 'SQLCTX' undefined
sample13.cob:351: Error: 'SQLEXD' undefined
sample13.cob:352: Error: 'SQLFPN' undefined
sample13.cob:354: Error: 'SQLCODE' in 'SQLCA' undefined
sample13.cob:416: Error: 'SQ0002' undefined
sample13.cob:416: Error: 'SQL-STMT' undefined
sample13.cob:417: Error: 'SQL-ITERS' undefined
sample13.cob:418: Error: 'SQL-OFFSET' undefined
sample13.cob:419: Error: 'SQL-OCCURS' undefined
sample13.cob:420: Error: 'SQL-SELERR' undefined
sample13.cob:422: Error: 'SQLCUD' undefined
sample13.cob:423: Error: 'SQL-CUD' undefined
sample13.cob:425: Error: 'SQLCA' undefined
sample13.cob:426: Error: 'SQL-SQLEST' undefined
sample13.cob:427: Error: 'SQL-SQLETY' undefined
sample13.cob:429: Error: 'DEPT-NUMBER' undefined
sample13.cob:430: Error: 'SQL-SQHSTV' undefined
sample13.cob:431: Error: 'SQL-SQHSTL' undefined
sample13.cob:432: Error: 'SQL-SQHSTS' undefined
sample13.cob:433: Error: 'SQL-SQINDV' undefined
sample13.cob:434: Error: 'SQL-SQINDS' undefined
sample13.cob:435: Error: 'SQL-SQHARM' undefined
sample13.cob:437: Error: 'SQL-SQHSTV' undefined
sample13.cob:438: Error: 'SQL-SQPHSV' undefined
sample13.cob:440: Error: 'SQL-SQHSTL' undefined
sample13.cob:441: Error: 'SQL-SQPHSL' undefined
sample13.cob:443: Error: 'SQL-SQHSTS' undefined
sample13.cob:444: Error: 'SQL-SQPHSS' undefined
sample13.cob:446: Error: 'SQL-SQINDV' undefined
sample13.cob:447: Error: 'SQL-SQPIND' undefined
sample13.cob:449: Error: 'SQL-SQINDS' undefined
sample13.cob:450: Error: 'SQL-SQPINS' undefined
sample13.cob:452: Error: 'SQL-SQHARM' undefined
sample13.cob:453: Error: 'SQL-SQPARM' undefined
sample13.cob:455: Error: 'SQL-SQHARC' undefined
sample13.cob:456: Error: 'SQL-SQPARC' undefined
sample13.cob:459: Error: 'SQLCTX' undefined
sample13.cob:460: Error: 'SQLEXD' undefined
sample13.cob:461: Error: 'SQLFPN' undefined
sample13.cob:463: Error: 'SQLCODE' in 'SQLCA' undefined
sample13.cob: In paragraph 'FETCH-LOOP':
sample13.cob:479: Error: 'SQL-ITERS' undefined
sample13.cob:480: Error: 'SQL-OFFSET' undefined
sample13.cob:481: Error: 'SQL-OCCURS' undefined
sample13.cob:482: Error: 'SQL-SELERR' undefined
sample13.cob:484: Error: 'SQLCUD' undefined
sample13.cob:485: Error: 'SQL-CUD' undefined
sample13.cob:487: Error: 'SQLCA' undefined
sample13.cob:488: Error: 'SQL-SQLEST' undefined
sample13.cob:489: Error: 'SQL-SQLETY' undefined
sample13.cob:497: Error: 'SQL-SQHSTV' undefined
sample13.cob:498: Error: 'SQL-SQHSTL' undefined
sample13.cob:499: Error: 'SQL-SQHSTS' undefined
sample13.cob:500: Error: 'SQL-SQINDV' undefined
sample13.cob:501: Error: 'SQL-SQINDS' undefined
sample13.cob:502: Error: 'SQL-SQHARM' undefined
sample13.cob:506: Error: 'SQL-SQHSTV' undefined
sample13.cob:507: Error: 'SQL-SQHSTL' undefined
sample13.cob:508: Error: 'SQL-SQHSTS' undefined
sample13.cob:509: Error: 'SQL-SQINDV' undefined
sample13.cob:510: Error: 'SQL-SQINDS' undefined
sample13.cob:511: Error: 'SQL-SQHARM' undefined
sample13.cob:515: Error: 'SQL-SQHSTV' undefined
sample13.cob:516: Error: 'SQL-SQHSTL' undefined
sample13.cob:517: Error: 'SQL-SQHSTS' undefined
sample13.cob:518: Error: 'SQL-SQINDV' undefined
sample13.cob:519: Error: 'SQL-SQINDS' undefined
sample13.cob:520: Error: 'SQL-SQHARM' undefined
sample13.cob:522: Error: 'SQL-SQHSTV' undefined
sample13.cob:523: Error: 'SQL-SQPHSV' undefined
sample13.cob:525: Error: 'SQL-SQHSTL' undefined
sample13.cob:526: Error: 'SQL-SQPHSL' undefined
sample13.cob:528: Error: 'SQL-SQHSTS' undefined
sample13.cob:529: Error: 'SQL-SQPHSS' undefined
sample13.cob:531: Error: 'SQL-SQINDV' undefined
sample13.cob:532: Error: 'SQL-SQPIND' undefined
sample13.cob:534: Error: 'SQL-SQINDS' undefined
sample13.cob:535: Error: 'SQL-SQPINS' undefined
sample13.cob:537: Error: 'SQL-SQHARM' undefined
sample13.cob:538: Error: 'SQL-SQPARM' undefined
sample13.cob:540: Error: 'SQL-SQHARC' undefined
sample13.cob:541: Error: 'SQL-SQPARC' undefined
sample13.cob:544: Error: 'SQLCTX' undefined
sample13.cob:545: Error: 'SQLEXD' undefined
sample13.cob:546: Error: 'SQLFPN' undefined
sample13.cob:547: Error: 'SQLCODE' in 'SQLCA' undefined
sample13.cob:549: Error: 'SQLCODE' in 'SQLCA' undefined
sample13.cob:553: Error: 'SQLERRD' undefined
sample13.cob:558: Error: 'SQLERRD' undefined
sample13.cob: In paragraph 'NO-MORE-DATA':
sample13.cob:574: Error: 'SQLERRD' undefined
sample13.cob:576: Error: 'SQLERRD' undefined
sample13.cob:584: Error: 'SQL-ITERS' undefined
sample13.cob:585: Error: 'SQL-OFFSET' undefined
sample13.cob:586: Error: 'SQL-OCCURS' undefined
sample13.cob:588: Error: 'SQLCUD' undefined
sample13.cob:589: Error: 'SQL-CUD' undefined
sample13.cob:591: Error: 'SQLCA' undefined
sample13.cob:592: Error: 'SQL-SQLEST' undefined
sample13.cob:593: Error: 'SQL-SQLETY' undefined
sample13.cob:596: Error: 'SQLCTX' undefined
sample13.cob:597: Error: 'SQLEXD' undefined
sample13.cob:598: Error: 'SQLFPN' undefined
sample13.cob:600: Error: 'SQLCODE' in 'SQLCA' undefined
sample13.cob:620: Error: 'SQLERRMC' undefined
sample13.cob:624: Error: 'SQL-ITERS' undefined
sample13.cob:625: Error: 'SQL-OFFSET' undefined
sample13.cob:626: Error: 'SQL-OCCURS' undefined
sample13.cob:628: Error: 'SQLCUD' undefined
sample13.cob:629: Error: 'SQL-CUD' undefined
sample13.cob:631: Error: 'SQLCA' undefined
sample13.cob:632: Error: 'SQL-SQLEST' undefined
sample13.cob:633: Error: 'SQL-SQLETY' undefined
sample13.cob:636: Error: 'SQLCTX' undefined
sample13.cob:637: Error: 'SQLEXD' undefined
sample13.cob:638: Error: 'SQLFPN' undefined
.....
sample14.pco
------------
......
sample14.cob:201: Error: Level 01 item 'EMP-REC-TABLE' cannot have OCCURS clause
......
Additional to 10gR2 in 11gR1
=============================
sample14.pco
------------
10gR2: FAILS
01 EMP-REC-TABLE OCCURS 5 TIMES.
05 EMP-NUMBER PIC S9(4) COMP SYNC.
05 SALARY PIC S9(6)V99
DISPLAY SIGN LEADING SEPARATE.
05 EMP-NAME PIC X(10) VARYING.
11gR1: WORKS !
01 EMP-REC-TABLE-M.
03 EMP-REC-TABLE OCCURS 5 TIMES.
05 EMP-NUMBER PIC S9(4) COMP SYNC.
05 SALARY PIC S9(6)V99
DISPLAY SIGN LEADING SEPARATE SYNC.
05 EMP-NAME PIC X(10) VARYING SYNC.
db2arrdemo.pco
--------------
Pro*Cobol flag
db2_array=yes
must be used - can be adden inside demo_procob.mk to PCCFLAGS
lobdemo1.pco
------------
.....
lobdemo1.cob: In paragraph 'LIST-RECORDS-MAIN-PARA':
lobdemo1.cob:860: Error: 'SQL-ITERS' undefined
lobdemo1.cob:861: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:862: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:864: Error: 'SQLCUD' undefined
lobdemo1.cob:865: Error: 'SQL-CUD' undefined
lobdemo1.cob:867: Error: 'SQLCA' undefined
lobdemo1.cob:868: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:869: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:875: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:876: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:877: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:878: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:879: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:880: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:882: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:883: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:885: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:886: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:888: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:889: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:891: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:892: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:894: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:895: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:897: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:898: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:900: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:901: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:904: Error: 'SQLCTX' undefined
lobdemo1.cob:905: Error: 'SQLEXD' undefined
lobdemo1.cob:906: Error: 'SQLFPN' undefined
lobdemo1.cob:908: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:915: Error: 'SQL-ITERS' undefined
lobdemo1.cob:916: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:917: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:918: Error: 'SQL-SELERR' undefined
lobdemo1.cob:920: Error: 'SQLCUD' undefined
lobdemo1.cob:921: Error: 'SQL-CUD' undefined
lobdemo1.cob:923: Error: 'SQLCA' undefined
lobdemo1.cob:924: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:925: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:926: Error: 'SQL-SQCMOD' undefined
lobdemo1.cob:929: Error: 'SQLCTX' undefined
lobdemo1.cob:930: Error: 'SQLEXD' undefined
lobdemo1.cob:931: Error: 'SQLFPN' undefined
lobdemo1.cob:933: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob: In paragraph 'GETROWS':
lobdemo1.cob:943: Error: 'SQL-ITERS' undefined
lobdemo1.cob:944: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:945: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:946: Error: 'SQL-SELERR' undefined
lobdemo1.cob:948: Error: 'SQLCUD' undefined
lobdemo1.cob:949: Error: 'SQL-CUD' undefined
lobdemo1.cob:951: Error: 'SQLCA' undefined
lobdemo1.cob:952: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:953: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:954: Error: 'SQL-SQFOFF' undefined
lobdemo1.cob:955: Error: 'SQL-SQFMOD' undefined
lobdemo1.cob:958: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:959: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:960: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:961: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:962: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:963: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:965: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:966: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:968: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:969: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:971: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:972: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:974: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:975: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:977: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:978: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:980: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:981: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:983: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:984: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:987: Error: 'SQLCTX' undefined
lobdemo1.cob:988: Error: 'SQLEXD' undefined
lobdemo1.cob:989: Error: 'SQLFPN' undefined
lobdemo1.cob:990: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:992: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob: In paragraph 'NOTFOUND':
lobdemo1.cob:1001: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1002: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1003: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1005: Error: 'SQLCUD' undefined
lobdemo1.cob:1006: Error: 'SQL-CUD' undefined
lobdemo1.cob:1008: Error: 'SQLCA' undefined
lobdemo1.cob:1009: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1010: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1013: Error: 'SQLCTX' undefined
lobdemo1.cob:1014: Error: 'SQLEXD' undefined
lobdemo1.cob:1015: Error: 'SQLFPN' undefined
lobdemo1.cob:1017: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob: In paragraph 'GETSSS-COMMON-MAIN-PARA':
lobdemo1.cob:1041: Error: 'SSS' undefined
lobdemo1.cob:1046: Error: 'SQ0003' undefined
lobdemo1.cob:1046: Error: 'SQL-STMT' undefined
lobdemo1.cob:1047: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1048: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1049: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1050: Error: 'SQL-SELERR' undefined
lobdemo1.cob:1052: Error: 'SQLCUD' undefined
lobdemo1.cob:1053: Error: 'SQL-CUD' undefined
lobdemo1.cob:1055: Error: 'SQLCA' undefined
lobdemo1.cob:1056: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1057: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1060: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1061: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1062: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1063: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1064: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1065: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1067: Error: 'SSS' undefined
lobdemo1.cob:1068: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1069: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1070: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1071: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1072: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1073: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1075: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1076: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1078: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1079: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1081: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1082: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1084: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1085: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1087: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1088: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1090: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1091: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1093: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1094: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1097: Error: 'SQLCTX' undefined
lobdemo1.cob:1098: Error: 'SQLEXD' undefined
lobdemo1.cob:1099: Error: 'SQLFPN' undefined
lobdemo1.cob:1101: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:1106: Error: 'SSSEXISTS' undefined
lobdemo1.cob:1108: Error: 'SSSEXISTS' undefined
lobdemo1.cob: In paragraph 'PRINTCRIME-COMMON-MAIN-PARA':
lobdemo1.cob:1142: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1143: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1144: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1146: Error: 'SQLCUD' undefined
lobdemo1.cob:1147: Error: 'SQL-CUD' undefined
lobdemo1.cob:1149: Error: 'SQLCA' undefined
lobdemo1.cob:1150: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1151: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1153: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:1154: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1155: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1156: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1157: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1158: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1159: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1162: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1163: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1164: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1165: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1166: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1167: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1169: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1170: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1172: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1173: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1175: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1176: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1178: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1179: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1181: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1182: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1184: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1185: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1187: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1188: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1191: Error: 'SQLCTX' undefined
lobdemo1.cob:1192: Error: 'SQLEXD' undefined
lobdemo1.cob:1193: Error: 'SQLFPN' undefined
lobdemo1.cob:1195: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:1204: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1205: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1206: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1208: Error: 'SQLCUD' undefined
lobdemo1.cob:1209: Error: 'SQL-CUD' undefined
lobdemo1.cob:1211: Error: 'SQLCA' undefined
lobdemo1.cob:1212: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1213: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1216: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1217: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1218: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1219: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1220: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1221: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1223: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:1224: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1225: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1226: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1227: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1228: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1229: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1235: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1236: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1237: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1238: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1239: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1240: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1242: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1243: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1245: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1246: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1248: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1249: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1251: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1252: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1254: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1255: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1257: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1258: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1260: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1261: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1264: Error: 'SQLCTX' undefined
lobdemo1.cob:1265: Error: 'SQLEXD' undefined
lobdemo1.cob:1266: Error: 'SQLFPN' undefined
lobdemo1.cob:1268: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob: In paragraph 'GET-RECORD-MAIN-PARA':
lobdemo1.cob:1295: Error: 'SSSEXISTS' undefined
lobdemo1.cob:1297: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1298: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1299: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1301: Error: 'SQLCUD' undefined
lobdemo1.cob:1302: Error: 'SQL-CUD' undefined
lobdemo1.cob:1304: Error: 'SQLCA' undefined
lobdemo1.cob:1305: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1306: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1308: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:1309: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1310: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1311: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1312: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1313: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1314: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1316: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1317: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1319: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1320: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1322: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1323: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1325: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1326: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1328: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1329: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1331: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1332: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1334: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1335: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1338: Error: 'SQLCTX' undefined
lobdemo1.cob:1339: Error: 'SQLEXD' undefined
lobdemo1.cob:1340: Error: 'SQLFPN' undefined
lobdemo1.cob:1342: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:1348: Error: 'SQ0004' undefined
lobdemo1.cob:1348: Error: 'SQL-STMT' undefined
lobdemo1.cob:1349: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1350: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1351: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1352: Error: 'SQL-SELERR' undefined
lobdemo1.cob:1354: Error: 'SQLCUD' undefined
lobdemo1.cob:1355: Error: 'SQL-CUD' undefined
lobdemo1.cob:1357: Error: 'SQLCA' undefined
lobdemo1.cob:1358: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1359: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1365: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1366: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1367: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1368: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1369: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1370: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1372: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:1373: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1374: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1375: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1376: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1377: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1378: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1380: Error: 'SSS' undefined
lobdemo1.cob:1381: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1382: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1383: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1384: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1385: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1386: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1388: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1389: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1391: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1392: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1394: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1395: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1397: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1398: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1400: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1401: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1403: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1404: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1406: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1407: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1410: Error: 'SQLCTX' undefined
lobdemo1.cob:1411: Error: 'SQLEXD' undefined
lobdemo1.cob:1412: Error: 'SQLFPN' undefined
lobdemo1.cob:1414: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:1420: Error: 'SSS' undefined
lobdemo1.cob:1427: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1428: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1429: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1431: Error: 'SQLCUD' undefined
lobdemo1.cob:1432: Error: 'SQL-CUD' undefined
lobdemo1.cob:1434: Error: 'SQLCA' undefined
lobdemo1.cob:1435: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1436: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1438: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:1439: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1440: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1441: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1442: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1443: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1444: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1446: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1447: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1449: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1450: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1452: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1453: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1455: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1456: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1458: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1459: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1461: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1462: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1464: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1465: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1468: Error: 'SQLCTX' undefined
lobdemo1.cob:1469: Error: 'SQLEXD' undefined
lobdemo1.cob:1470: Error: 'SQLFPN' undefined
lobdemo1.cob:1472: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob: In paragraph 'ENTER-CHOICE':
lobdemo1.cob:1522: Error: 'NEWCRIME-ARR' undefined
lobdemo1.cob:1523: Error: 'NEWCRIME-LEN' undefined
lobdemo1.cob: In paragraph 'APPENDTOCLOB-COMMON-MAIN-PARA':
lobdemo1.cob:1565: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1566: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1567: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1569: Error: 'SQLCUD' undefined
lobdemo1.cob:1570: Error: 'SQL-CUD' undefined
lobdemo1.cob:1572: Error: 'SQLCA' undefined
lobdemo1.cob:1573: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1574: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1576: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:1577: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1578: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1579: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1580: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1581: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1582: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1585: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1586: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1587: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1588: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1589: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1590: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1592: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1593: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1595: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1596: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1598: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1599: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1601: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1602: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1604: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1605: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1607: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1608: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1610: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1611: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1614: Error: 'SQLCTX' undefined
lobdemo1.cob:1615: Error: 'SQLEXD' undefined
lobdemo1.cob:1616: Error: 'SQLFPN' undefined
lobdemo1.cob:1618: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:1622: Error: 'NEWCRIME-LEN' undefined
lobdemo1.cob:1629: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1630: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1631: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1633: Error: 'SQLCUD' undefined
lobdemo1.cob:1634: Error: 'SQL-CUD' undefined
lobdemo1.cob:1636: Error: 'SQLCA' undefined
lobdemo1.cob:1637: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1638: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1641: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1642: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1643: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1644: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1645: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1646: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1648: Error: 'NEWCRIME-LEN' in 'NEWCRIME' undefined
lobdemo1.cob:1650: Error: 'NEWCRIME-ARR' in 'NEWCRIME' undefined
lobdemo1.cob:1652: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1653: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1654: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1655: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1656: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1657: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1659: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:1660: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1661: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1662: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1663: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1664: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1665: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1668: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1669: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1670: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1671: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1672: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1673: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1675: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1676: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1678: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1679: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1681: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1682: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1684: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1685: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1687: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1688: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1690: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1691: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1693: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1694: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1697: Error: 'SQLCTX' undefined
lobdemo1.cob:1698: Error: 'SQLEXD' undefined
lobdemo1.cob:1699: Error: 'SQLFPN' undefined
lobdemo1.cob:1701: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:1707: Error: 'SQ0005' undefined
lobdemo1.cob:1707: Error: 'SQL-STMT' undefined
lobdemo1.cob:1708: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1709: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1710: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1711: Error: 'SQL-SELERR' undefined
lobdemo1.cob:1713: Error: 'SQLCUD' undefined
lobdemo1.cob:1714: Error: 'SQL-CUD' undefined
lobdemo1.cob:1716: Error: 'SQLCA' undefined
lobdemo1.cob:1717: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1718: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1724: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1725: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1726: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1727: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1728: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1729: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1731: Error: 'SSS' undefined
lobdemo1.cob:1732: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1733: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1734: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1735: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1736: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1737: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1739: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1740: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1742: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1743: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1745: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1746: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1748: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1749: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1751: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1752: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1754: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1755: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1757: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1758: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1761: Error: 'SQLCTX' undefined
lobdemo1.cob:1762: Error: 'SQLEXD' undefined
lobdemo1.cob:1763: Error: 'SQLFPN' undefined
lobdemo1.cob:1765: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:1769: Error: 'SSS' undefined
lobdemo1.cob: In paragraph 'ADD-CRIME-MAIN-PARA':
lobdemo1.cob:1792: Error: 'SSSEXISTS' undefined
lobdemo1.cob:1794: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1795: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1796: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1798: Error: 'SQLCUD' undefined
lobdemo1.cob:1799: Error: 'SQL-CUD' undefined
lobdemo1.cob:1801: Error: 'SQLCA' undefined
lobdemo1.cob:1802: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1803: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1805: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:1806: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1807: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1808: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1809: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1810: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1811: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1813: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1814: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1816: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1817: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1819: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1820: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1822: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1823: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1825: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1826: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1828: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1829: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1831: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1832: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1835: Error: 'SQLCTX' undefined
lobdemo1.cob:1836: Error: 'SQLEXD' undefined
lobdemo1.cob:1837: Error: 'SQLFPN' undefined
lobdemo1.cob:1839: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:1846: Error: 'SQ0006' undefined
lobdemo1.cob:1846: Error: 'SQL-STMT' undefined
lobdemo1.cob:1847: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1848: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1849: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1850: Error: 'SQL-SELERR' undefined
lobdemo1.cob:1852: Error: 'SQLCUD' undefined
lobdemo1.cob:1853: Error: 'SQL-CUD' undefined
lobdemo1.cob:1855: Error: 'SQLCA' undefined
lobdemo1.cob:1856: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1857: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1859: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:1860: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1861: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1862: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1863: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1864: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1865: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1867: Error: 'SSS' undefined
lobdemo1.cob:1868: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1869: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1870: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1871: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1872: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1873: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1875: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1876: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1878: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1879: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1881: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1882: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1884: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1885: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1887: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1888: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1890: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1891: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1893: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1894: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1897: Error: 'SQLCTX' undefined
lobdemo1.cob:1898: Error: 'SQLEXD' undefined
lobdemo1.cob:1899: Error: 'SQLFPN' undefined
lobdemo1.cob:1901: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:1906: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1907: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1908: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1910: Error: 'SQLCUD' undefined
lobdemo1.cob:1911: Error: 'SQL-CUD' undefined
lobdemo1.cob:1913: Error: 'SQLCA' undefined
lobdemo1.cob:1914: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1915: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1917: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:1918: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1919: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1920: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1921: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1922: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1923: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1925: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1926: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:1928: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1929: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:1931: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1932: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:1934: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1935: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:1937: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1938: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:1940: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:1941: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:1943: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:1944: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:1947: Error: 'SQLCTX' undefined
lobdemo1.cob:1948: Error: 'SQLEXD' undefined
lobdemo1.cob:1949: Error: 'SQLFPN' undefined
lobdemo1.cob:1951: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob: In paragraph 'NEW-RECORD-MAIN-PARA':
lobdemo1.cob:1974: Error: 'SSSEXISTS' undefined
lobdemo1.cob:1981: Error: 'SQL-ITERS' undefined
lobdemo1.cob:1982: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:1983: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:1985: Error: 'SQLCUD' undefined
lobdemo1.cob:1986: Error: 'SQL-CUD' undefined
lobdemo1.cob:1988: Error: 'SQLCA' undefined
lobdemo1.cob:1989: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:1990: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:1992: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:1993: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:1994: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:1995: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:1996: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:1997: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:1998: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:2000: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:2001: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:2003: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:2004: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:2006: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:2007: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:2009: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:2010: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:2012: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:2013: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:2015: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:2016: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:2018: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:2019: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:2022: Error: 'SQLCTX' undefined
lobdemo1.cob:2023: Error: 'SQLEXD' undefined
lobdemo1.cob:2024: Error: 'SQLFPN' undefined
lobdemo1.cob:2026: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:2031: Error: 'SQ0007' undefined
lobdemo1.cob:2031: Error: 'SQL-STMT' undefined
lobdemo1.cob:2032: Error: 'SQL-ITERS' undefined
lobdemo1.cob:2033: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:2034: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:2036: Error: 'SQLCUD' undefined
lobdemo1.cob:2037: Error: 'SQL-CUD' undefined
lobdemo1.cob:2039: Error: 'SQLCA' undefined
lobdemo1.cob:2040: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:2041: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:2043: Error: 'SSS' undefined
lobdemo1.cob:2044: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:2045: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:2046: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:2047: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:2048: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:2049: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:2052: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:2053: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:2054: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:2055: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:2056: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:2057: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:2059: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:2060: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:2062: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:2063: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:2065: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:2066: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:2068: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:2069: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:2071: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:2072: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:2074: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:2075: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:2077: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:2078: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:2081: Error: 'SQLCTX' undefined
lobdemo1.cob:2082: Error: 'SQLEXD' undefined
lobdemo1.cob:2083: Error: 'SQLFPN' undefined
lobdemo1.cob:2085: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:2090: Error: 'SQ0008' undefined
lobdemo1.cob:2090: Error: 'SQL-STMT' undefined
lobdemo1.cob:2091: Error: 'SQL-ITERS' undefined
lobdemo1.cob:2092: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:2093: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:2094: Error: 'SQL-SELERR' undefined
lobdemo1.cob:2096: Error: 'SQLCUD' undefined
lobdemo1.cob:2097: Error: 'SQL-CUD' undefined
lobdemo1.cob:2099: Error: 'SQLCA' undefined
lobdemo1.cob:2100: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:2101: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:2103: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:2104: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:2105: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:2106: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:2107: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:2108: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:2109: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:2111: Error: 'SSS' undefined
lobdemo1.cob:2112: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:2113: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:2114: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:2115: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:2116: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:2117: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:2119: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:2120: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:2122: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:2123: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:2125: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:2126: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:2128: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:2129: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:2131: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:2132: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:2134: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:2135: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:2137: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:2138: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:2141: Error: 'SQLCTX' undefined
lobdemo1.cob:2142: Error: 'SQLEXD' undefined
lobdemo1.cob:2143: Error: 'SQLFPN' undefined
lobdemo1.cob:2145: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob:2150: Error: 'SSS' undefined
lobdemo1.cob:2155: Error: 'SQL-ITERS' undefined
lobdemo1.cob:2156: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:2157: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:2159: Error: 'SQLCUD' undefined
lobdemo1.cob:2160: Error: 'SQL-CUD' undefined
lobdemo1.cob:2162: Error: 'SQLCA' undefined
lobdemo1.cob:2163: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:2164: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:2166: Error: 'LICENSE-TXT' undefined
lobdemo1.cob:2167: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:2168: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:2169: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:2170: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:2171: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:2172: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:2174: Error: 'SQL-SQHSTV' undefined
lobdemo1.cob:2175: Error: 'SQL-SQPHSV' undefined
lobdemo1.cob:2177: Error: 'SQL-SQHSTL' undefined
lobdemo1.cob:2178: Error: 'SQL-SQPHSL' undefined
lobdemo1.cob:2180: Error: 'SQL-SQHSTS' undefined
lobdemo1.cob:2181: Error: 'SQL-SQPHSS' undefined
lobdemo1.cob:2183: Error: 'SQL-SQINDV' undefined
lobdemo1.cob:2184: Error: 'SQL-SQPIND' undefined
lobdemo1.cob:2186: Error: 'SQL-SQINDS' undefined
lobdemo1.cob:2187: Error: 'SQL-SQPINS' undefined
lobdemo1.cob:2189: Error: 'SQL-SQHARM' undefined
lobdemo1.cob:2190: Error: 'SQL-SQPARM' undefined
lobdemo1.cob:2192: Error: 'SQL-SQHARC' undefined
lobdemo1.cob:2193: Error: 'SQL-SQPARC' undefined
lobdemo1.cob:2196: Error: 'SQLCTX' undefined
lobdemo1.cob:2197: Error: 'SQLEXD' undefined
lobdemo1.cob:2198: Error: 'SQLFPN' undefined
lobdemo1.cob:2200: Error: 'SQLCODE' in 'SQLCA' undefined
lobdemo1.cob: In paragraph 'SQLERROR-COMMON-MAIN-PARA':
lobdemo1.cob:2219: Error: 'SQLERRMC' undefined
lobdemo1.cob:2221: Error: 'SQL-ITERS' undefined
lobdemo1.cob:2222: Error: 'SQL-OFFSET' undefined
lobdemo1.cob:2223: Error: 'SQL-OCCURS' undefined
lobdemo1.cob:2225: Error: 'SQLCUD' undefined
lobdemo1.cob:2226: Error: 'SQL-CUD' undefined
lobdemo1.cob:2228: Error: 'SQLCA' undefined
lobdemo1.cob:2229: Error: 'SQL-SQLEST' undefined
lobdemo1.cob:2230: Error: 'SQL-SQLETY' undefined
lobdemo1.cob:2233: Error: 'SQLCTX' undefined
lobdemo1.cob:2234: Error: 'SQLEXD' undefined
lobdemo1.cob:2235: Error: 'SQLFPN' undefined
.....
cheers,
Frank
----------------------------------------------------------------
OK.
Sample 5 is clear. Either it is a main program in which case it can not have a PROCEDURE USING or it is a module called from somewhere else in which case it should be compiled as a module.
Sample 14(10gR2) would have compiled with compile option "-std=mf". The 11g syntax, per standard, is correct. The Cobol standard disallows occurs at the 01 level.
Do not know about the others. Looks like some preprocessor copies are missing.
Incidentally, I have 10gR2 on a server here but do not have the demo diretory. (precomp is there). Can you
tar the demo directory and put it for download somewhere?
Roger
----------------------------------------------------------------
Hello,
you can download then DB, Client and Companion software from
http://www.oracle.com/technology/software/products/database/index.html
Linux x86:
[url=http://download.oracle.com/otn/linux/oracle10g/10201/10201_database_linux32.zip]Oracle Database 10g Release 2 (10.2.0.1.0) for Linux x86[/url]
[url=http://download.oracle.com/otn/linux/oracle10g/10201/10201_companion_linux32.zip]Oracle Database 10g Companion CD Release 2 (10.2.0.1.0) for Linux x86[/url]
[url=http://download.oracle.com/otn/linux/oracle10g/10201/10201_client_linux32.zip]Oracle Database 10g Client Release 2 (10.2.0.1.0) for Linux x86[/url]
Linux x86-64:
[url=http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201linx8664soft.html]Linux x86-64 Download side[/url]
I have uploaded the samples for 32bit & 64bit 10gR2 and 32bit 11gR1 including the sql scripts (calldemo.sql, sample11.sql etc - "sql" subdir) to be run as SCOTT user (to create scott use utlsampl.sql) here:
[url=ftp://ftp.oracle.com/support/outgoing/opencobol/opencobol_procob.tar.gz]ftp://ftp.oracle.com/support/outgoing/opencobol/opencobol_procob.tar.gz[/url]
the makefiles allready modified
Frank
----------------------------------------------------------------
sample5.pco
===========
1. following lines
MOVE SQL-IAPXIT-SUCCESS TO RTN-CODE.
EXIT PROGRAM GIVING RTN-CODE.
have to be replace by
MOVE SQL-IAPXIT-SUCCESS TO RETURN-CODE.
EXIT PROGRAM.
2. change inside demo_procob.mk
COBFLAGS=-x
to
COBFLAGS=-m
because its a shared library but not a standalone app
:-D
----------------------------------------------------------------
Indeed :-)
Yes, sample5 is a module.
Roger
----------------------------------------------------------------
Using Pro*Cobol 11.2.0.2 and OpenCobol 1.1 *ALL* samples can now be build and run succesfully.
----------------------------------------------------------------
I can only hope that news like this could get a Berkeley DB exemption ala PHP and Perl, as we don't really ever "see" the library ... it's generated code that sees that layer. Having to release COBOL sources to stay in line with the GPL of 'commercial use' of libdb, is well, hard to justify really, when other languages have been given exclusions.
If OpenCOBOL supports Oracle "outta da box", then I can only hope they wouldn't be overly ornery if an exemption request was put in again for indirectly using libdb.
:-)
Cheers,
Brian
----------------------------------------------------------------
Subject: Conversion
I am converting a bunch of COBOL programs. First problem on my list is COPY.
I have copy syntax as:
COPY {filename.ext}.
That seems to confuse things. Any suggestions?
Thanks for any help, and I am sure to be back!
Mike
----------------------------------------------------------------
Hello Mike
Try
[code]
copy "filename.ext".
[/code]
You can leave your copy in the same directory.
If your copy file is NOT in the same directory you have to mention it in compilation command :
[code]
cobc -x -free -I CopyBookDirectory prog.cbl
[/code]
----------------------------------------------------------------
Got that working. Thanks.
----------------------------------------------------------------
Subject: RECORD clause is ignored in FD section causing buffer overflow
We are getting an error status=44 buffer overflow when we run the application.
Sample code that creates the problem is:
IDENTIFICATION DIVISION.
PROGRAM-ID. simpleFileTest.
DATE-COMPILED.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-RS-6000.
OBJECT-COMPUTER. IBM-RS-6000.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
* SELECT OPTIONAL OUTPUT-FILE
SELECT OPTIONAL REPORT-FILE1
ASSIGN TO WS-CURRENT-REPORT-FILE-NAME
ORGANIZATION IS LINE SEQUENTIAL.
/
DATA DIVISION.
FILE SECTION.
FD REPORT-FILE1
RECORD IS VARYING IN SIZE FROM 80 TO 180
CHARACTERS DEPENDING ON WS-CURRENT-COLUMN-SIZE.
01 REPORT-FILE1-REC PIC X(180).
WORKING-STORAGE SECTION.
01 WS-PROG-ID PIC X(16)
VALUE "simpleFileTest".
01 WS-CURRENT-REPORT-FILE-NAME PIC X(24).
01 WS-CURRENT-COLUMN-SIZE PIC 9(03) VALUE 132 COMP.
01 WS-TEMP-REPORT-LINE PIC X(180).
01 WS-FILE-STATUS PIC X(02) VALUE "00".
88 IO-OK VALUE "00", "05".
88 END-OF-FILE VALUE "10".
88 NOT-FOUND VALUE "23".
88 SEVERE-ERROR VALUE "01" THRU "04"
"06" THRU "09"
"11" THRU "22"
"24" THRU "99".
01 WS-TEST-LINE.
05 RESULT-OUT PIC X(20)
VALUE "Test File Line ".
05 FILLER PIC X(14)
VALUE "FILE STATUS = ".
05 WS-FILE-ERROR-STATUS PIC X(02) VALUE "DM".
/************************************************************************
* Mainline Routine
*************************************************************************
PROCEDURE DIVISION.
MAINLINE.
MOVE "TestFile.txt" TO WS-CURRENT-REPORT-FILE-NAME
OPEN EXTEND REPORT-FILE1
IF IO-OK OF WS-FILE-STATUS
MOVE WS-TEST-LINE TO WS-TEMP-REPORT-LINE
WRITE REPORT-FILE1-REC FROM WS-TEMP-REPORT-LINE
AFTER ADVANCING PAGE
CLOSE REPORT-FILE1
ELSE
MOVE "file NOT Created " to RESULT-OUT
DISPLAY WS-TEST-LINE
END-IF.
STOP RUN.
When we compile it with "cobc -x coboltest.cbl" we get the following warning "coboltest.cbl:24: Warning: RECORD clause ignored for LINE SEQUENTIAL"
Error message when application is run:
libcob: Record overflow (STATUS = 44) File : 'TestFile.txt'
WARNING - Implicit CLOSE of REPORT-FILE1 ("TestFile.txt")
Anyone have a suggestion how to resolve this?
We are migrating our current MicroFocus to OpenCobol.
OC version: 1.1
Thanks :-)
----------------------------------------------------------------
Fixed in current 1.1.
(You will still get the compile warning - It does not make
any sense to have a RECORD clause on a LINE SEQUENTIAL file)
Roger
----------------------------------------------------------------
Subject: ./configure gmp.h problem
Running Windows XP with MINGW32 inside MSYS. I installed gmp-4.2.2 and now im trying to install open-cobol-1.0
checking gmp.h usability... no
checking gmp.h presence... no
checking for gmp.h... no
configure: error: gmp.h is required
Config log
----------------
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by OpenCOBOL configure 1.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = GMEDIACENTER
uname -m = i686
uname -r = 1.0.10(0.46/3/2)
uname -s = MINGW32_NT-5.1
uname -v = 2004-03-15 07:17
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: .
PATH: /usr/local/bin
PATH: /mingw/bin
PATH: /bin
PATH: /mingw/bin
PATH: /c/Perl/site/bin
PATH: /c/Perl/bin
PATH: /c/WINDOWS/system32
PATH: /c/WINDOWS
PATH: /c/WINDOWS/System32/Wbem
PATH: /c/Program Files/Intel/DMIX
PATH: /c/Program Files/ATI Technologies/ATI Control Panel
PATH: /c/Program Files/ATI Technologies/ATI.ACE/Core-Static
PATH: /c/Program Files/QuickTime/QTSystem/
PATH: /c/Program Files/ESTsoft/ALZip/
PATH: /c/Program Files/ESTsoft/ALZip/
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1594: checking for a BSD-compatible install
configure:1649: result: /bin/install -c
configure:1660: checking whether build environment is sane
configure:1703: result: yes
configure:1727: WARNING: `missing' script is too old or missing
configure:1768: checking for gawk
configure:1784: found /bin/gawk
configure:1794: result: gawk
configure:1804: checking whether make sets $(MAKE)
configure:1824: result: yes
configure:1992: checking whether to enable maintainer-specific portions of Makefiles
configure:2001: result: no
configure:2137: checking for gcc
configure:2153: found /mingw/bin/gcc
configure:2163: result: gcc
configure:2407: checking for C compiler version
configure:2410: gcc --version &5
gcc.exe (GCC) 3.4.5 (mingw special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2413: $? = 0
configure:2415: gcc -v &5
Reading specs from c:/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw special)
configure:2418: $? = 0
configure:2420: gcc -V &5
gcc.exe: `-V' option must have argument
configure:2423: $? = 1
configure:2446: checking for C compiler default output file name
configure:2449: gcc conftest.c >&5
configure:2452: $? = 0
configure:2498: result: a.exe
configure:2503: checking whether the C compiler works
configure:2509: ./a.exe
configure:2512: $? = 0
configure:2529: result: yes
configure:2536: checking whether we are cross compiling
configure:2538: result: no
configure:2541: checking for suffix of executables
configure:2543: gcc -o conftest.exe conftest.c >&5
configure:2546: $? = 0
configure:2571: result: .exe
configure:2577: checking for suffix of object files
configure:2598: gcc -c conftest.c >&5
configure:2601: $? = 0
configure:2623: result: o
configure:2627: checking whether we are using the GNU C compiler
configure:2651: gcc -c conftest.c >&5
configure:2657: $? = 0
configure:2661: test -z
|| test ! -s conftest.err
configure:2664: $? = 0
configure:2667: test -s conftest.o
configure:2670: $? = 0
configure:2683: result: yes
configure:2689: checking whether gcc accepts -g
configure:2710: gcc -c -g conftest.c >&5
configure:2716: $? = 0
configure:2720: test -z
|| test ! -s conftest.err
configure:2723: $? = 0
configure:2726: test -s conftest.o
configure:2729: $? = 0
configure:2740: result: yes
configure:2757: checking for gcc option to accept ANSI C
configure:2827: gcc -c -g -O2 conftest.c >&5
configure:2833: $? = 0
configure:2837: test -z
|| test ! -s conftest.err
configure:2840: $? = 0
configure:2843: test -s conftest.o
configure:2846: $? = 0
configure:2864: result: none needed
configure:2882: gcc -c -g -O2 conftest.c >&5
conftest.c:2: error: syntax error before "me"
configure:2888: $? = 1
configure: failed program was:
| #ifndef __cplusplus
| choke me
| #endif
configure:3032: checking for style of include used by make
configure:3060: result: GNU
configure:3088: checking dependency style of gcc
configure:3178: result: gcc3
configure:3200: checking how to run the C preprocessor
configure:3235: gcc -E conftest.c
configure:3241: $? = 0
configure:3273: gcc -E conftest.c
conftest.c:13:28: ac_nonexistent.h: No such file or directory
configure:3279: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| /* end confdefs.h. */
| #include
configure:3318: result: gcc -E
configure:3342: gcc -E conftest.c
configure:3348: $? = 0
configure:3380: gcc -E conftest.c
conftest.c:13:28: ac_nonexistent.h: No such file or directory
configure:3386: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| /* end confdefs.h. */
| #include
configure:3429: checking for egrep
configure:3439: result: grep -E
configure:3478: checking for ANSI C header files
configure:3503: gcc -c -g -O2 conftest.c >&5
configure:3509: $? = 0
configure:3513: test -z
|| test ! -s conftest.err
configure:3516: $? = 0
configure:3519: test -s conftest.o
configure:3522: $? = 0
configure:3608: gcc -o conftest.exe -g -O2 conftest.c >&5
configure:3611: $? = 0
configure:3613: ./conftest.exe
configure:3616: $? = 0
configure:3631: result: yes
configure:3655: checking for sys/types.h
configure:3671: gcc -c -g -O2 conftest.c >&5
configure:3677: $? = 0
configure:3681: test -z
|| test ! -s conftest.err
configure:3684: $? = 0
configure:3687: test -s conftest.o
configure:3690: $? = 0
configure:3701: result: yes
configure:3655: checking for sys/stat.h
configure:3671: gcc -c -g -O2 conftest.c >&5
configure:3677: $? = 0
configure:3681: test -z
|| test ! -s conftest.err
configure:3684: $? = 0
configure:3687: test -s conftest.o
configure:3690: $? = 0
configure:3701: result: yes
configure:3655: checking for stdlib.h
configure:3671: gcc -c -g -O2 conftest.c >&5
configure:3677: $? = 0
configure:3681: test -z
|| test ! -s conftest.err
configure:3684: $? = 0
configure:3687: test -s conftest.o
configure:3690: $? = 0
configure:3701: result: yes
configure:3655: checking for string.h
configure:3671: gcc -c -g -O2 conftest.c >&5
configure:3677: $? = 0
configure:3681: test -z
|| test ! -s conftest.err
configure:3684: $? = 0
configure:3687: test -s conftest.o
configure:3690: $? = 0
configure:3701: result: yes
configure:3655: checking for memory.h
configure:3671: gcc -c -g -O2 conftest.c >&5
configure:3677: $? = 0
configure:3681: test -z
|| test ! -s conftest.err
configure:3684: $? = 0
configure:3687: test -s conftest.o
configure:3690: $? = 0
configure:3701: result: yes
configure:3655: checking for strings.h
configure:3671: gcc -c -g -O2 conftest.c >&5
configure:3677: $? = 0
configure:3681: test -z
|| test ! -s conftest.err
configure:3684: $? = 0
configure:3687: test -s conftest.o
configure:3690: $? = 0
configure:3701: result: yes
configure:3655: checking for inttypes.h
configure:3671: gcc -c -g -O2 conftest.c >&5
configure:3677: $? = 0
configure:3681: test -z
|| test ! -s conftest.err
configure:3684: $? = 0
configure:3687: test -s conftest.o
configure:3690: $? = 0
configure:3701: result: yes
configure:3655: checking for stdint.h
configure:3671: gcc -c -g -O2 conftest.c >&5
configure:3677: $? = 0
configure:3681: test -z
|| test ! -s conftest.err
configure:3684: $? = 0
configure:3687: test -s conftest.o
configure:3690: $? = 0
configure:3701: result: yes
configure:3655: checking for unistd.h
configure:3671: gcc -c -g -O2 conftest.c >&5
configure:3677: $? = 0
configure:3681: test -z
|| test ! -s conftest.err
configure:3684: $? = 0
configure:3687: test -s conftest.o
configure:3690: $? = 0
configure:3701: result: yes
configure:4567: checking whether ln -s works
configure:4571: result: yes
configure:4591: checking for a BSD-compatible install
configure:4646: result: /bin/install -c
configure:4739: checking build system type
configure:4757: result: i686-pc-mingw32
configure:4765: checking host system type
configure:4779: result: i686-pc-mingw32
configure:4787: checking for a sed that does not truncate output
configure:4843: result: /bin/sed
configure:4857: checking for ld used by gcc
configure:4924: result: c:/mingw/mingw32/bin/ld.exe
configure:4933: checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld
configure:4948: result: yes
configure:4953: checking for c:/mingw/mingw32/bin/ld.exe option to reload object files
configure:4960: result: -r
configure:4978: checking for BSD-compatible nm
configure:5027: result: /mingw/bin/nm
configure:5031: checking how to recognize dependent libraries
configure:5217: result: file_magic file format pei*-i386(.*architecture: i386)?
configure:5491: checking for dlltool
configure:5507: found /mingw/bin/dlltool
configure:5518: result: dlltool
configure:5571: checking for as
configure:5587: found /mingw/bin/as
configure:5598: result: as
configure:5651: checking for objdump
configure:5667: found /mingw/bin/objdump
configure:5678: result: objdump
configure:5711: checking dlfcn.h usability
configure:5723: gcc -c -g -O2 conftest.c >&5
conftest.c:61:19: dlfcn.h: No such file or directory
configure:5729: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| /* end confdefs.h. */
| #include
| #if HAVE_SYS_TYPES_H
| # include
| #endif
| #if HAVE_SYS_STAT_H
| # include
| #endif
| #if STDC_HEADERS
| # include
| # include
| #else
| # if HAVE_STDLIB_H
| # include
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| # include
| # endif
| # include
| #endif
| #if HAVE_STRINGS_H
| # include
| #endif
| #if HAVE_INTTYPES_H
| # include
| #else
| # if HAVE_STDINT_H
| # include
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include
| #endif
| #include
configure:5752: result: no
configure:5756: checking dlfcn.h presence
configure:5766: gcc -E conftest.c
conftest.c:27:19: dlfcn.h: No such file or directory
configure:5772: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| /* end confdefs.h. */
| #include
configure:5792: result: no
configure:5827: checking for dlfcn.h
configure:5834: result: no
configure:6090: checking the maximum length of command line arguments
configure:6202: result: 8192
configure:6214: checking command to parse /mingw/bin/nm output from gcc object
configure:6319: gcc -c -g -O2 conftest.c >&5
configure:6322: $? = 0
configure:6326: /mingw/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)\{0,1\}$/\1 \2 \2/p' \> conftest.nm
configure:6329: $? = 0
cannot find nm_test_var in conftest.nm
configure:6319: gcc -c -g -O2 conftest.c >&5
configure:6322: $? = 0
configure:6326: /mingw/bin/nm conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)\{0,1\}$/\1 _\2 \2/p' \> conftest.nm
configure:6329: $? = 0
configure:6381: gcc -o conftest.exe -g -O2 conftest.c conftstm.o >&5
configure:6384: $? = 0
configure:6422: result: ok
configure:6426: checking for objdir
configure:6441: result: .libs
configure:6531: checking for ar
configure:6547: found /mingw/bin/ar
configure:6558: result: ar
configure:6611: checking for ranlib
configure:6627: found /mingw/bin/ranlib
configure:6638: result: ranlib
configure:6691: checking for strip
configure:6707: found /mingw/bin/strip
configure:6718: result: strip
configure:6990: checking if gcc supports -fno-rtti -fno-exceptions
configure:7011: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5
cc1.exe: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
configure:7015: $? = 0
configure:7025: result: no
configure:7040: checking for gcc option to produce PIC
configure:7272: result: -DDLL_EXPORT
configure:7280: checking if gcc PIC flag -DDLL_EXPORT works
configure:7301: gcc -c -g -O2 -DDLL_EXPORT -DPIC conftest.c >&5
configure:7305: $? = 0
configure:7315: result: yes
configure:7343: checking if gcc static flag -static works
configure:7371: result: yes
configure:7381: checking if gcc supports -c -o file.o
configure:7405: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5
configure:7409: $? = 0
configure:7428: result: yes
configure:7454: checking whether the gcc linker (c:/mingw/mingw32/bin/ld.exe) supports shared libraries
configure:8438: result: yes
configure:8459: checking whether -lc should be explicitly linked in
configure:8464: gcc -c -g -O2 conftest.c >&5
configure:8467: $? = 0
configure:8482: gcc -shared conftest.o -v -o ./conftest -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker conftest 2\>\&1 \| grep -lc \>/dev/null 2\>\&1
configure:8485: $? = 1
configure:8497: result: yes
configure:8505: checking dynamic linker characteristics
configure:9107: result: Win32 ld.exe
configure:9116: checking how to hardcode library paths into programs
configure:9141: result: immediate
configure:9155: checking whether stripping libraries is possible
configure:9160: result: yes
configure:9995: checking if libtool supports shared libraries
configure:9997: result: yes
configure:10000: checking whether to build shared libraries
configure:10021: result: yes
configure:10024: checking whether to build static libraries
configure:10028: result: yes
configure:10121: creating libtool
configure:19325: checking whether make sets $(MAKE)
configure:19345: result: yes
configure:19356: checking for ANSI C header files
configure:19509: result: yes
configure:19534: checking for stdint.h
configure:19539: result: yes
configure:19534: checking for sys/types.h
configure:19539: result: yes
configure:19543: checking signal.h usability
configure:19555: gcc -c -g -O2 conftest.c >&5
configure:19561: $? = 0
configure:19565: test -z
|| test ! -s conftest.err
configure:19568: $? = 0
configure:19571: test -s conftest.o
configure:19574: $? = 0
configure:19584: result: yes
configure:19588: checking signal.h presence
configure:19598: gcc -E conftest.c
configure:19604: $? = 0
configure:19624: result: yes
configure:19659: checking for signal.h
configure:19666: result: yes
configure:19543: checking fcntl.h usability
configure:19555: gcc -c -g -O2 conftest.c >&5
configure:19561: $? = 0
configure:19565: test -z
|| test ! -s conftest.err
configure:19568: $? = 0
configure:19571: test -s conftest.o
configure:19574: $? = 0
configure:19584: result: yes
configure:19588: checking fcntl.h presence
configure:19598: gcc -E conftest.c
configure:19604: $? = 0
configure:19624: result: yes
configure:19659: checking for fcntl.h
configure:19666: result: yes
configure:19543: checking malloc.h usability
configure:19555: gcc -c -g -O2 conftest.c >&5
configure:19561: $? = 0
configure:19565: test -z
|| test ! -s conftest.err
configure:19568: $? = 0
configure:19571: test -s conftest.o
configure:19574: $? = 0
configure:19584: result: yes
configure:19588: checking malloc.h presence
configure:19598: gcc -E conftest.c
configure:19604: $? = 0
configure:19624: result: yes
configure:19659: checking for malloc.h
configure:19666: result: yes
configure:19543: checking locale.h usability
configure:19555: gcc -c -g -O2 conftest.c >&5
configure:19561: $? = 0
configure:19565: test -z
|| test ! -s conftest.err
configure:19568: $? = 0
configure:19571: test -s conftest.o
configure:19574: $? = 0
configure:19584: result: yes
configure:19588: checking locale.h presence
configure:19598: gcc -E conftest.c
configure:19604: $? = 0
configure:19624: result: yes
configure:19659: checking for locale.h
configure:19666: result: yes
configure:19543: checking stddef.h usability
configure:19555: gcc -c -g -O2 conftest.c >&5
configure:19561: $? = 0
configure:19565: test -z
|| test ! -s conftest.err
configure:19568: $? = 0
configure:19571: test -s conftest.o
configure:19574: $? = 0
configure:19584: result: yes
configure:19588: checking stddef.h presence
configure:19598: gcc -E conftest.c
configure:19604: $? = 0
configure:19624: result: yes
configure:19659: checking for stddef.h
configure:19666: result: yes
configure:19543: checking wchar.h usability
configure:19555: gcc -c -g -O2 conftest.c >&5
configure:19561: $? = 0
configure:19565: test -z
|| test ! -s conftest.err
configure:19568: $? = 0
configure:19571: test -s conftest.o
configure:19574: $? = 0
configure:19584: result: yes
configure:19588: checking wchar.h presence
configure:19598: gcc -E conftest.c
configure:19604: $? = 0
configure:19624: result: yes
configure:19659: checking for wchar.h
configure:19666: result: yes
configure:19534: checking for dlfcn.h
configure:19539: result: no
configure:19543: checking sys/time.h usability
configure:19555: gcc -c -g -O2 conftest.c >&5
configure:19561: $? = 0
configure:19565: test -z
|| test ! -s conftest.err
configure:19568: $? = 0
configure:19571: test -s conftest.o
configure:19574: $? = 0
configure:19584: result: yes
configure:19588: checking sys/time.h presence
configure:19598: gcc -E conftest.c
configure:19604: $? = 0
configure:19624: result: yes
configure:19659: checking for sys/time.h
configure:19666: result: yes
configure:19681: checking for an ANSI C-conforming const
configure:19748: gcc -c -g -O2 conftest.c >&5
configure:19754: $? = 0
configure:19758: test -z
|| test ! -s conftest.err
configure:19761: $? = 0
configure:19764: test -s conftest.o
configure:19767: $? = 0
configure:19778: result: yes
configure:19788: checking whether byte ordering is bigendian
configure:19815: gcc -c -g -O2 conftest.c >&5
configure:19821: $? = 0
configure:19825: test -z
|| test ! -s conftest.err
configure:19828: $? = 0
configure:19831: test -s conftest.o
configure:19834: $? = 0
configure:19858: gcc -c -g -O2 conftest.c >&5
conftest.c: In function `main':
conftest.c:44: error: `not' undeclared (first use in this function)
conftest.c:44: error: (Each undeclared identifier is reported only once
conftest.c:44: error: for each function it appears in.)
conftest.c:44: error: syntax error before "big"
configure:19864: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| #define STDC_HEADERS 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| /* end confdefs.h. */
| #include
| #include
|
| int
| main ()
| {
| #if BYTE_ORDER != BIG_ENDIAN
| not big endian
| #endif
|
| ;
| return 0;
| }
configure:19999: result: no
configure:20018: checking for size_t
configure:20042: gcc -c -g -O2 conftest.c >&5
configure:20048: $? = 0
configure:20052: test -z
|| test ! -s conftest.err
configure:20055: $? = 0
configure:20058: test -s conftest.o
configure:20061: $? = 0
configure:20072: result: yes
configure:20084: checking whether struct tm is in sys/time.h or time.h
configure:20107: gcc -c -g -O2 conftest.c >&5
configure:20113: $? = 0
configure:20117: test -z
|| test ! -s conftest.err
configure:20120: $? = 0
configure:20123: test -s conftest.o
configure:20126: $? = 0
configure:20137: result: time.h
configure:20148: checking for inline
configure:20169: gcc -c -g -O2 conftest.c >&5
configure:20175: $? = 0
configure:20179: test -z
|| test ! -s conftest.err
configure:20182: $? = 0
configure:20185: test -s conftest.o
configure:20188: $? = 0
configure:20200: result: inline
configure:20230: checking for working alloca.h
configure:20251: gcc -o conftest.exe -g -O2 conftest.c >&5
conftest.c:38:20: alloca.h: No such file or directory
configure:20257: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| #define STDC_HEADERS 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| #define COB_HAS_INLINE 1
| /* end confdefs.h. */
| #include
| int
| main ()
| {
| char *p = (char *) alloca (2 * sizeof (int));
| ;
| return 0;
| }
configure:20282: result: no
configure:20292: checking for alloca
configure:20333: gcc -o conftest.exe -g -O2 conftest.c >&5
configure:20339: $? = 0
configure:20343: test -z
|| test ! -s conftest.err
configure:20346: $? = 0
configure:20349: test -s conftest.exe
configure:20352: $? = 0
configure:20364: result: yes
configure:20591: checking for vprintf
configure:20648: gcc -o conftest.exe -g -O2 conftest.c >&5
conftest.c:63: warning: conflicting types for built-in function 'vprintf'
configure:20654: $? = 0
configure:20658: test -z
|| test ! -s conftest.err
configure:20661: $? = 0
configure:20664: test -s conftest.exe
configure:20667: $? = 0
configure:20679: result: yes
configure:20686: checking for _doprnt
configure:20743: gcc -o conftest.exe -g -O2 conftest.c >&5
C:/DOCUME~1/GARYTE~1/LOCALS~1/Temp/ccEJAcaa.o: In function `main':
C:/msys/1.0/home/Gary Tekulsky/open-cobol-1.0/conftest.c:80: undefined reference to `_doprnt'
C:/msys/1.0/home/Gary Tekulsky/open-cobol-1.0/conftest.c:79: undefined reference to `_doprnt'
collect2: ld returned 1 exit status
configure:20749: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| #define STDC_HEADERS 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| #define COB_HAS_INLINE 1
| #define HAVE_ALLOCA 1
| #define HAVE_VPRINTF 1
| /* end confdefs.h. */
| /* Define _doprnt to an innocuous variant, in case declares _doprnt.
| For example, HP-UX 11i declares gettimeofday. */
| #define _doprnt innocuous__doprnt
|
| /* System header to define __stub macros and hopefully few prototypes,
| which can conflict with char _doprnt (); below.
| Prefer to if __STDC__ is defined, since
| exists even on freestanding compilers. */
|
| #ifdef __STDC__
| # include
| #else
| # include
| #endif
|
| #undef _doprnt
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| {
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char _doprnt ();
| /* The GNU C library defines this for functions which it implements
| to always fail with ENOSYS. Some functions are actually named
| something starting with __ and the normal name is an alias. */
| #if defined (__stub__doprnt) || defined (__stub____doprnt)
| choke me
| #else
| char (*f) () = _doprnt;
| #endif
| #ifdef __cplusplus
| }
| #endif
|
| int
| main ()
| {
| return f != _doprnt;
| ;
| return 0;
| }
configure:20774: result: no
configure:20805: checking for memmove
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
conftest.c:64: warning: conflicting types for built-in function 'memmove'
configure:20868: $? = 0
configure:20872: test -z
|| test ! -s conftest.err
configure:20875: $? = 0
configure:20878: test -s conftest.exe
configure:20881: $? = 0
configure:20893: result: yes
configure:20805: checking for memset
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
conftest.c:65: warning: conflicting types for built-in function 'memset'
configure:20868: $? = 0
configure:20872: test -z
|| test ! -s conftest.err
configure:20875: $? = 0
configure:20878: test -s conftest.exe
configure:20881: $? = 0
configure:20893: result: yes
configure:20805: checking for regcomp
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
C:/DOCUME~1/GARYTE~1/LOCALS~1/Temp/ccSwAcaa.o: In function `main':
C:/msys/1.0/home/Gary Tekulsky/open-cobol-1.0/conftest.c:82: undefined reference to `regcomp'
C:/msys/1.0/home/Gary Tekulsky/open-cobol-1.0/conftest.c:81: undefined reference to `regcomp'
collect2: ld returned 1 exit status
configure:20868: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| #define STDC_HEADERS 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| #define COB_HAS_INLINE 1
| #define HAVE_ALLOCA 1
| #define HAVE_VPRINTF 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMSET 1
| /* end confdefs.h. */
| /* Define regcomp to an innocuous variant, in case declares regcomp.
| For example, HP-UX 11i declares gettimeofday. */
| #define regcomp innocuous_regcomp
|
| /* System header to define __stub macros and hopefully few prototypes,
| which can conflict with char regcomp (); below.
| Prefer to if __STDC__ is defined, since
| exists even on freestanding compilers. */
|
| #ifdef __STDC__
| # include
| #else
| # include
| #endif
|
| #undef regcomp
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| {
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char regcomp ();
| /* The GNU C library defines this for functions which it implements
| to always fail with ENOSYS. Some functions are actually named
| something starting with __ and the normal name is an alias. */
| #if defined (__stub_regcomp) || defined (__stub___regcomp)
| choke me
| #else
| char (*f) () = regcomp;
| #endif
| #ifdef __cplusplus
| }
| #endif
|
| int
| main ()
| {
| return f != regcomp;
| ;
| return 0;
| }
configure:20893: result: no
configure:20805: checking for setlocale
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
configure:20868: $? = 0
configure:20872: test -z
|| test ! -s conftest.err
configure:20875: $? = 0
configure:20878: test -s conftest.exe
configure:20881: $? = 0
configure:20893: result: yes
configure:20805: checking for fcntl
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
C:/DOCUME~1/GARYTE~1/LOCALS~1/Temp/ccULBcaa.o: In function `main':
C:/msys/1.0/home/Gary Tekulsky/open-cobol-1.0/conftest.c:83: undefined reference to `fcntl'
C:/msys/1.0/home/Gary Tekulsky/open-cobol-1.0/conftest.c:82: undefined reference to `fcntl'
collect2: ld returned 1 exit status
configure:20868: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| #define STDC_HEADERS 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| #define COB_HAS_INLINE 1
| #define HAVE_ALLOCA 1
| #define HAVE_VPRINTF 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMSET 1
| #define HAVE_SETLOCALE 1
| /* end confdefs.h. */
| /* Define fcntl to an innocuous variant, in case declares fcntl.
| For example, HP-UX 11i declares gettimeofday. */
| #define fcntl innocuous_fcntl
|
| /* System header to define __stub macros and hopefully few prototypes,
| which can conflict with char fcntl (); below.
| Prefer to if __STDC__ is defined, since
| exists even on freestanding compilers. */
|
| #ifdef __STDC__
| # include
| #else
| # include
| #endif
|
| #undef fcntl
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| {
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char fcntl ();
| /* The GNU C library defines this for functions which it implements
| to always fail with ENOSYS. Some functions are actually named
| something starting with __ and the normal name is an alias. */
| #if defined (__stub_fcntl) || defined (__stub___fcntl)
| choke me
| #else
| char (*f) () = fcntl;
| #endif
| #ifdef __cplusplus
| }
| #endif
|
| int
| main ()
| {
| return f != fcntl;
| ;
| return 0;
| }
configure:20893: result: no
configure:20805: checking for strerror
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
configure:20868: $? = 0
configure:20872: test -z
|| test ! -s conftest.err
configure:20875: $? = 0
configure:20878: test -s conftest.exe
configure:20881: $? = 0
configure:20893: result: yes
configure:20805: checking for strcasecmp
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
configure:20868: $? = 0
configure:20872: test -z
|| test ! -s conftest.err
configure:20875: $? = 0
configure:20878: test -s conftest.exe
configure:20881: $? = 0
configure:20893: result: yes
configure:20805: checking for strchr
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
conftest.c:69: warning: conflicting types for built-in function 'strchr'
configure:20868: $? = 0
configure:20872: test -z
|| test ! -s conftest.err
configure:20875: $? = 0
configure:20878: test -s conftest.exe
configure:20881: $? = 0
configure:20893: result: yes
configure:20805: checking for strrchr
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
conftest.c:70: warning: conflicting types for built-in function 'strrchr'
configure:20868: $? = 0
configure:20872: test -z
|| test ! -s conftest.err
configure:20875: $? = 0
configure:20878: test -s conftest.exe
configure:20881: $? = 0
configure:20893: result: yes
configure:20805: checking for strdup
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
conftest.c:71: warning: conflicting types for built-in function 'strdup'
configure:20868: $? = 0
configure:20872: test -z
|| test ! -s conftest.err
configure:20875: $? = 0
configure:20878: test -s conftest.exe
configure:20881: $? = 0
configure:20893: result: yes
configure:20805: checking for strstr
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
conftest.c:72: warning: conflicting types for built-in function 'strstr'
configure:20868: $? = 0
configure:20872: test -z
|| test ! -s conftest.err
configure:20875: $? = 0
configure:20878: test -s conftest.exe
configure:20881: $? = 0
configure:20893: result: yes
configure:20805: checking for strtol
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
configure:20868: $? = 0
configure:20872: test -z
|| test ! -s conftest.err
configure:20875: $? = 0
configure:20878: test -s conftest.exe
configure:20881: $? = 0
configure:20893: result: yes
configure:20805: checking for gettimeofday
configure:20862: gcc -o conftest.exe -g -O2 conftest.c >&5
configure:20868: $? = 0
configure:20872: test -z
|| test ! -s conftest.err
configure:20875: $? = 0
configure:20878: test -s conftest.exe
configure:20881: $? = 0
configure:20893: result: yes
configure:20921: gcc -c -g -O2 conftest.c >&5
configure:20927: $? = 0
configure:20931: test -z
|| test ! -s conftest.err
configure:20934: $? = 0
configure:20937: test -s conftest.o
configure:20940: $? = 0
configure:20994: checking for ld used by GCC
configure:21058: result: c:/mingw/mingw32/bin/ld.exe
configure:21067: checking if the linker (c:/mingw/mingw32/bin/ld.exe) is GNU ld
configure:21080: result: yes
configure:21086: checking for shared library run path origin
configure:21099: result: done
configure:21529: checking for iconv
configure:21556: gcc -o conftest.exe -g -O2 conftest.c >&5
conftest.c:53:19: iconv.h: No such file or directory
conftest.c: In function `main':
conftest.c:57: error: `iconv_t' undeclared (first use in this function)
conftest.c:57: error: (Each undeclared identifier is reported only once
conftest.c:57: error: for each function it appears in.)
conftest.c:57: error: syntax error before "cd"
conftest.c:58: error: `cd' undeclared (first use in this function)
configure:21562: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| #define STDC_HEADERS 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| #define COB_HAS_INLINE 1
| #define HAVE_ALLOCA 1
| #define HAVE_VPRINTF 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMSET 1
| #define HAVE_SETLOCALE 1
| #define HAVE_STRERROR 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRCHR 1
| #define HAVE_STRRCHR 1
| #define HAVE_STRDUP 1
| #define HAVE_STRSTR 1
| #define HAVE_STRTOL 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_TIMEZONE 1
| /* end confdefs.h. */
| #include
| #include
| int
| main ()
| {
| iconv_t cd = iconv_open("","");
| iconv(cd,NULL,NULL,NULL,NULL);
| iconv_close(cd);
| ;
| return 0;
| }
configure:21607: gcc -o conftest.exe -g -O2 conftest.c -liconv >&5
conftest.c:53:19: iconv.h: No such file or directory
conftest.c: In function `main':
conftest.c:57: error: `iconv_t' undeclared (first use in this function)
conftest.c:57: error: (Each undeclared identifier is reported only once
conftest.c:57: error: for each function it appears in.)
conftest.c:57: error: syntax error before "cd"
conftest.c:58: error: `cd' undeclared (first use in this function)
configure:21613: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| #define STDC_HEADERS 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| #define COB_HAS_INLINE 1
| #define HAVE_ALLOCA 1
| #define HAVE_VPRINTF 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMSET 1
| #define HAVE_SETLOCALE 1
| #define HAVE_STRERROR 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRCHR 1
| #define HAVE_STRRCHR 1
| #define HAVE_STRDUP 1
| #define HAVE_STRSTR 1
| #define HAVE_STRTOL 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_TIMEZONE 1
| /* end confdefs.h. */
| #include
| #include
| int
| main ()
| {
| iconv_t cd = iconv_open("","");
| iconv(cd,NULL,NULL,NULL,NULL);
| iconv_close(cd);
| ;
| return 0;
| }
configure:21641: result: no, consider installing GNU libiconv
configure:21743: checking for nl_langinfo and CODESET
configure:21764: gcc -o conftest.exe -g -O2 conftest.c >&5
conftest.c:52:22: langinfo.h: No such file or directory
conftest.c: In function `main':
conftest.c:56: error: `CODESET' undeclared (first use in this function)
conftest.c:56: error: (Each undeclared identifier is reported only once
conftest.c:56: error: for each function it appears in.)
conftest.c:56: warning: initialization makes pointer from integer without a cast
configure:21770: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| #define STDC_HEADERS 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| #define COB_HAS_INLINE 1
| #define HAVE_ALLOCA 1
| #define HAVE_VPRINTF 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMSET 1
| #define HAVE_SETLOCALE 1
| #define HAVE_STRERROR 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRCHR 1
| #define HAVE_STRRCHR 1
| #define HAVE_STRDUP 1
| #define HAVE_STRSTR 1
| #define HAVE_STRTOL 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_TIMEZONE 1
| /* end confdefs.h. */
| #include
| int
| main ()
| {
| char* cs = nl_langinfo(CODESET);
| ;
| return 0;
| }
configure:21796: result: no
configure:21811: checking for getopt_long_only
configure:21868: gcc -o conftest.exe -g -O2 conftest.c >&5
C:/DOCUME~1/GARYTE~1/LOCALS~1/Temp/ccgnDcaa.o: In function `main':
C:/msys/1.0/home/Gary Tekulsky/open-cobol-1.0/conftest.c:92: undefined reference to `getopt_long_only'
C:/msys/1.0/home/Gary Tekulsky/open-cobol-1.0/conftest.c:91: undefined reference to `getopt_long_only'
collect2: ld returned 1 exit status
configure:21874: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| #define STDC_HEADERS 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| #define COB_HAS_INLINE 1
| #define HAVE_ALLOCA 1
| #define HAVE_VPRINTF 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMSET 1
| #define HAVE_SETLOCALE 1
| #define HAVE_STRERROR 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRCHR 1
| #define HAVE_STRRCHR 1
| #define HAVE_STRDUP 1
| #define HAVE_STRSTR 1
| #define HAVE_STRTOL 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_TIMEZONE 1
| /* end confdefs.h. */
| /* Define getopt_long_only to an innocuous variant, in case declares getopt_long_only.
| For example, HP-UX 11i declares gettimeofday. */
| #define getopt_long_only innocuous_getopt_long_only
|
| /* System header to define __stub macros and hopefully few prototypes,
| which can conflict with char getopt_long_only (); below.
| Prefer to if __STDC__ is defined, since
| exists even on freestanding compilers. */
|
| #ifdef __STDC__
| # include
| #else
| # include
| #endif
|
| #undef getopt_long_only
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| {
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char getopt_long_only ();
| /* The GNU C library defines this for functions which it implements
| to always fail with ENOSYS. Some functions are actually named
| something starting with __ and the normal name is an alias. */
| #if defined (__stub_getopt_long_only) || defined (__stub___getopt_long_only)
| choke me
| #else
| char (*f) () = getopt_long_only;
| #endif
| #ifdef __cplusplus
| }
| #endif
|
| int
| main ()
| {
| return f != getopt_long_only;
| ;
| return 0;
| }
configure:21899: result: no
configure:22089: checking gmp.h usability
configure:22101: gcc -c -g -O2 conftest.c >&5
conftest.c:86:17: gmp.h: No such file or directory
configure:22107: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| #define STDC_HEADERS 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| #define COB_HAS_INLINE 1
| #define HAVE_ALLOCA 1
| #define HAVE_VPRINTF 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMSET 1
| #define HAVE_SETLOCALE 1
| #define HAVE_STRERROR 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRCHR 1
| #define HAVE_STRRCHR 1
| #define HAVE_STRDUP 1
| #define HAVE_STRSTR 1
| #define HAVE_STRTOL 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_TIMEZONE 1
| /* end confdefs.h. */
| #include
| #if HAVE_SYS_TYPES_H
| # include
| #endif
| #if HAVE_SYS_STAT_H
| # include
| #endif
| #if STDC_HEADERS
| # include
| # include
| #else
| # if HAVE_STDLIB_H
| # include
| # endif
| #endif
| #if HAVE_STRING_H
| # if !STDC_HEADERS && HAVE_MEMORY_H
| # include
| # endif
| # include
| #endif
| #if HAVE_STRINGS_H
| # include
| #endif
| #if HAVE_INTTYPES_H
| # include
| #else
| # if HAVE_STDINT_H
| # include
| # endif
| #endif
| #if HAVE_UNISTD_H
| # include
| #endif
| #include
configure:22130: result: no
configure:22134: checking gmp.h presence
configure:22144: gcc -E conftest.c
conftest.c:52:17: gmp.h: No such file or directory
configure:22150: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "OpenCOBOL"
| #define PACKAGE_TARNAME "open-cobol"
| #define PACKAGE_VERSION "1.0"
| #define PACKAGE_STRING "OpenCOBOL 1.0"
| #define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
| #define PACKAGE "open-cobol"
| #define VERSION "1.0"
| #define COB_DEBUG 1
| #define __USE_STRING_INLINES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define WITH_DB 3
| #define WITH_LFS64 1
| #define PATCH_LEVEL 0
| #define WITH_VARSEQ 0
| #define STDC_HEADERS 1
| #define HAVE_STDINT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SIGNAL_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_LOCALE_H 1
| #define HAVE_STDDEF_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_SYS_TIME_H 1
| #define COB_HAS_INLINE 1
| #define HAVE_ALLOCA 1
| #define HAVE_VPRINTF 1
| #define HAVE_MEMMOVE 1
| #define HAVE_MEMSET 1
| #define HAVE_SETLOCALE 1
| #define HAVE_STRERROR 1
| #define HAVE_STRCASECMP 1
| #define HAVE_STRCHR 1
| #define HAVE_STRRCHR 1
| #define HAVE_STRDUP 1
| #define HAVE_STRSTR 1
| #define HAVE_STRTOL 1
| #define HAVE_GETTIMEOFDAY 1
| #define HAVE_TIMEZONE 1
| /* end confdefs.h. */
| #include
configure:22170: result: no
configure:22205: checking for gmp.h
configure:22212: result: no
configure:22222: error: gmp.h is required
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=i686-pc-mingw32
ac_cv_build_alias=i686-pc-mingw32
ac_cv_c_bigendian=no
ac_cv_c_compiler_gnu=yes
ac_cv_c_const=yes
ac_cv_c_inline=inline
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=.exe
ac_cv_func__doprnt=no
ac_cv_func_alloca_works=yes
ac_cv_func_fcntl=no
ac_cv_func_getopt_long_only=no
ac_cv_func_gettimeofday=yes
ac_cv_func_memmove=yes
ac_cv_func_memset=yes
ac_cv_func_regcomp=no
ac_cv_func_setlocale=yes
ac_cv_func_strcasecmp=yes
ac_cv_func_strchr=yes
ac_cv_func_strdup=yes
ac_cv_func_strerror=yes
ac_cv_func_strrchr=yes
ac_cv_func_strstr=yes
ac_cv_func_strtol=yes
ac_cv_func_vprintf=yes
ac_cv_header_dlfcn_h=no
ac_cv_header_fcntl_h=yes
ac_cv_header_gmp_h=no
ac_cv_header_inttypes_h=yes
ac_cv_header_locale_h=yes
ac_cv_header_malloc_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_signal_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stddef_h=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_time_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_header_wchar_h=yes
ac_cv_host=i686-pc-mingw32
ac_cv_host_alias=i686-pc-mingw32
ac_cv_objext=o
ac_cv_path_install='/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_ac_ct_AR=ar
ac_cv_prog_ac_ct_AS=as
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_DLLTOOL=dlltool
ac_cv_prog_ac_ct_OBJDUMP=objdump
ac_cv_prog_ac_ct_RANLIB=ranlib
ac_cv_prog_ac_ct_STRIP=strip
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=
ac_cv_prog_egrep='grep -E'
ac_cv_prog_make_make_set=yes
ac_cv_struct_tm=time.h
ac_cv_type_size_t=yes
ac_cv_working_alloca_h=no
acl_cv_hardcode_direct=no
acl_cv_hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
acl_cv_hardcode_libdir_separator=
acl_cv_hardcode_minus_L=no
acl_cv_libext=a
acl_cv_path_LD=c:/mingw/mingw32/bin/ld.exe
acl_cv_prog_gnu_ld=yes
acl_cv_rpath=done
acl_cv_shlibext=dll
acl_cv_wl=-Wl,
am_cv_CC_dependencies_compiler_type=gcc3
am_cv_func_iconv='no, consider installing GNU libiconv'
am_cv_langinfo_codeset=no
am_cv_lib_iconv=no
lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
lt_cv_dlopen=LoadLibrary
lt_cv_dlopen_libs=
lt_cv_file_magic_cmd='$OBJDUMP -f'
lt_cv_file_magic_test_file=
lt_cv_ld_reload_flag=-r
lt_cv_objdir=.libs
lt_cv_path_LD=c:/mingw/mingw32/bin/ld.exe
lt_cv_path_NM=/mingw/bin/nm
lt_cv_path_SED=/bin/sed
lt_cv_prog_compiler_c_o=yes
lt_cv_prog_compiler_rtti_exceptions=no
lt_cv_prog_gnu_ld=yes
lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)
\{0,1\}$/\1 _\2 \2/p'\'''
lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\) $/ {\"\1\", (lt_ptr) 0},/p'\'' -e '\''s/^[BCDEGRST] \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr) \&\2},/p'\'''
lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^. .* \(.*\)$/extern int \1;/p'\'''
lt_cv_sys_max_cmd_len=8192
lt_lt_cv_prog_compiler_c_o='"yes"'
lt_lt_cv_sys_global_symbol_pipe='"sed -n -e '\''s/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*_\\([_A-Za-z][_A-Za-z0-9]*\\)
\\{0,1\\}\$/\\1 _\\2 \\2/p'\''"'
lt_lt_cv_sys_global_symbol_to_c_name_address='"sed -n -e '\''s/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p'\'' -e '\''s/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'\''"'
lt_lt_cv_sys_global_symbol_to_cdecl='"sed -n -e '\''s/^. .* \\(.*\\)\$/extern int \\1;/p'\''"'
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL='aclocal-1.9'
ALLOCA=''
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='tar'
AR='ar'
AS='as'
AUTOCONF='autoconf'
AUTOHEADER='autoheader'
AUTOMAKE='automake-1.9'
AWK='gawk'
CC='gcc'
CCDEPMODE='depmode=gcc3'
CFLAGS='-g -O2'
COBC_LIBS=''
COB_BIGENDIAN=''
COB_CC='gcc'
COB_CFLAGS=''
COB_CONFIG_DIR=''
COB_EXPORT_DYN=''
COB_HAS_INLINE=''
COB_LDFLAGS=''
COB_LIBRARY_PATH=''
COB_LIBS=''
COB_MODULE_EXT=''
COB_PIC_FLAGS=''
COB_SHARED_OPT=''
CPP='gcc -E'
CPPFLAGS=''
CXXCPP=''
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
DLLTOOL='dlltool'
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='grep -E'
EXEEXT='.exe'
GMSGFMT=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
INTLLIBS=''
LDFLAGS=''
LIBCOB_CFLAGS=''
LIBCOB_LIBS='-lm'
LIBICONV=''
LIBINTL=''
LIBOBJS=' getopt.o getopt1.o'
LIBS=''
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
LN_S='ln -s'
LTLIBICONV=''
LTLIBINTL=''
LTLIBOBJS=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='makeinfo'
MKINSTALLDIRS=''
MSGFMT=''
MSGMERGE=''
OBJDUMP='objdump'
OBJEXT='o'
PACKAGE='open-cobol'
PACKAGE_BUGREPORT='open-cobol-list@lists.sourceforge.net'
PACKAGE_NAME='OpenCOBOL'
PACKAGE_STRING='OpenCOBOL 1.0'
PACKAGE_TARNAME='open-cobol'
PACKAGE_VERSION='1.0'
PATH_SEPARATOR=':'
POSUB=''
RANLIB='ranlib'
SED='/bin/sed'
SET_MAKE=''
SHELL='/bin/sh'
STRIP='strip'
USE_NLS=''
VERSION='1.0'
XGETTEXT=''
ac_ct_AR='ar'
ac_ct_AS='as'
ac_ct_CC='gcc'
ac_ct_DLLTOOL='dlltool'
ac_ct_OBJDUMP='objdump'
ac_ct_RANLIB='ranlib'
ac_ct_STRIP='strip'
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__include='include'
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build='i686-pc-mingw32'
build_alias=''
build_cpu='i686'
build_os='mingw32'
build_vendor='pc'
datadir='${prefix}/share'
exec_prefix='NONE'
host='i686-pc-mingw32'
host_alias=''
host_cpu='i686'
host_os='mingw32'
host_vendor='pc'
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/home/Gary Tekulsky/open-cobol-1.0/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
mkdir_p='mkdir -p --'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define COB_DEBUG 1
#define COB_HAS_INLINE 1
#define HAVE_ALLOCA 1
#define HAVE_FCNTL_H 1
#define HAVE_GETTIMEOFDAY 1
#define HAVE_INTTYPES_H 1
#define HAVE_LOCALE_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMORY_H 1
#define HAVE_MEMSET 1
#define HAVE_SETLOCALE 1
#define HAVE_SIGNAL_H 1
#define HAVE_STDDEF_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRCASECMP 1
#define HAVE_STRCHR 1
#define HAVE_STRDUP 1
#define HAVE_STRERROR 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_TIMEZONE 1
#define HAVE_UNISTD_H 1
#define HAVE_VPRINTF 1
#define HAVE_WCHAR_H 1
#define PACKAGE "open-cobol"
#define PACKAGE_BUGREPORT "open-cobol-list@lists.sourceforge.net"
#define PACKAGE_NAME "OpenCOBOL"
#define PACKAGE_STRING "OpenCOBOL 1.0"
#define PACKAGE_TARNAME "open-cobol"
#define PACKAGE_VERSION "1.0"
#define PATCH_LEVEL 0
#define STDC_HEADERS 1
#define STDC_HEADERS 1
#define VERSION "1.0"
#define WITH_DB 3
#define WITH_LFS64 1
#define WITH_VARSEQ 0
#define __USE_STRING_INLINES 1
configure: exit 1
----------------------------------------------------------------
Looks like a GMP make/install problem.
Make sure the GMP stuff is in the MinGW
environment and not the MSYS environment.
Roger
----------------------------------------------------------------
Not sure how to check that. I know that gmp install files are located under MSYS/1.0/home//gmp-4.2.2 and that there was one or 2 errors on its ./configure due to there being a space in my username
----------------------------------------------------------------
Hmm. That's wrong. When configuring/making/installing GMP, you should specify the MinGW directory as the prefix.
(And try not to use path names with spaces. You will eventually hit problems anyway)
Roger
----------------------------------------------------------------
ill redo gmp but MSYS contains the home directory for my MINGW command line environment
----------------------------------------------------------------
still have some problems
GMP: MAKE CHECK
la
mkdir .libs
libtool: link: cannot find the library `../libgmp.la' or unhandled argument `../libgmp.la'
make[4]: *** [libtests.la] Error 1
make[4]: Leaving directory `/home/gmp-4.2.2/tests'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/home/gmp-4.2.2/tests'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/home/gmp-4.2.2/tests'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/gmp-4.2.2'
make: *** [check] Error 2
----------------------------------------------------------------
Subject: Formatting problem?
I am converting from one dialect to Open Cobol.
My next problem is linking error messages with the source. If I
cobc -free -E sacpic1.cbl
I get the source listed on the terminal, no errors.
cobc -free -E sacpic1.cbl > sacpic1.lst
I get the source in the file sacpic1.lst, no errors
however if I enter
cobc -free -x sacpic1.cbl
I get
sacpic1.cbl:113: Error: Invalid picture string
sacpic1.cbl:113: Error: Invalid picture string
sacpic1.cbl:113: Error: Invalid picture string
sacpic1.cbl: In paragraph 'Nextitem':
sacpic1.cbl:119: Error: syntax error, unexpected "Identifier"
however no way I can find to link the errors back to the source.
Any help will be appreciated.
Mike
----------------------------------------------------------------
Can You tell us what is the picture in line 113. Post a part of your program between
left_bracket+code+right_bracket (this is to start)
..
your prog here
..
..
left_bracket+/code+right_bracket (this is to end)
Bear
----------------------------------------------------------------
left_bracket+code+right_bracket (this is to start)
..
IDENTIFICATION DIVISION.
PROGRAM-ID. sacpic1.
AUTHOR. wei inc.
INSTALLATION. Customer.
DATE-WRITTEN. april 1992.
DATE-COMPILED. when-compiled.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. intel-386dx.
OBJECT-COMPUTER. intel-386dx.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY "sacpic.w1" .
LINKAGE SECTION.
COPY "sacpic.l1" .
SCREEN SECTION.
COPY "sacpic.s1" .
01 database-maint-menu.
02 LINE menu-line4 col 22
foreground-color title-color
highlight
VALUE "Supervisory System Maintenance Menu".
02 LINE menu-line6 col menu-lit-col1
foreground-color heading-color
highlight
VALUE "Enter to perform.........".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "A Maintain Tank Master File".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "B Maintain Materials Master File".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "C Maintain Tank Assignment File".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "D Maintain Vendor File".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "E Maintain Operator File".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "F Maintain Log File".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "G Maintain Location File".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "H Maintain Recipe Archive".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "I List Online Error Log".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "J Maintain Closed Receivers".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "K Analyze OLTP Transactions".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "L Maintain Part Number File".
02 LINE PLUS 1 col menu-lit-col1
foreground-color data-color
VALUE "M Maintain Shift Times".
02 LINE menu-line6 col menu-lit-col2
foreground-color heading-color
highlight
VALUE "Enter to perform.........".
02 LINE PLUS 1 col menu-lit-col2
foreground-color data-color
VALUE "N Filler Parameter Maintenance".
02 LINE PLUS 2 col menu-lit-col2
foreground-color data-color
VALUE "U Rebuild daily index".
02 LINE PLUS 1 col menu-lit-col2
foreground-color data-color
VALUE "V Restore File Menu".
02 LINE PLUS 1 col menu-lit-col2
foreground-color data-color
VALUE "W Backup File Menu".
02 LINE PLUS 1 col menu-lit-col2
foreground-color data-color
VALUE "X Initialization Menu".
02 LINE PLUS 1 col menu-lit-col2
foreground-color data-color
VALUE "Y Reorganization Menu".
02 LINE PLUS 1 col menu-lit-col2
foreground-color data-color
VALUE "Z Return to previous menu".
02 LINE message-line col 1
foreground-color data-color
VALUE "Enter Selection ".
02 col PLUS 1 PIC X
foreground-color data-color
auto
USING action.
01 non-func.
02 LINE message-line col 1
BLANK LINE.
02 LINE message-line col 1
foreground-color warning-color
VALUE "Function not available, contact engineering.".
02 col PLUS 1
VALUE " Hit any key to continue.. ".
02 col PLUS 1
PIC X
auto
USING action.
PROCEDURE DIVISION.
Nextitem.
MOVE "sacpic1" TO program-name.
DISPLAY screen-header1.
DISPLAY database-maint-menu.
ACCEPT database-maint-menu.
INSPECT ALL action REPLACING lower-case BY upper-case.
EVALUATE action
WHEN "A" GO TO Calla
WHEN "B" GO TO Callb
WHEN "C" GO TO Callc
WHEN "D" GO TO Calld
WHEN "E" GO TO Calle
WHEN "F" GO TO Callf
WHEN "G" GO TO Callg
WHEN "H" GO TO Callh
WHEN "I" GO TO Calli
WHEN "J" GO TO Callj
WHEN "K" GO TO Callk
WHEN "L" GO TO Calll
WHEN "M" GO TO Callm
WHEN "N" GO TO Calln
WHEN "U" GO TO Callu
WHEN "V" GO TO Callv
WHEN "W" GO TO Callw
WHEN "X" GO TO Callx
WHEN "Y" GO TO Cally
WHEN "Z" GO TO Alldone
WHEN OTHER GO TO Nextitem
END-EVALUATE.
calla.
CALL "sacpic1a" USING return-status.
CANCEL "sacpic1A".
GO TO Nextitem.
callb.
CALL "sacpic1b" USING return-status.
CANCEL "sacpic1B".
GO TO Nextitem.
callc.
CALL "sacpic1c" USING return-status.
CANCEL "sacpic1C".
GO TO Nextitem.
calld.
CALL "sacpic1d" USING return-status.
CANCEL "sacpic1D".
GO TO Nextitem.
calle.
CALL "sacpic1e" USING return-status.
CANCEL "sacpic1e".
GO TO Nextitem.
callf.
CALL "sacpic1f" USING return-status.
CANCEL "sacpic1f".
GO TO Nextitem.
callg.
CALL "sacpic1G" USING return-status.
CANCEL "sacpic1G".
GO TO Nextitem.
callh.
CALL "sacpic99" USING return-status.
CANCEL "sacpic99".
GO TO Nextitem.
calli.
CALL "sacpicrz" USING return-status.
CANCEL "sacpicrz".
GO TO Nextitem.
callj.
CALL "sacpic6a" USING return-status.
CANCEL "sacpic6a".
GO TO Nextitem.
callk.
CALL "sacpicia" USING return-status.
CANCEL "sacpicia".
GO TO Nextitem.
calll.
CALL "sacpic8e" USING return-status.
CANCEL "sacpic8e".
GO TO Nextitem.
callm.
CALL "sacpic8s" USING return-status.
CANCEL "sacpic8s".
GO TO Nextitem.
calln.
CALL "sacpic9a" USING return-status.
CANCEL "sacpic9a".
GO TO Nextitem.
callu.
CALL "sacpic89" USING return-status.
CANCEL "sacpic89".
GO TO Nextitem.
callv.
CALL "sacpic93" USING return-status.
CANCEL "sacpic93".
GO TO Nextitem.
callw.
CALL "sacpic94" USING return-status.
CANCEL "sacpic94".
GO TO Nextitem.
callx.
DISPLAY non-func.
ACCEPT non-func.
GO TO Nextitem.
cally.
CALL "sacpic91" USING return-status.
CANCEL "sacpic91".
GO TO Nextitem.
alldone.
MOVE 0 TO pass-status.
EXIT PROGRAM.
..
..
left_bracket+/code+right_bracket (this is to end)
line 112 is PROCEDURE DIVISION.
----------------------------------------------------------------
[code]
OC does not handle screen section.
[/code]
----------------------------------------------------------------
Subject: SCREEN SECTION.
Should I assume that the SCREEN SECTION is NOT in OpenCOBOL 1.1?
If that is TRUE is there an alternate method of formatting screens in OpenCOBOL?
Thanques!
----------------------------------------------------------------
Yes,
There is no real support of screen section.
Accept / Display is supported but not complete,
SEE cobcurses in this forum
Bear
----------------------------------------------------------------
Please try the current 1.1.
Although SCREEN processing is not completely
implemented, the current 1.1 may get you further.
Roger
----------------------------------------------------------------
Subject: Help needed on C$NARG routine (CHAINING / USING )
Hello,
I'm using C$NARG in a few programs. I used this module only in called programs (via linkage section). I recently found out that I can use it with CHAINING as mentioned below.
[quote]CALL "C$NARG" USING NUM-PARAM
"This data item is filled in with the # of parameters. If the calling program is a subprogram, then this will be the number of USING items in the CALL statement that initiated the program. If the calling program is a main program, then this will be the number of CHAINING parameters passed from the command line or the CHAIN statement that initiated the program. C$NARG works only when the program is a called subroutine." ...[/quote]
So works my ACU (6.2).
In fact C$NARG in OC does not deliver # of params when used with CHAINING.
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. CHAINE.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 wp1 pic X(30).
77 wp2 pic X(30).
77 wp3 pic X(30).
77 wNbP pic 9(05).
77 ZNbP pic zzbzz9.
77 I pic X.
PROCEDURE DIVISION chaining wp1 wp2 wp3.
DEBUT.
call "C$NARG" using wNbp.
move wNbP to ZnbP.
display "This program chains " znbp " arguments"
display "Argument 1 from command-line is ", wp1.
display "Argument 2 from command-line is ", wp2.
display "Argument 3 from command-line is ", wp3.
accept I.
STOP RUN.
[/code]
executing this program ./CHAINE aaaa bbbb cccc dddd
[code]
This program chains 0 arguments
Argument 1 from command-line is aaaa
Argument 2 from command-line is bbbb
Argument 3 from command-line is cccc
[/code]
This is not something that is boring me, but ... who knows
Best regards
Bear
(OpenCobol 1.1.0 Built May 7 2008)
----------------------------------------------------------------
Fixed in current 1.1 tarball.
Roger
----------------------------------------------------------------
Thank you very much Roger
You worked for me, so I worked a bit for the community.
I post in this reply two programs I used to test C$NARG in CALL context. I Think it could be useful for newbies and others.
First program is called CALLER.CBL
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. CALLER.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 wp1 pic X(30).
77 wp2 pic X(30).
77 wp3 pic X(30).
77 wp4 pic X(30).
77 wNbP pic 9(5).
77 ZNbP pic zzbzz9.
77 I pic X.
PROCEDURE DIVISION.
DEBUT.
display "Hello, This Is The Caller Program Speaking"
display "Test 1:3=Exact # of parameters are being transmitted"
move "par#1 from CALLER" to wp1
move "par#2 from CALLER" to wp2
move "par#3 from CALLER" to wp3
call "CALLED" using wp1 wp2 wp3
on exception
display "Something wrong happened in 1:3"
end-display
not on exception
display "Everything is OK in 1:3"
end-display
end-call
display "Hello, This Is The Caller Program Speaking Again"
display "Test 2:3=More parameters are being transmitted"
move "par#1 from CALLER" to wp1
move "par#2 from CALLER" to wp2
move "par#3 from CALLER" to wp3
move "par#4 from CALLER" to wp4
call "CALLED" using wp1 wp2 wp3 wp4
on exception
display "Something wrong happened 2:3"
end-display
not on exception
display "Everything is OK in 2:3"
end-display
end-call
display "Hello, This Is Still The Caller Program Speaking "
display "Test 3:3=ZERO parameter is being transmitted"
move "par#1 from CALLER" to wp1
move "par#2 from CALLER" to wp2
move "par#3 from CALLER" to wp3
move "par#4 from CALLER" to wp4
call "CALLED"
on exception
display "Something wrong happened in 3:3"
end-display
not on exception
display "Everything is OK in 3:3"
end-display
end-call
display "Caller Program Says : You know what ? I'm Happy !"
.
accept I
.
FIN.
exit program.
[/code]
... and the is second is called CALLED.CBL
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. CALLED.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 wMax pic 9.
77 ZMax pic zzbzz9.
77 I pic X.
77 P pic 9.
01 wTbLnk.
02 wTbLnk-p1 pic X(30).
02 wTbLnk-p2 pic X(30).
02 wTbLnk-p3 pic X(30).
01 wTbLnk-R redefines wTbLnk.
02 wTbLnk-Item pic X(30) occurs 3.
linkage section.
77 wp1 pic X(30).
77 wp2 pic X(30).
77 wp3 pic X(30).
PROCEDURE DIVISION using wp1 wp2 wp3.
DEBUT.
call "C$NARG" using wMax.
move wMax to ZMax.
display " This program uses " zMax " arguments"
evaluate wMax
when 0
display " No arguments has been transmitted !"
end-display
when 1
move wp1 to wTbLnk-p1
when 2
move wp1 to wTbLnk-p1
move wp2 to wTbLnk-p2
when 3
move wp1 to wTbLnk-p1
move wp2 to wTbLnk-p2
move wp3 to wTbLnk-p3
when other
display "More than THREE aguments has been transmitted"
move wp1 to wTbLnk-p1
move wp2 to wTbLnk-p2
move wp3 to wTbLnk-p3
move 3 to wMax
end-evaluate
perform varying P from 1 by 1 until P > wMax
display " Argument" P " is ", wTbLnk-Item (P), P
end-display
end-perform
.
FIN.
exit program.
[/code]
And this is my test result after compiling with the last tarball
cobc (OpenCOBOL) 1.1.0 Build date May 15 2008 09:54:38
Copyright (C) 2001-2008 Keisuke Nishida / Roger While
Hello, This Is The Caller Program Speaking
Test 1:3=Exact # of parameters are being transmitted
This program uses 3 arguments
Argument1 is par#1 from CALLER 1
Argument2 is par#2 from CALLER 2
Argument3 is par#3 from CALLER 3
Everything is OK in 1:3
Hello, This Is The Caller Program Speaking Again
Test 2:3=More parameters are being transmitted
This program uses 4 arguments
More than THREE aguments has been transmitted
Argument1 is par#1 from CALLER 1
Argument2 is par#2 from CALLER 2
Argument3 is par#3 from CALLER 3
Everything is OK in 2:3
Hello, This Is Still The Caller Program Speaking
Test 3:3=ZERO parameter is being transmitted
This program uses 0 arguments
No arguments has been transmitted !
Everything is OK in 3:3
Caller Program Says : You know what ? I'm Happy !
To be complete next test concerns C$NARG in CHAINING context :
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. CHAINED.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 wNbP pic 9(05).
77 ZNbP pic zzbzz9.
77 I pic X.
77 wp1 pic X(30).
77 wp2 pic X(30).
77 wp3 pic X(30).
PROCEDURE DIVISION chaining wp1 wp2 wp3.
DEBUT.
call "C$NARG" using wNbp.
move wNbP to ZnbP.
display "This program chains " znbp " arguments"
display "Argument 1 is ", wp1.
display "Argument 2 is ", wp2.
display "Argument 3 is ", wp3.
accept I.
STOP RUN.
[/code]
And this the test results :
./CHAINED AAA BBB CCC
This program chains 3 arguments
Argument 1 is AAA
Argument 2 is BBB
Argument 3 is CCC
./CHAINED
This program chains 0 arguments
Argument 1 is
Argument 2 is
Argument 3 is
./CHAINED AAA BBB CCC DDD
This program chains 4 arguments
Argument 1 is AAA
Argument 2 is BBB
Argument 3 is CCC
-----------------
;-) I'm still happy.
Last program tries to use "CHAIN" verb ...
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. CHAINER.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 wNbP pic 9(05).
77 ZNbP pic zzbzz9.
77 I pic X.
77 wp1 pic X(30).
77 wp2 pic X(30).
77 wp3 pic X(30).
PROCEDURE DIVISION chaining wp1 wp2 wp3.
DEBUT.
call "C$NARG" using wNbp.
move wNbP to ZnbP.
display "This program chains " znbp " arguments"
display "Argument 1 is ", wp1.
display "Argument 2 is ", wp2.
display "Argument 3 is ", wp3.
chain "CHAINED" using wp1 wp2 wp3
on exeception
display "Something wrong happened when chaining"
end-display
not on exception
display "Everything is OK"
end-chain
.
accept I.
FIN.
exit program.
[/code]
And result of compilation is
Copyright (C) 2001-2008 Keisuke Nishida / Roger While
CHAINER.CBL: In paragraph 'DEBUT':
CHAINER.CBL:22: Error: 'chain' reserved word, but not supported yet
CHAINER.CBL:22: Error: Unknown statement 'chain'
Best regards
Bear
----------------------------------------------------------------
Yep, we do not currently support the CHAIN verb.
(Note CHAIN/CHAINING are non-standard extensions)
There is a reason for current non-support of CHAIN.
CHAIN syntax(ACU) states that the program to be chained
be started as a seperate process AND that the current
processs terminates. BUT, if the CHAIN does NOT succeed
then the ON EXCEPTION should be executed.
(Note there cannot logically be a NOT ON EXCEPTION for CHAIN).
Now think about this. In order to prepare for a successful
execution of the chained prog, then the equivalent of
a STOP RUN must be done (releasing locks, closing open files, etc.). BUT having done that, if the process execution fails (eg. prog not found in path or whatever),
then we need the original status/environment to continue execution.
So, not easy. I maybe can see a way to do this on Posix systems but Win is going to be a problem.
Roger
----------------------------------------------------------------
Then there should be a standard warning when using this or CHAIN should only be compiled if a special argument on cobc is used.
----------------------------------------------------------------
Human, what are you suggesting?
It is quite clear that CHAIN is not supported and will
not likely be so in the near future.
The error messages are (I hope) quite clear :-)
If, and when, it would be supported, then we do not need any special option.
Roger
----------------------------------------------------------------
"I maybe can see a way to do this on Posix systems but Win is going to be a problem."
So if it will be supported someday it should either work on windows-systems, too, or it should be only compiled if a special option is used.
This is necessary for not going "somewhere unknown" with a program that was tested as working on unix systems and which is used on a windows machine.
----------------------------------------------------------------
OK. Note that CHAIN/CHAINING is not part
of any standard.
CHAINING was put in for an ACU user.
I have not yet had any usage of CHAIN.
(And it is most likely the wrong thing to
be doing).
Roger
----------------------------------------------------------------
Subject: Unable to find cobol module within dynamic library
I am getting the following message:
call_cobfunc: failed to call setenvtest - Cannot find module 'setenvtest'.
Here is the sample code that is causing this problem. (Note: The logic within these sample code represents our current products.)
mainmix code:
#include
#include
static int (*call_cobfunc)( void );
int main( int argc, char** argv )
{
void* libptr = dlopen( "./libmix.so", RTLD_LAZY );
if ( libptr ) {
call_cobfunc = dlsym( libptr, "call_cobfunc" );
if ( call_cobfunc ) {
call_cobfunc();
}
dlclose( libptr );
}
return 0;
}
call_cobfunc code:
#include
#include
static int (*setenvtest)( void );
int call_cobfunc( void )
{
cob_init( NULL, 0 );
/* find the module with PROGRAM-ID "say". */
setenvtest = cob_resolve( "setenvtest" );
if ( !setenvtest ) {
printf( "call_cobfunc: failed to call setenvtest - %s\n", cob_resolve_error () );
return 1;
}
setenvtest();
return 0;
}
setenvtest code:
IDENTIFICATION DIVISION.
PROGRAM-ID. setenvtest.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 ENVTAG PIC X(15) VALUE "TEST=helloworld".
LINKAGE SECTION.
01 WS-RESULT-STRING PIC X(160).
01 ENVIRON-VARIABLE PIC X(160).
PROCEDURE DIVISION.
CALL "setenv" USING BY REFERENCE ENVTAG.
MOVE "TEST" TO ENVIRON-VARIABLE.
CALL "getenvtest".
DISPLAY "RESULT STRING " WS-RESULT-STRING.
STOP RUN.
getenvtest code:
IDENTIFICATION DIVISION.
PROGRAM-ID. getenvtest.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-ENVIRON-VARIABLE-STRING PIC X(31).
01 WS-ENVIRON-VARIABLE-LENGTH PIC 9(03).
01 WS-RESULT-STRING-POINTER USAGE POINTER.
01 WS-STRIP-RESULT-STRING PIC X(160).
01 WS-STRIP-RESULT-STRING-SIZE PIC S9(04) COMP.
01 WS-MAX-ENVIRON-VALUE-SIZE PIC 9(02) VALUE 30.
LINKAGE SECTION.
01 WS-RESULT-STRING PIC X(160).
01 ENVIRON-VARIABLE PIC X(160).
PROCEDURE DIVISION.
MOVE 1 TO WS-ENVIRON-VARIABLE-LENGTH
STRING ENVIRON-VARIABLE DELIMITED BY SPACE
LOW-VALUE DELIMITED BY SIZE
INTO WS-ENVIRON-VARIABLE-STRING
WITH POINTER WS-ENVIRON-VARIABLE-LENGTH
CALL "getenv" USING BY REFERENCE ENVIRON-VARIABLE
RETURNING WS-RESULT-STRING-POINTER.
DISPLAY "Environment value returned for "
ENVIRON-VARIABLE " is: " WS-RESULT-STRING-POINTER
IF WS-RESULT-STRING-POINTER <> NULL
DISPLAY "pointer is not null "
SET ADDRESS OF WS-RESULT-STRING
TO WS-RESULT-STRING-POINTER
UNSTRING WS-RESULT-STRING DELIMITED BY LOW-VALUE
INTO WS-STRIP-RESULT-STRING
COUNT IN WS-STRIP-RESULT-STRING-SIZE
END-UNSTRING
DISPLAY "Environment value returned for "
ENVIRON-VARIABLE " is: "
WS-STRIP-RESULT-STRING
END-IF.
The version of OC 1.1.
command used to compile library:
cobc -c setenvtest.cbl
cobc -c getenvtest.cbl
gcc -c call_cobfunc.c `cob-config --cflags`
gcc -shared -o libmix.so call_cobfunc.o setenvtest.o setenvtest.o `cob-config --libs`
command used to compile mixmain:
gcc -o mixmain mixmain.c
Any ideas how to get this to work would be appreciated.
:-)
----------------------------------------------------------------
In AIX cobol world we have problems like this because the cobol compiler want to upper-case called module names (by default).
Curt
----------------------------------------------------------------
So would I uppercase the function names in the COBOL code. If so, I tried this and is still cannot find the module.
Any other suggestions.
:-)
----------------------------------------------------------------
If I change the cob_callfunc code to the following it will execute the setenvtest function but then I get "libcob: Cannot find module 'getenvtest'".
change to cob_callfunc code:
#include
#include
extern int setenvtest( void );
int call_cobfunc( void )
{
cob_init( 0, NULL );
setenvtest();
return 0;
}
Any ideas why libcob cannot find "getenvtest()".
:-)
----------------------------------------------------------------
No, no, no. This is all wrong.
Even if it did find the entry point, it would
segfault as you are referencing LINKAGE parameters
which have no linkage. Further your call to "setenv" is wrong (takes 3 params, env name, env value, overwrite flag).
(Following using OC 1.1)
Here is what will work -
mixmain.c -
/* Begin */
#include
#include
static int (*call_cobfunc)( void );
int main( int argc, char** argv )
{
void* libptr = dlopen( "./libmix.so", RTLD_LAZY );
if ( libptr ) {
call_cobfunc = dlsym( libptr, "call_cobfunc" );
if ( call_cobfunc ) {
call_cobfunc();
}
dlclose( libptr );
}
return 0;
}
/* End */
call_cobfunc.c -
/* Begin */
#include
#include
static int (*setenvtest)( void );
int call_cobfunc( void )
{
cob_init( 0, NULL );
/* find the module with PROGRAM-ID "say". */
setenvtest = cob_resolve( "setenvtest" );
if ( !setenvtest ) {
printf( "call_cobfunc: failed to call setenvtest - %s\n", cob_resolve_error () );
return 1;
}
setenvtest();
return 0;
}
/* End */
setenvtest.cob -
IDENTIFICATION DIVISION.
PROGRAM-ID. setenvtest.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-RESULT-STRING PIC X(160).
01 ENVIRON-VARIABLE PIC X(160).
PROCEDURE DIVISION.
CALL "setenv" USING "TEST" & X"00",
"helloworld" & X"00", by content 1.
MOVE "TEST" TO ENVIRON-VARIABLE.
CALL "getenvtest" using ws-result-string environ-variable.
DISPLAY "RESULT STRING " WS-RESULT-STRING.
STOP RUN.
getenvtest.cob -
IDENTIFICATION DIVISION.
PROGRAM-ID. getenvtest.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
01 WS-RESULT-STRING PIC X(160).
01 ENVIRON-VARIABLE PIC X(160).
PROCEDURE DIVISION using ws-result-string environ-variable.
ACCEPT WS-RESULT-STRING FROM ENVIRONMENT ENVIRON-VARIABLE.
DISPLAY "ENVIRON-VARIABLE is: " WS-RESULT-STRING.
Compile mixmain as usual.
The rest you compile with -
cobc -free -b -o libmix call_cobfunc.c setenvtest.cob getenvtest.cob
Now do -
export COB_PRE_LOAD=libmix
./mixmain
ENVIRON-VARIABLE is: helloworld
RESULT STRING helloworld
Further, you do not need mixmain and call_cobfunc.
Just do -
cobc -free -b -o libmix setenvtest.cob getenvtest.cob
export COB_PRE_LOAD=libmix
cobcrun setenvtest
Roger
----------------------------------------------------------------
Just so you know, the manual pages do not explain that you need to export COB_PRE_LOAD. I followed the instructions in the manual on how to create library.
Thank you for the help. I got it to work.
PS. The "setenv" should have been "putenv", sorry about that.
:-)
----------------------------------------------------------------
Actually, you do not need COB_PRE_LOAD if the
entry/module is available as a loadable object.
So, using my examples -
cobc -free setenvtest.cob
cobc -free getenvtest.cob
cobcrun setenvtest
ie. The name of the loadable module is the
same as the entry point (Prog-id).
So, eg. If setenvtest.cob was renamed SETENVTEST.cob
(but the Prog-id remains lower-case setenvtest), then -
> rm -f setenvtest.so
> cobc -free SETENVTEST.cob
> cobcrun setenvtest
libcob: Cannot find module 'setenvtest'
> cobcrun SETENVTEST
libcob: ./SETENVTEST.so: undefined symbol: SETENVTEST
> export COB_PRE_LOAD=SETENVTEST
> cobcrun setenvtest
ENVIRON-VARIABLE is: helloworld
RESULT STRING helloworld
COB_PRE_LOAD is usually used for special situations eg.
creating a "library" of modules.
Also be careful when passing params to the normal
C library routines (eg. setenv, putenv, etc.).
Where string pointers are passed, these are (usually)expected to be null-terminated. This is NOT the case with
Cobol data items. Even with 01 level items, there
is no guarantee that the byte following the actual storage
is actually a null-byte.
Roger
----------------------------------------------------------------
Subject: Installation problem with screenio.o
Hi,
I'm trying to install OpenCobol 1.0 on Fedora 4.
I ran configure without DB
and then make which failed with the following error
gcc -DHAVE_CONFIG_H -I. -I. -I.. -DSUPER_OPTIMIZE -I.. -O2 -march=i686 -mtune=pentium4 -finline-functions -fomit-frame-pointer -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -MT libcob_la-screenio.lo -MD -MP -MF .deps/libcob_la-screenio.Tpo -c screenio.c -fPIC -DPIC -o .libs/libcob_la-screenio.o
screenio.c: In function 'cob_screen_attr':
screenio.c:107: error: 'chtype' undeclared (first use in this function)
screenio.c:107: error: (Each undeclared identifier is reported only once
screenio.c:107: error: for each function it appears in.)
screenio.c:107: error: syntax error before 'styles'
screenio.c:114: error: 'styles' undeclared (first use in this function)
screenio.c:115: warning: implicit declaration of function 'attrset'
screenio.c:115: error: 'A_NORMAL' undeclared (first use in this function)
screenio.c:117: warning: implicit declaration of function 'clear'
screenio.c:120: warning: implicit declaration of function 'clrtoeol'
screenio.c:123: warning: implicit declaration of function 'clrtobot'
screenio.c:126: warning: implicit declaration of function 'beep'
screenio.c:129: error: 'A_REVERSE' undeclared (first use in this function)
screenio.c:132: error: 'A_BOLD' undeclared (first use in this function)
screenio.c:135: error: 'A_BLINK' undeclared (first use in this function)
screenio.c:138: error: 'A_UNDERLINE' undeclared (first use in this function)
screenio.c:140: warning: implicit declaration of function 'attron'
screenio.c:147: error: 'COLOR_BLACK' undeclared (first use in this function)
screenio.c:150: error: 'COLOR_BLUE' undeclared (first use in this function)
screenio.c:153: error: 'COLOR_GREEN' undeclared (first use in this function)
screenio.c:156: error: 'COLOR_CYAN' undeclared (first use in this function)
screenio.c:159: error: 'COLOR_RED' undeclared (first use in this function)
screenio.c:162: error: 'COLOR_MAGENTA' undeclared (first use in this function)
screenio.c:165: error: 'COLOR_YELLOW' undeclared (first use in this function)
screenio.c:168: error: 'COLOR_WHITE' undeclared (first use in this function)
screenio.c:204: error: 'COLOR_PAIRS' undeclared (first use in this function)
screenio.c:205: warning: implicit declaration of function 'pair_content'
screenio.c:210: warning: implicit declaration of function 'init_pair'
screenio.c:215: warning: implicit declaration of function 'COLOR_PAIR'
screenio.c:216: warning: implicit declaration of function 'bkgdset'
screenio.c: In function 'cob_screen_init':
screenio.c:227: warning: implicit declaration of function 'initscr'
screenio.c:231: warning: implicit declaration of function 'cbreak'
screenio.c:232: warning: implicit declaration of function 'keypad'
screenio.c:232: error: 'stdscr' undeclared (first use in this function)
screenio.c:232: error: 'TRUE' undeclared (first use in this function)
screenio.c:233: warning: implicit declaration of function 'nonl'
screenio.c:234: warning: implicit declaration of function 'echo'
screenio.c:239: warning: implicit declaration of function 'has_colors'
screenio.c:240: warning: implicit declaration of function 'start_color'
screenio.c:242: error: 'COLOR_PAIRS' undeclared (first use in this function)
screenio.c:246: error: 'A_NORMAL' undeclared (first use in this function)
screenio.c: In function 'cob_screen_terminate':
screenio.c:256: warning: implicit declaration of function 'endwin'
screenio.c: In function 'cob_screen_puts':
screenio.c:267: warning: implicit declaration of function 'mvaddnstr'
screenio.c:268: warning: implicit declaration of function 'refresh'
screenio.c: In function 'cob_screen_gets':
screenio.c:275: warning: implicit declaration of function 'mvgetnstr'
----------------------------------------------------------------
Install runtime AND development ncurses packages.
Also, use OC 1.1.
Roger
----------------------------------------------------------------
Subject: Evaluate Statement problems
We are migrating our current MF COBOL applications to use OC 1.1. The issue we have run into is the EVALUATE statement is executing every WHEN. Here is a sample program that produces the issue we are having.
trigger.c code:
**************************************
#include
#include
extern int say( char* trigger );
int main( int argc, char** argv )
{
char trigger = ' ';
if ( argc != 2 ) {
printf( "Usage: say \n" );
return 1;
}
trigger = *argv[1];
cob_init(0, NULL);
say( (char*) &trigger );
return 0;
}
********************************************
say.cbl code:
********************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. say.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
01 TRIGGER PIC X(01).
88 T-HELLO VALUE "A".
88 T-BYE VALUE "B".
PROCEDURE DIVISION USING TRIGGER.
MAINLINE.
DISPLAY "TRIGGER = " TRIGGER.
EVALUATE TRUE
WHEN T-HELLO
PERFORM 0100-HELLO-WORLD THRU 0100-EXIT
WHEN T-BYE
PERFORM 0200-BYE-WORLD THRU 0200-EXIT
WHEN OTHER
PERFORM 0300-CLUELESS THRU 0300-EXIT
END-EVALUATE
EXIT PROGRAM.
*> Print hello world
0100-HELLO-WORLD.
DISPLAY "HELLO WORLD!!".
0100-EXIT.
EXIT.
*> Print bye world
0200-BYE-WORLD.
DISPLAY "BYE WORLD!!".
0200-EXIT.
EXIT.
*> Print not a clue
0300-CLUELESS.
DISPLAY "NOT A CLUE WHAT YOU WANT.".
0300-EXIT.
EXIT.
********************************************
If you execute the program "say B" the results are:
TRIGGER = B
BYE WORLD!!
HELLO WORLD!!
BYE WORLD!!
NOT A CLUE WHAT YOU WANT.
Why does it evaluate 4 times??
Now if I change the say.cbl code to the following I get the result I would expect.
**************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. say.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
01 TRIGGER PIC X(01).
88 T-HELLO VALUE "A".
88 T-BYE VALUE "B".
PROCEDURE DIVISION USING TRIGGER.
MAINLINE.
DISPLAY "TRIGGER = " TRIGGER.
EVALUATE TRUE
WHEN T-HELLO
DISPLAY "HELLO WORLD!!"
WHEN T-BYE
DISPLAY "BYE WORLD!!"
WHEN OTHER
DISPLAY "NOT A CLUE WHAT YOU WANT."
END-EVALUATE
EXIT PROGRAM.
**************************************
Results
************************************
TRIGGER = B
BYE WORLD!!
Any suggestions why this is happening? The current applications that I am trying to migrate to OC require the latter functionality but are designed like the first say.cbl code.
Thanks
:-)
----------------------------------------------------------------
You do not say how you are compiling both
progs.
Anyway, that is not the way I would do it.
Try this -
IDENTIFICATION DIVISION.
PROGRAM-ID. say.
ENVIRONMENT DIVISION.
DATA DIVISION.
working-storage SECTION.
01 TRIGGER PIC X(01).
88 T-HELLO VALUE "A".
88 T-BYE VALUE "B".
procedure division.
MAINLINE.
accept trigger from command-line.
DISPLAY "TRIGGER = " TRIGGER.
EVALUATE TRUE
WHEN T-HELLO
PERFORM 0100-HELLO-WORLD THRU 0100-EXIT
WHEN T-BYE
PERFORM 0200-BYE-WORLD THRU 0200-EXIT
WHEN OTHER
PERFORM 0300-CLUELESS THRU 0300-EXIT
END-EVALUATE
goback.
*> Print hello world
0100-HELLO-WORLD.
DISPLAY "HELLO WORLD!!".
0100-EXIT.
EXIT.
*> Print bye world
0200-BYE-WORLD.
DISPLAY "BYE WORLD!!".
0200-EXIT.
EXIT.
*> Print not a clue
0300-CLUELESS.
DISPLAY "NOT A CLUE WHAT YOU WANT.".
0300-EXIT.
EXIT.
> cobc -free -x say.cob
> ./say
TRIGGER =
NOT A CLUE WHAT YOU WANT.
> ./say A
TRIGGER = A
HELLO WORLD!!
> ./say B
TRIGGER = B
BYE WORLD!!
or :
> cobc -free say.cob
> cobcrun say
TRIGGER =
NOT A CLUE WHAT YOU WANT.
> cobcrun say A
TRIGGER = A
HELLO WORLD!!
> cobcrun say B
TRIGGER = B
BYE WORLD!!
Note -
If you expect MF to return command line params on
a PROCEDURE DIVISION USING ..., then this
is undefined behaviour.
It MAY work depending where particular pointers
are on the stack. See forum thread on linkage section.
The MF accepted method is as in the prog above with the
command-line accept.
Roger
----------------------------------------------------------------
[d]Roger,
But isn't there still a problem? The evaluates clause he gave should only perform one of those paragraphs, shouldn't it?[/d]
I figured I'd test this to see what was going on. Behaves as expected here.
----------------------------------------------------------------
Yes, this is really a hard error. Perform ... through ... within an evaluate clause seems to need a fix. It seems like OC does not do the exit program after evaluate clause.
----------------------------------------------------------------
Jason/Human, look closely at my example.
It works correctly.
If you look carefully at the orginal posted
code, there is trigger.c and say.cob. But he executes
using "say A". I would expect somehting like "trigger A". That's why I said, I need to see how the orginal was compiled/linked. (And this I believe to be the problem)
Also note that I use "GOBACK" (Yes it is in the Cobol standard). If the program is implicitly/explicitly a main
program, it operates as a STOP RUN; if the program is
a module, it operates as an EXIT PROGRAM.
From the standard for GOBACK -
***
1) If a GOBACK statement is executed in a program that is under the control of a calling runtime element, the
program operates as if executing an EXIT PROGRAM statement with the RAISING phrase, if any, that is
specified in the GOBACK statement.
2) If a GOBACK statement is executed in a program that is not under the control of a calling runtime element, the
program operates as if executing a STOP statement without any optional phrases. A RAISING phrase, if
specified, is ignored.
***
From the standard for EXIT PROGRAM -
***
5) If the EXIT PROGRAM statement is executed in a program that is not under the control of a calling runtime
element, the EXIT PROGRAM statement is treated as if it were a CONTINUE statement
***
Roger
----------------------------------------------------------------
I compiled the programs as follows:
cobc -c say.cbl
xlc -c trigger.c -I/usr/local/include
xlc -o say *.o -L/usr/local/lib -lcob
I tried the GOBACK statement, it solves the problem in my sample program.
The GOBACK statement is it a 2002 COBOL standard or an 85 COBOL standard? I believe all our current applications use the 85 COBOL standard.
:-)
----------------------------------------------------------------
How about you actually define what
you want to achieve?
I also do conversions for a nominal fee :-)
I do not see why you want a trigger program.
GOBACK is 2002 standard.
(And actually done by MF for some time).
Roger
----------------------------------------------------------------
#include
#include
extern int say( char* trigger );
int main( int argc, char** argv )
{
char trigger = ' ';
if ( argc != 2 ) {
printf( "Usage: say \n" );
return 1;
}
trigger = *argv[1];
cob_init(0, NULL);
say( (char*) &trigger );
return 0;
}
How about -
say(argv[1]);
You should not pass a string pointer that is
not (guarenteed) null terminated. This is
a normal C requirement.
Roger
----------------------------------------------------------------
As I cannot post our source code, I create sample programs that follow how the current code is designed and replicate the issue I am having in the actual code. Once I get a possible solution I implement into the actual code, test it and document the changes that are required.
No, there is not point to the trigger program other than it replicated the problem I was having and followed the way the code is designed in the actual program.
Thanks for you help.
:-)
----------------------------------------------------------------
Some more notes.
1)
Regarding EXIT PROGRAM and what is a "main" program.
Well, you may say, but I compiled it as a module.
This is, in fact, not relevant.
Consider -
cobc -x myprog.cob
./myprog
or
cobc myprog.cob
cobcrun myprog
In both cases we have a "main" program.
(And in both cases EXIT PROGRAM becomes CONTINUE ie.
a noop)
This is equivalent to the original posted source whereby
"trigger" is effectively "cobcrun".
We actually determine what EXIT PROGRAM does by inspecting
the cob_module structure.
You can actually get the posted source to work with EXIT PROGRAM by modifying trigger.c to pretend it is a Cobol module -
Insert somewhere in trigger.c -
static cob_field *cob_user_parameters[COB_MAX_FIELD_PARAMS];
static cob_module module = { NULL, NULL, NULL, NULL, cob_user_parameters, 0, '.', '$', ',', 1, 1, 1, 0};
Then AFTER cob_init and BEFORE the call to "say", insert -
module.next = cob_current_module;
cob_current_module = &module;
I do not recommend that you use internal OC structures
in your own C code. This is just meant to clarify what is going on. OC structures may be subject to change.
2) Whenever possible use "cobc" to compile. It knows better than you do what C compile options are necessary.
So (with modified trigger as above)-
> cobc -x -free trigger.c say.cob -o say
> ./say A
> TRIGGER = A
> HELLO WORLD!!
or
> cobc -x -free trigger.c say.cob
produces an executable "trigger" -
> ./trigger A
> TRIGGER = A
> HELLO WORLD!!
If you use the "-v" option on the compile, you will
see exactly the C compiler/linker commands that are
being executed.
Roger
----------------------------------------------------------------
Subject: set my-index to null
Although usage of NULL here is dubious
and strictly speaking not allowed,
(and eg. MOVE NULL TO index-item), I have
decided that we should allow this.
(Otherwise there would be more problems with
the parser).
Fix is obvious.
OC 1.1 tarball updated.
(ChangeLog's follow later)
Roger
----------------------------------------------------------------
[code]77 my-index usage is index.
...
set my-index to null[/code]generates [quote](*(int *) (b_2738)) = (unsigned char *)NULL;[/quote]and gcc-compiler warning, while[code]set my-index to 0[/code] seems to be ok.
Should the OC-Compiler give a message like "Index cannot be set to NULL" or is this behaviour wrong?
----------------------------------------------------------------
Subject: FOREGROUND-COLOR / BACKGROUND-COLOR ...
Hello,
Is there any possibility to have foreground and background color defined with a pic 9 in working or linkage . It will be very helpful to me to minimize code when managing colors in DISPLAY statements.
OC does not accept this :
[code]
77 wFore pic 9.
77 wBack pic 9.
...
move 7 to wFore
move 4 to wBack
...
display "Hello World"
line 10 column 20 with
foreground-color wFore
background-color wBack
end-display
[/code]
You said it is not standard. I agree. But it is very BORING to code with 64 tests each time you have to display an item on the screen.
I have a main program that calls a module in order to display items with colors defined by the caller. You can imagine how much tests are used ...
I do not use screen section at all ...
Best regards ...
Bear
:-(
----------------------------------------------------------------
Well, why don't you use a screen section? :-)
Current tarball accepts data items as
FG/BG objects. The extended (MF) ACCEPT/DISPLAY
is somewhat more complicated :-(
(And it's not anywhere near the top on my TODO)
Roger
----------------------------------------------------------------
Hello Roger,
Thank you for the current tarball. Why I not using screen section ? Because I have 2,500 programs written without any mention to a screen section ...
I tested this little program :
[code]
identification division.
program-id. TSTSCR.
data division.
working-storage section.
77 i pic 99.
77 j pic 99.
77 wLine pic 99.
77 wPosition pic 99.
77 wFore pic 9.
77 wBack pic 9.
SCREEN SECTION.
01 item.
02 item-hello
line wLine
column wPosition
foreground-color wFore
background-color wback value " Hello ".
PROCEDURE DIVISION.
debut.
perform varying j from 0 by 1 until j > 7
perform varying i from 1 by 1 until i > 7
add 1 i giving wLine
compute
wPosition = (7 * j) + 1
end-compute
move j to wback
move i to wfore
display item
end-perform
end-perform
.
accept i
.
fin.
EXIT PROGRAM.
[/code]
It works fine !
:-D
----------------------------------------------------------------
:-) :-)
Well, of course, if people followed the standards
instead of using vendor extensions then we would not
have a problem :-)
Having said that, the standard does not cover
(even in proposed 2008 standard) things like interacting
with the environment (environment variables, command line, etc.).
Currently looking at the DISPLAY syntax.
The problem is parsing the MF extension.
The MF extension allows the optional screen attributes
at any point following an identifier/literal.
So, eg.
DISPLAY "TEST " dataitem " TEST2 " dataitem2
AT LINE 3 " TEST3" AT LINE 4.
Problem here is the lookahead for the parser.
Roger
----------------------------------------------------------------
... Yes,
In other words if I need something to interact with OC in order to "replace" display & accepts, what method should I apply ?
1) Develop myself what I need in "C" ?
2) Some software exists, but I never heard about ?
By the way ... I'm learning C ! It helps me to understand OC ... and other languages
Best regards
Bear
----------------------------------------------------------------
Not a C problem, it is a parser
problem. Specifically cobc/parser.y.
This may not be solveable at this level.
Roger
----------------------------------------------------------------
To resume the situation, I must invest time for tools building, if I want my screen react to function keys, arrows, and escape.
I want to add some line drawing, other than poor "+-|". In all cases I will need to solve my i-o on screen with calls.
This is the way I should go
Don't you think so ?
Regards
Bear
----------------------------------------------------------------
As I said, the MF extension is somewhat unparsable.
If we talk about a single field, then I might be able to do something.
Roger
----------------------------------------------------------------
As far as I'm concerned, I am 250 % OK for a single field !
If I need to display a dozen of fields in various colors,
I have routines to do that and in fact my module consist of
a dozen of DISPLAY of a single field !!
Best regards
Bear
----------------------------------------------------------------
OK. Stand by. Will try to get it in.
(But only for as the moment one field, so
people do not lambast me for not supporting MF
syntax completely)
Roger
----------------------------------------------------------------
OK. Give the current 1.1 tarball a shot.
Should do what you want.
Roger
----------------------------------------------------------------
Wow ! Thank you Roger,
This is now going much better !
I have noticed that clearing screen with erase eos doesn't care about given instructions.
for example :
[code]
display "Hello" line 02 column 02
with erase eos
foreground-color is 1
background-color is 7
end-display
[/code]
background is kept remaining, only Hello is displayed.
I tried some color management in ACCEPT statements (only single fields). I have elaborate better tests.
Thank you again
Bear :-)
----------------------------------------------------------------
I hope the following program will help you for tests.
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. KOLORS.
*>
*> TESTING COLORS : I changed the name of Program-id.
*>
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. DELL.
OBJECT-COMPUTER. DELL.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 I pic X.
78 noir value 01.
78 bleu value 02.
78 vert value 03.
78 rouge value 04.
78 magenta value 05.
78 marron value 06.
78 blanc value 07.
PROCEDURE DIVISION.
DEBUT.
*> This statement does not work -------------------
display SPACES
line 02 column 02 with blank screen
foreground-color blanc
background-color vert
end-display
*> These statements are going well ----------------
display
"Bonjour"
line 12 column 36
with foreground-color bleu
background-color magenta
end-display
display
"Monsieur"
line 13 column 36
with foreground-color noir
background-color blanc
end-display
display
"Le Professeur"
line 14 column 35
with foreground-color marron
background-color vert
end-display
.
FIN.
accept I.
*> This statement is never reached ----------------
display
"This part of program is never reached !!!"
line 23 column 02 with
foreground-color marron highlight
background-color rouge
end-display
.
ULTIME.
EXIT PROGRAM.
[/code]
Best regards
Bear
----------------------------------------------------------------
OK. Try current 1.1 tarball.
Note, temporarily, I have put a one second
delay in when terminating screen programs.
Otherwise, depending on things like terminal emulation,
machine/screen speed and other factors, you may not get to see the last display as in the program above.
Roger
----------------------------------------------------------------
Wonderful !
Its going better than best for coding ...
I think we have still little problems with EOS and EOL options.
I wrote a little program you can test with.
[code]
identification division.
program-id. BLANKS.
*>
*> This program has been written in order to test
*> the DISPLAY statement and BLANK SCREEN, ERASE EOS & EOL options
*>
DATA DIVISION.
WORKING-STORAGE SECTION.
77 w80 pic X(080).
77 I pic 99.
77 J pic 99.
77 K pic 99.
77 L pic 99.
PROCEDURE DIVISION.
BEGIN.
perform varying I from 0 by 1 until I > 7
display space
with foreground-color 0
background-color I
blank screen
end-display
call "C$SLEEP" using "1"
perform varying J from 0 by 1 until J > 7
display "Here comes EOS"
line 03 column 03
with foreground-color 0
background-color J
erase EOS
end-display
perform varying K from 0 by 1 until K > 7
add 5 K giving L
display "Here comes EOL" line L column 05
with foreground-color 0
background-color K
erase EOL
end-display
end-perform
call "C$SLEEP" using "1"
end-perform
end-perform
.
fin.
EXIT PROGRAM.
[/code]
With respect
Bear
----------------------------------------------------------------
A very colourful program :-)
Can you try current 1.1 tarball.
I have put in a quick fix that I will
have to review later.
Roger
----------------------------------------------------------------
Great !
Works fine Thank you !
Very fast & good work Roger
I have other tests under way concerning ACCEPT statement.
I will post you final results
Best regards
Bear :-)
----------------------------------------------------------------
Subject: cobc -v
if I do:[code]cobc -v [...] 1>output.log 2>error.log[/code]I see all the information from -v option in error.log. Shouldn't -v output into >1 like --help?
Using -v the gcc is called. Is there another option doing nothing (or only create c-files) but display the options that would be used for gcc like -v does?
----------------------------------------------------------------
To question 1 -
No, because that would screw up the "-E" usage.
To question 2 -
Until you get to the point of actually doing something,
it does not make much sense to report further
possible options.
Note that gcc itself does not do this.
(Nor does any other C compiler that I am aware of)
So you can do eg.
cobc -v -fsyntax-only xxx.cob
However if you want preprocessed source, then
cobc -v -E xxx.cob 2>myvoptions
(While the output is produced on stdout)
Compile to C source -
cobc -v (-x) -C xxx.cob (2>myvoptions)
Roger
----------------------------------------------------------------
To 1st:
Why does it screw up the -E usage? I'm nut sure but I think the 2nd stream is the error stream. If that is true -E and -v should output to 1st stream, not to 2nd.
To 2nd:
So -v is only passed by oc to the gcc, right? I just wanted to save the compiler options somewhere to compile the C sources with these options on another machine.
new 3rd:
Are these gcc-compile options different depending on the given COBOL source or only depending on the options used for cobc?
----------------------------------------------------------------
1) No, -E ouputs to stdout (as should be) and
anything else outputs to stderr.
2) No, -v shows what commands are being executed
on THIS machine/environment. See below.
3) There is no dependence on OC options, BUT
for different machines/environments you WILL get different
results.
eg.
cobc -x -v -std=mf qwr.cob
preprocessing qwr.cob into /tmp/cob1003_0.cob
qwr.cob:20: Warning: RECORD clause ignored for LINE SEQUENTIAL
translating /tmp/cob1003_0.cob into /tmp/cob1003_0.c
gcc -pipe -c -I/usr/local/include -Wno-unused -fsigned-char -o /tmp/cob1003_0.o /tmp/cob1003_0.c
gcc -pipe -Wl,--export-dynamic -o qwr /tmp/cob1003_0.o -L/usr/local/lib -lcob -lm -lgmp -lncurses -ldb -ldl
BUT working in a test environment -
roglinux:~ # cd /disk02/ocnew
roglinux:/disk02/ocnew # cd tests
roglinux:/disk02/ocnew/tests # . ./atconfig
roglinux:/disk02/ocnew/tests # . ./atlocal
roglinux:/disk02/ocnew/tests # cd
roglinux:~ # cobc -x -v -std=mf qwr.cob
preprocessing qwr.cob into /tmp/cob1012_0.cob
qwr.cob:20: Warning: RECORD clause ignored for LINE SEQUENTIAL
translating /tmp/cob1012_0.cob into /tmp/cob1012_0.c
gcc -pipe -c -I/disk02/ocnew/tests/.. -I/usr/local/include -Wno-unused -fsigned-char -o /tmp/cob1012_0.o /tmp/cob1012_0.c
gcc -pipe -L/disk02/ocnew/tests/.././libcob/.libs -Wl,--export-dynamic -o qwr /tmp/cob1012_0.o -L/disk02/ocnew/tests/.././libcob/.libs -lcob -lm -lgmp -lncurses -ldb -ldl
So, you certainly cannot use the output from -v to try
to second-guess somwhere else :-)
Roger
----------------------------------------------------------------
OK, So I do not want to make this stuff any longer.
But I don't get the point why -E (and --help) should be the only options that output to stdout. -v belongs there, too and not to stderr, doesn't it?
----------------------------------------------------------------
Subject: zero supression formatting issue
We are migrating MF code to OC, but have encountered a problem when compiling with the following definition:
01 WS-RECORDS-READ-CNT-DISPLAY PIC Z(8)9 VALUE 0.
Does OC 1.1 support this? Or is this a MF standard?
Thanks
:-)
----------------------------------------------------------------
It will compile, but it's not the ideal way to do things. For a start you're initializing an edited field with a numeric literal and you're defining it at 01 level. Both not really good practise, IMO.
If you don't want to touch the level then at least change the VALUE clause to a string literal padded with 8 spaces (I used hyphens for illustration only):
[code]
01 WS-RECORDS-READ-CNT-DISPLAY PIC Z(8)9 VALUE '--------0'.
[/code]
Personally, I would group together variables under a single 01 level then initialize them all at once at the beginning of the code:
[code]
WORKING-STORAGE SECTION.
01 WS-VARIABLES.
03 WS-RECORDS-READ-CNT-DISPLAY PIC Z(8)9.
...
PROCEDURE DIVISION.
INITIALIZE WS-VARIABLES
[/code]
Others may have different views...
----------------------------------------------------------------
Well actually, I do not see any problem except maybe
that it is producing a warning. The generated code
is correct.
Questionable whether or not the warning should be produced.
Roger
----------------------------------------------------------------
Warnings on incorrect values and moves are fine, because they are indeed wrong.
----------------------------------------------------------------
Subject: cobc compiler core dumped
Statement used for compiling:
cobc -x -c loadAdimmasterBS.cbl -std=mfm -Wall -I../../common/cobol/cbl
-I../../common/cobol/cde -I../../common/cobol/cpy -I../../common/cobol/def -
I../../common/cobol/ipc -I../../common/cobol/lnk -I../../common/cobol/rec -I.
./../common/cobol/tbl -I../../loadAdimmasterBS/cbl -I../../loadAdimmasterBS/cde -I../../loadAdimmasterBS/cpy -I../../loadAdimmasterBS/def -I../../loadAdimmasterBS/ipc -I../../loadAdimmasterBS/lnk -I../../loadAdimmasterBS/rec -I../../loadAdimmasterBS/tbl -I/usr/include -I /home/oracle/product/9.2.0.7/precomp/public -I /home/oracle/product/9.2.0.7/rdbms/public -I /home/oracle/product/9.2.0.7/rdbms/demo -I /home/oracle/product/9.2.0.7/plsql/public -I /home/oracle/product/9.2.0.7/network/public
make: 1254-059 The signal code from the last command is 11.
OC version 1.1 compiled using -g flag, then used dbx to retrieve the information from the core file that was created.
Type 'help' for help.
[using memory image in core]
reading symbolic information ...
Segmentation fault in output_class_name_definition at line 3252 in file "/open-cobol-1.1/cobc/codegen.c" ($t1)
3252 output ("f->data[i] == %d", data[i]);
(dbx) where
output_class_name_definition(p = 0x200200a8), line 3252 in "codegen.c"
codegen(prog = 0x2001c9e8, nested = 0), line 4048 in "codegen.c"
process_translate(fn = 0x2001a668), line 1090 in "cobc.c"
main(argc = 33, argv = 0x2ff21814), line 1576 in "cobc.c"
(dbx)
Any ideas??
----------------------------------------------------------------
We narrowed down the section in our code causing the problem but we do not understand why. This is the section of code causing the problem:
SPECIAL-NAMES.
CLASS ALPHA "A" THRU "Z",
",", "-", "'",
"/", "\", " "
CLASS ALPHA-NUMERIC "A" THRU "Z",
"0" THRU "9",
" "
CLASS ALPHA-NUMERIC-SPECIAL "A" THRU "Z",
"0" THRU "9",
"`", "~", "!",
"@", "#", "$",
"%", "^", "&",
"*", "(", ")",
"_", "+", "-",
"=", "{", "}",
"|", ":", QUOTE,
"<", ">", "?",
"[", "]", "\",
";", "'", ",",
".", "/", " "
CLASS A-TEXT "A" THRU "Z",
"a" THRU "z",
"0" THRU "9",
"`", "~", "!",
"@", "#", "$",
"%", "^", "&",
"*", "(", ")",
"_", "+", "-",
"=", "{", "}",
"|", ":", QUOTE,
"<", ">", "?",
"[", "]", "\",
";", "'", ",",
".", "/", " "
.
Any ideas why this is causing the segmentation fault in the compiler??
:-)
----------------------------------------------------------------
Just a tip: when posting on the forum, you can use the '<>' button to mark-up code and maintain the formatting...
----------------------------------------------------------------
Try replacing the QUOTE literal with '"' - that is a single-quote ('), followed by a double-quote ("), followed by a single-quote (')
----------------------------------------------------------------
We figured it out, we needed to place quotes(") around QUOTE ("QUOTE")
Thanks
----------------------------------------------------------------
I don't think that will work in the way it is intended.
Special Names Classes are used to define ranges of characters - the intention of the QUOTE literal is to include a double-quote character in that class. Instead, you've added the characters Q-U-O-T-E to the class rather than a double-quote character.
You should use my solution.
----------------------------------------------------------------
Fixed in current 1.1 tarball.
Allows figurative constants QUOTE, SPACE, ZERO.
One disadvantage in not using/having the gcc
compiler is that we lose the ability to
detect invalid casts which leads to the segfault/core
dump.
Using gcc, we get -
codegen.c:3249: Invalid type cast from 'QUOTE'
Tag 1 0 Tag 2 7
Aborting compile of qwr.cob at line 266
Which allows easier debugging.
Roger
----------------------------------------------------------------
But gcc is still used when doing cobc, isn't it?
----------------------------------------------------------------
No, it uses whatever C compiler was used/detected/specified
when configuring OC.
In this case klreed is on AIX using the native C compiler
(I believe).
The cast checking relies on a gcc extension
(It's at ca. line 217 in cobc/tree.h).
Roger
----------------------------------------------------------------
Yes, we are using the native C compiler and not gcc. :-)
----------------------------------------------------------------
klreed -
You might consider implementing the
IBM gcc( and see following). Also, the AIX shell is ****.
(Why?, how long does it take to do a "make check" in OC?)
Consider replacing with bash.
(Google will give you the answers)
Roger
----------------------------------------------------------------
I can't do a make check I get the following (native C compiler):
make check-recursive
Making check in lib
Target "check" is up to date.
Making check in libcob
Target "check" is up to date.
Making check in cobc
make check-am
Target "check-am" is up to date.
Making check in bin
Target "check" is up to date.
Making check in config
Target "check" is up to date.
Making check in copy
Target "check" is up to date.
Making check in po
Target "check" is up to date.
Making check in texi
Target "check" is up to date.
Making check in tests
Making check in cobol85
Target "check" is up to date.
make check-TESTS
././syntax[648]: cat: not found
././syntax[654]: cat: not found
././syntax[670]: cat: not found
././syntax[675]: find: not found
././syntax[684]: sed: not found
././syntax[684]: cat: not found
././syntax[725]: sed: not found
././syntax[725]: sed: not found
././syntax[729]: cat: not found
syntax: error: cannot find cobc
FAIL: ./syntax
././run[744]: cat: not found
././run[750]: cat: not found
././run[766]: cat: not found
././run[771]: find: not found
././run[780]: sed: not found
././run[780]: cat: not found
././run[821]: sed: not found
././run[821]: sed: not found
././run[825]: cat: not found
run: error: cannot find cobc
FAIL: ./run
## Run time tests with -O option ##
/home/working/open-cobol-1.1/tests/run[744]: cat: not found
/home/working/open-cobol-1.1/tests/run[750]: cat: not found
/home/working/open-cobol-1.1/tests/run[766]: cat: not found
/home/working/open-cobol-1.1/tests/run[771]: find: not found
/home/working/open-cobol-1.1/tests/run[780]: sed: not found
/home/working/open-cobol-1.1/tests/run[780]: cat: not found
/home/working/open-cobol-1.1/tests/run[821]: sed: not found
/home/working/open-cobol-1.1/tests/run[821]: sed: not found
/home/working/open-cobol-1.1/tests/run[825]: cat: not found
run: error: cannot find cobc
FAIL: ./run-O
././data-rep[590]: cat: not found
././data-rep[596]: cat: not found
././data-rep[612]: cat: not found
././data-rep[617]: find: not found
././data-rep[626]: sed: not found
././data-rep[626]: cat: not found
././data-rep[667]: sed: not found
././data-rep[667]: sed: not found
././data-rep[671]: cat: not found
data-rep: error: cannot find cobc
FAIL: ./data-rep
## Data representation tests with -O option ##
/home/working/open-cobol-1.1/tests/data-rep[590]: cat: not found
/home/working/open-cobol-1.1/tests/data-rep[596]: cat: not found
/home/working/open-cobol-1.1/tests/data-rep[612]: cat: not found
/home/working/open-cobol-1.1/tests/data-rep[617]: find: not found
/home/working/open-cobol-1.1/tests/data-rep[626]: sed: not found
/home/working/open-cobol-1.1/tests/data-rep[626]: cat: not found
/home/working/open-cobol-1.1/tests/data-rep[667]: sed: not found
/home/working/open-cobol-1.1/tests/data-rep[667]: sed: not found
/home/working/open-cobol-1.1/tests/data-rep[671]: cat: not found
data-rep: error: cannot find cobc
FAIL: ./data-rep-O
======================================================
5 of 5 tests failed
Please report to open-cobol-list@lists.sourceforge.net
======================================================
make: 1254-004 The error code from the last command is 1.
Stop.
make: 1254-004 The error code from the last command is 2.
Stop.
make: 1254-004 The error code from the last command is 1.
Stop.
make: 1254-004 The error code from the last command is 1.
Stop.
make: 1254-004 The error code from the last command is 2.
Stop.
I am not longer getting the core dump. I will try the gcc but I think I had other issues (not sure will recheck)
:-)
----------------------------------------------------------------
"cat" not found? :-)
Complain to IBM :-)
IBM, I believe, have bash, gcc ports available.
Roger
----------------------------------------------------------------
Subject: Open a file from the filesystem
Hi everybody !
I've written a little code to try opening a local file with a cobol procedure (to see how it works) ...
The program compiles and runs, but nothing is displayed ...
Here is the code of the program :
[code] *-------
IDENTIFICATION DIVISION.
PROGRAM-ID.fich.
*-------
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FTEST ASSIGN TO EXTERNAL fichier.
*-------
DATA DIVISION.
FILE SECTION.
FD FTEST.
01 LIGNE PIC X(80).
WORKING-STORAGE SECTION.
77 NTESTEOF PIC X VALUE "0".
88 TESTEOF VALUE "1".
*-------
PROCEDURE DIVISION.
0-MAIN.
PERFORM OPENF
PERFORM TRAITE UNTIL TESTEOF
PERFORM CLOSEF
STOP RUN
.
OPENF.
OPEN INPUT FTEST
READ FTEST
AT END SET TESTEOF TO TRUE
END-READ
.
TRAITE.
DISPLAY LIGNE
READ FTEST
AT END SET TESTEOF TO TRUE
END-READ
.
CLOSEF.
CLOSE FTEST
.
*-------[/code]
Thanks for help :)
----------------------------------------------------------------
for testing:
- use a file status (STATUS IS myvar)
- take a 01 level for assign the file name
- put the file to the same folder where executed program is
- display the file status after every file operation
- post your modified source and output
----------------------------------------------------------------
Hi,
Here is the code modified :
[code] *-------
IDENTIFICATION DIVISION.
PROGRAM-ID.fich.
*-------
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FTEST ASSIGN TO EXTERNAL fichier
STATUS IS FILESTAT.
*-------
DATA DIVISION.
FILE SECTION.
FD FTEST.
01 LIGNE PIC X(80).
WORKING-STORAGE SECTION.
77 FILESTAT PIC XX VALUE " ".
77 NTESTEOF PIC X VALUE "0".
88 TESTEOF VALUE "1".
*-------
PROCEDURE DIVISION.
0-MAIN.
PERFORM OPENF
PERFORM TRAITE UNTIL TESTEOF
PERFORM CLOSEF
STOP RUN
.
OPENF.
OPEN INPUT FTEST
DISPLAY "Status open : " FILESTAT
READ FTEST
AT END SET TESTEOF TO TRUE
END-READ
DISPLAY "Status read : " FILESTAT
.
TRAITE.
DISPLAY LIGNE
READ FTEST
AT END SET TESTEOF TO TRUE
END-READ
DISPLAY "Status read : " FILESTAT
.
CLOSEF.
CLOSE FTEST
DISPLAY "Status close : " FILESTAT
.
*-------[/code]
Here is the output :
[code]
Status open : 00
Status read : 10
Status close : 00
[/code]
File is in the same folder and may be read by the user ...
----------------------------------------------------------------
Try:
[code]
SELECT FTEST
ASSIGN TO "fichier"
STATUS IS FILESTAT.
[/code]
----------------------------------------------------------------
Deckard, the original code is perfectly OK.
Arsthan,
What is the actual content of the file "fichier"?
You have defined it as a FIXED length file.
So, if you just set up this file with an
editor and inserted only 1 line less than
80 characters, then the result is (almost, see below) correct. If you want to read a text file, then
you should specify ORGANIZATION IS LINE SEQUENTIAL.
Actually, the code does not check for errors, so
I would actually do something like this -
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID.fich.
*-------
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FTEST ASSIGN TO EXTERNAL fichier
STATUS IS FILESTAT.
*-------
DATA DIVISION.
FILE SECTION.
FD FTEST.
01 LIGNE PIC X(80).
WORKING-STORAGE SECTION.
01 FILESTAT PIC XX VALUE " ".
88 FILE-OK VALUE "00".
77 NTESTEOF PIC X VALUE "0".
88 TESTEOF VALUE "1".
*-------
PROCEDURE DIVISION.
0-MAIN.
PERFORM OPENF
IF FILE-OK
PERFORM TRAITE UNTIL TESTEOF
PERFORM CLOSEF
END-IF
STOP RUN
.
OPENF.
OPEN INPUT FTEST
DISPLAY "Status open : " FILESTAT
.
TRAITE.
READ FTEST
AT END SET TESTEOF TO TRUE
END-READ
IF NOT FILE-OK
SET TESTEOF TO TRUE
END-IF
DISPLAY "Status read : " FILESTAT
DISPLAY LIGNE
.
CLOSEF.
CLOSE FTEST
DISPLAY "Status close : " FILESTAT
.
[/code]
Note the first part of the "TRAITE" paragraph could be coded -
[code]
READ FTEST
END-READ
IF NOT FILE-OK
SET TESTEOF TO TRUE
END-IF
[/code]
This example caused me to look at the handling for
"short" reads of fixed-length sequential.
In fact we should produce status "04" in this case and
not "10" (according to the Cobol standard).
This is fixed in current 1.1 tarball.
Roger
----------------------------------------------------------------
I've modified the select like this
[code]SELECT FTEST ASSIGN TO EXTERNAL fichier
ORGANIZATION IS LINE SEQUENTIAL
STATUS IS FILESTAT.[/code]And now it works fine :)
thanks for help :)
----------------------------------------------------------------
Glad to help :-)
It is useful to get reactions here.
And, as such, feedback is very important!
Roger
----------------------------------------------------------------
Hi,
while talking about files, is there any support for VSAM files in open cobol ?
----------------------------------------------------------------
What do you mean with VSAM?
Variable Sequential? - Yes, of course.
Indexed Sequential? - Yes.
Roger
----------------------------------------------------------------
[quote]Indexed Sequential? - Yes.
Roger[/quote]But only via BDB (see README), your "old" files from MF/ACU/somewhat have to be unloaded and reloaded into the new BDB-Files.
Am I right, Roger?
----------------------------------------------------------------
Correct.
Generally speaking, when indexed sequential files
are being ported, then you must unload on the old
system and reload on the new system.
We are still looking at C-ISAM(MF), D-ISAM, VBISAM
portability.
Roger
----------------------------------------------------------------
Hi,
In VSAM organization (e.g. FB,LRECL=80), In VSAM, there is not separator (CR or/and NL codes) between every recording. After the first record 80 char, you have immediately the secund record; if you have this file type you can't read whith Cobol sequential read on Unix/Linux or Windows. After the first read you have "10" as FileStatus -> End of File (for your FMS you have only one record).
The file transfert tool (from mainframe) must
* convert EBDIC to ASCII and
* add to every record a mark of the end of line mark.
This file type is readable with "ORGANIZATION IS LINE SEQUENTIAL" in the SELECT clause.
...
The notion of files with size record does not exist in Unix/Linux or Windows FMS, there is always a end mark (x0D x0A with M$) for the alphanumeric files.
To simulate the work of OS390 or OS400 FMS, it nearly, in COBOL runtime, read / write blocks (disc sector) of the file and to perform the blockage / releasing.
It is easy to work with files containing variable size records with a mark "End of Record".
*It is managed by the guest system FMS for readings/writings;
*This avoids supplementing all lines with spaces in your Text editor.
For a Cobol source with identification of lines (columns 73 - 80), record makes physically 81 bytes (or 82 with windows) and logical 80 bytes.
Regards,
Jean-Michel
PS: Excuse me for my bad english :-?
----------------------------------------------------------------
NO, NO !
This is a fixed length record.
You can do a EBCDIC to ASCII translation.
It still remains a FIXED length record.
(And you certainly do NOT want to convert it
to anything else).
Roger
----------------------------------------------------------------
Subject: Moving 'spaced' numeric variables into other numeric variables
Hello!
Again, we have a problem with moving numeric variables into other numeric variables.
In this case the source variables are filled with spaces, due to a redefine (see code below).
Example program:
[code]WORKING-STORAGE SECTION.
01 W-RECORD-STRUCTURE.
05 W-RECORD.
10 W-RECORD-TYPE PIC X(03) VALUE SPACE.
10 W-RECORD-DATA PIC X(97) VALUE SPACE.
10 W-RECORD-1 REDEFINES W-RECORD-DATA.
15 W-RECORD-1-ALPHA1 PIC X(02).
15 W-RECORD-1-ALPHA2 PIC X(09).
15 W-RECORD-1-NUM1 PIC 9(05).
15 W-RECORD-1-ALPHA3 PIC X(04).
15 W-RECORD-1-NUM2 PIC 9(06).
15 W-RECORD-1-ALPHA4 PIC X(14).
15 W-RECORD-1-FILLER PIC X(57).
10 W-RECORD-2 REDEFINES W-RECORD-DATA.
15 W-RECORD-2-ALPHA1 PIC X(09).
15 W-RECORD-2-ALPHA2 PIC X(04).
15 W-RECORD-2-NUM1 PIC 9(04).
15 W-RECORD-2-ALPHA3 PIC X(02).
15 W-RECORD-2-NUM2 PIC 9(05).
15 W-RECORD-2-ALPHA4 PIC X(10).
15 W-RECORD-2-FILLER PIC X(63).
01 W-FIELDS.
05 W-VAL1 PIC 9(05).
05 W-VAL2 PIC 9(03)V9(02).
05 W-VAL3 PIC 9(09).
05 W-VAL4 PIC 9(11)V9(02).
05 W-VAL5 PIC S9(05).
05 W-VAL6 PIC S9(03)V9(02).
05 W-VAL7 PIC S9(09).
05 W-VAL8 PIC S9(11)V9(02).
05 W-VAL9 PIC 9(05) COMP-3.
05 W-VAL10 PIC 9(03)V9(02) COMP-3.
05 W-VAL11 PIC 9(09) COMP-3.
05 W-VAL12 PIC 9(11)V9(02) COMP-3.
05 W-VAL13 PIC S9(05) COMP-3.
05 W-VAL14 PIC S9(03)V9(02) COMP-3.
05 W-VAL15 PIC S9(09) COMP-3.
05 W-VAL16 PIC S9(11)V9(02) COMP-3.
PROCEDURE DIVISION.
MOVE 'TYPSOMEDATA' TO W-RECORD.
**** Let's have a look on how W-RECORD-1 looks after this MOVE
DISPLAY 'W-RECORD-1-ALPHA1 [' W-RECORD-1-ALPHA1 ']'.
DISPLAY 'W-RECORD-1-ALPHA2 [' W-RECORD-1-ALPHA2 ']'.
DISPLAY 'W-RECORD-1-NUM1 [' W-RECORD-1-NUM1 ']*'.
DISPLAY 'W-RECORD-1-ALPHA3 [' W-RECORD-1-ALPHA3 ']'.
DISPLAY 'W-RECORD-1-NUM2 [' W-RECORD-1-NUM2 ']*'.
DISPLAY 'W-RECORD-1-ALPHA4 [' W-RECORD-1-ALPHA4 ']'.
**** How do the W-VAL*-variables look before any change
DISPLAY 'W-VAL1 [' W-VAL1 '] before'.
DISPLAY 'W-VAL2 [' W-VAL2 '] before'.
DISPLAY 'W-VAL3 [' W-VAL3 '] before'.
DISPLAY 'W-VAL4 [' W-VAL4 '] before'.
DISPLAY 'W-VAL5 [' W-VAL5 '] before'.
DISPLAY 'W-VAL6 [' W-VAL6 '] before'.
DISPLAY 'W-VAL7 [' W-VAL7 '] before'.
DISPLAY 'W-VAL8 [' W-VAL8 '] before'.
DISPLAY 'W-VAL9 [' W-VAL9 '] before'.
DISPLAY 'W-VAL10 [' W-VAL10 '] before'.
DISPLAY 'W-VAL11 [' W-VAL11 '] before'.
DISPLAY 'W-VAL12 [' W-VAL12 '] before'.
DISPLAY 'W-VAL13 [' W-VAL13 '] before'.
DISPLAY 'W-VAL14 [' W-VAL14 '] before'.
DISPLAY 'W-VAL15 [' W-VAL15 '] before'.
DISPLAY 'W-VAL16 [' W-VAL16 '] before'.
**** Now we take the 'spaced' numeric variable W-RECORD-1-NUM1
**** to move it to the test variables W-VAL*
MOVE W-RECORD-1-NUM1 TO W-VAL1 .
MOVE W-RECORD-1-NUM1 TO W-VAL2 .
MOVE W-RECORD-1-NUM1 TO W-VAL3 .
MOVE W-RECORD-1-NUM1 TO W-VAL4 .
MOVE W-RECORD-1-NUM1 TO W-VAL5 .
MOVE W-RECORD-1-NUM1 TO W-VAL6 .
MOVE W-RECORD-1-NUM1 TO W-VAL7 .
MOVE W-RECORD-1-NUM1 TO W-VAL8 .
MOVE W-RECORD-1-NUM1 TO W-VAL9 .
MOVE W-RECORD-1-NUM1 TO W-VAL10.
MOVE W-RECORD-1-NUM1 TO W-VAL11.
MOVE W-RECORD-1-NUM1 TO W-VAL12.
MOVE W-RECORD-1-NUM1 TO W-VAL13.
MOVE W-RECORD-1-NUM1 TO W-VAL14.
MOVE W-RECORD-1-NUM1 TO W-VAL15.
MOVE W-RECORD-1-NUM1 TO W-VAL16.
**** How do the W-VAL*-variables look after the moves
DISPLAY 'W-VAL1 [' W-VAL1 '] after'.
DISPLAY 'W-VAL2 [' W-VAL2 '] after'.
DISPLAY 'W-VAL3 [' W-VAL3 '] after'.
DISPLAY 'W-VAL4 [' W-VAL4 '] after'.
DISPLAY 'W-VAL5 [' W-VAL5 '] after'.
DISPLAY 'W-VAL6 [' W-VAL6 '] after'.
DISPLAY 'W-VAL7 [' W-VAL7 '] after'.
DISPLAY 'W-VAL8 [' W-VAL8 '] after'.
DISPLAY 'W-VAL9 [' W-VAL9 '] after'.
DISPLAY 'W-VAL10 [' W-VAL10 '] after'.
DISPLAY 'W-VAL11 [' W-VAL11 '] after'.
DISPLAY 'W-VAL12 [' W-VAL12 '] after'.
DISPLAY 'W-VAL13 [' W-VAL13 '] after'.
DISPLAY 'W-VAL14 [' W-VAL14 '] after'.
DISPLAY 'W-VAL15 [' W-VAL15 '] after'.
DISPLAY 'W-VAL16 [' W-VAL16 '] after'.[/code]
Output:
[code]W-RECORD-1-ALPHA1 [SO]
W-RECORD-1-ALPHA2 [MEDATA ]
W-RECORD-1-NUM1 [ ]*
W-RECORD-1-ALPHA3 [ ]
W-RECORD-1-NUM2 [ ]*
W-RECORD-1-ALPHA4 [ ]
W-VAL1 [00000] before
W-VAL2 [00000] before
W-VAL3 [000000000] before
W-VAL4 [0000000000000] before
W-VAL5 [00000+] before
W-VAL6 [00000+] before
W-VAL7 [000000000+] before
W-VAL8 [0000000000000+] before
W-VAL9 [00000] before
W-VAL10 [00000] before
W-VAL11 [000000000] before
W-VAL12 [0000000000000] before
W-VAL13 [00000+] before
W-VAL14 [00000+] before
W-VAL15 [000000000+] before
W-VAL16 [0000000000000+] before
W-VAL1 [ ] after
W-VAL2 [ 00] after
W-VAL3 [0000 ] after
W-VAL4 [000000 00] after
W-VAL5 [ M-`-] after
W-VAL6 [ 00+] after
W-VAL7 [0000 M-`-] after
W-VAL8 [000000 00+] after
W-VAL9 [?0?00] after
W-VAL10 [?0000] after
W-VAL11 [0000?0?00] after
W-VAL12 [000000?0?0000] after
W-VAL13 [?0?00+] after
W-VAL14 [?0000+] after
W-VAL15 [0000?0?00+] after
W-VAL16 [000000?0?0000+] after
[/code]
Expected Output:
Output:
[code]W-RECORD-1-ALPHA1 [SO]
W-RECORD-1-ALPHA2 [MEDATA ]
W-RECORD-1-NUM1 [ ]*
W-RECORD-1-ALPHA3 [ ]
W-RECORD-1-NUM2 [ ]*
W-RECORD-1-ALPHA4 [ ]
W-VAL1 [00000] before
W-VAL2 [00000] before
W-VAL3 [000000000] before
W-VAL4 [0000000000000] before
W-VAL5 [00000+] before
W-VAL6 [00000+] before
W-VAL7 [000000000+] before
W-VAL8 [0000000000000+] before
W-VAL9 [00000] before
W-VAL10 [00000] before
W-VAL11 [000000000] before
W-VAL12 [0000000000000] before
W-VAL13 [00000+] before
W-VAL14 [00000+] before
W-VAL15 [000000000+] before
W-VAL16 [0000000000000+] before
W-VAL1 [00000] after
W-VAL2 [00000] after
W-VAL3 [000000000] after
W-VAL4 [0000000000000] after
W-VAL5 [00000+] after
W-VAL6 [00000+] after
W-VAL7 [000000000+] after
W-VAL8 [0000000000000+] after
W-VAL9 [00000] after
W-VAL10 [00000] after
W-VAL11 [000000000] after
W-VAL12 [0000000000000] after
W-VAL13 [00000+] after
W-VAL14 [00000+] after
W-VAL15 [000000000+] after
W-VAL16 [0000000000000+] after[/code]
cobc (OpenCOBOL) 1.1.0 Build date Apr 23 2008 16:14:56
using the -std=mf flag
HP-UX machinename B.11.31 U ia64 3567537583 unlimited-user license
Thanks for help...
LeBoepp
----------------------------------------------------------------
This is undefined behaviour.
eg. With MF SE 4.x -
simlinux:~ # cob num.cob
simlinux:~ # cobrun num
W-RECORD-1-ALPHA1 [SO]
W-RECORD-1-ALPHA2 [MEDATA ]
W-RECORD-1-NUM1 [ ]*
W-RECORD-1-ALPHA3 [ ]
W-RECORD-1-NUM2 [ ]*
W-RECORD-1-ALPHA4 [ ]
W-VAL1 [ ] before
W-VAL2 [ ] before
W-VAL3 [ ] before
W-VAL4 [ ] before
W-VAL5 [
Execution error : file '/root/num.int'
error code: 163, pc=16E, call=1, seg=0
163 Illegal character in numeric field
or -
simlinux:~ # cob -u num.cob
simlinux:~ # cobrun num
W-RECORD-1-ALPHA1 [SO]
W-RECORD-1-ALPHA2 [MEDATA ]
W-RECORD-1-NUM1 [ ]*
W-RECORD-1-ALPHA3 [ ]
W-RECORD-1-NUM2 [ ]*
W-RECORD-1-ALPHA4 [ ]
W-VAL1 [ ] before
W-VAL2 [ ] before
W-VAL3 [ ] before
W-VAL4 [ ] before
W-VAL5 [00000+] before
W-VAL6 [00000+] before
W-VAL7 [000000000+] before
W-VAL8 [0000000000000+] before
W-VAL9 [20202] before
W-VAL10 [20202] before
W-VAL11 [202020202] before
W-VAL12 [2020202020202] before
W-VAL13 [+20202] before
W-VAL14 [+20202] before
W-VAL15 [+202020202] before
W-VAL16 [+2020202020202] before
W-VAL1 [ ] after
W-VAL2 [ 00] after
W-VAL3 [0000 ] after
W-VAL4 [000000 00] after
W-VAL5 [00000+] after
W-VAL6 [00000+] after
W-VAL7 [000000000+] after
W-VAL8 [0000000000000+] after
W-VAL9 [00000] after
W-VAL10 [00000] after
W-VAL11 [000000000] after
W-VAL12 [0000000000000] after
W-VAL13 [+00000] after
W-VAL14 [+00000] after
W-VAL15 [+000000000] after
W-VAL16 [+0000000000000] after
Roger
----------------------------------------------------------------
Therefore you need [code] IF W-RECORD-1-NUM1 NUMERIC
MOVE W-RECORD-1-NUM1 TO W-VAL1
ELSE
initialize W-VAL1
END-IF[/code]
----------------------------------------------------------------
Changing all our sources was exactly the thing I wanted to avoid... :-(
Of course, initializing non-numeric fields is a solution.
I have done it so far as work-around in the obviously faulty programs.
But indeed, I have no idea in how many other sources this behavior could lead to errors.
Isn't there a possibility to tell OC that it should initialize numeric fields with non-numeric content to its default initial value (type dependant), when you try to fill it with illegal content?
Thanks
LeBoepp
----------------------------------------------------------------
No, this is a redefines and the standards
are quite clear.
I would like to see a BYTE display of the output.
(Problem is that any specfic compiler may interpret
within a DISPLAY a non valid as a specific value)
So, recode to produce BYTE results.
Also, note that variuous compilers produce for
a DISPLAY a mutated display without producing
a warning.
Thanks
Roger
----------------------------------------------------------------
I have now robustified handling of spaces
in numeric fields.
Try the latest 1.1 tarball.
Roger
----------------------------------------------------------------
What means "robustified handling" in this case?
----------------------------------------------------------------
Well, the first thing is handling the sign
byte (which in the case of space would lead
to peculiar reults).
Further, blindly doing a C construct
of -
intfield = byte - '0'
doesnot lead to good results when byte
is space.
The real problem is that invalid content
(and the standard Cobol defintion thereof)
does not define what shoud happen.
What I have done is to put some hooks in
for space content. This is not strictly correct.
We should have a compile option for this and
extend this completely into the runtime.
Roger
----------------------------------------------------------------
Subject: Using libraries and files in different folders
I have the following files:
-folder a
----myprog.so
----myprog2.so
----myfile.dat
-folder b
----myprog.so
----myprog3.so
----myfile.dat
----myfile2.dat
-folder c
----myfile.dat
----myfile3.dat
----myprog4.so
How can I achieve, that if I do a call 'myprog4' all folders are searched for the library? And how is it possible that myprog4 can use myfile2.dat?
The best solution would be, if everytime I do a call or open a file all folders are searched for the library/file.
----------------------------------------------------------------
Use filename mapping like MF.
eg. assuming directories "a", "b", "c" are under
a root directory "/home" -
For "myprog4" -
export DD_myfile=/home/c/myfile.dat
export DD_myfile2=/home/b/myfile2.dat
export DD_myfile3=/home/c/myfile3.dat
Note the "DD_" prefix in the variable name may be lower case or even omitted -
So "DD_myfile", "dd_myfile" and "myfile" are eqivalent
and the variable name search is done in this order.
I personally prefer the "DD_" variant as this easier to control when checking/listing/sorting the environment.
Roger
----------------------------------------------------------------
OK. So I've to have a look myself where the files are (no possibility for having looked for the file in directory A, B, C, D and the first folder where the file is would be used), right?
How can I call myprog4 from myprog3? Only by setting environment PATH to A:B:C:D:PATH? In this case all directories are searched for the programs. Is it possible to implement such stuff for the files, too?
----------------------------------------------------------------
1) OC uses the environment variable COB_LIBRARY_PATH
to locate modules :-).
2) Although MF offer this, I have been caught out by this
at a customer site.
Either you know where the file is or not.
This "well it might be here or there" cost the customer 2 days of my time to diagnose.
Note that with MF when creating the file only the first
path is used :-)
No, I do not want to get into this scenario.
This can be perfectly handled in the environment.
Roger
----------------------------------------------------------------
Subject: how to pass exit status to OS, and external files
Hi. I have been playing with OpenCOBOL and really enjoy it.
Two questions:
1) How to pass a non-zero return code to the OS? This might be more of a COBOL question; I apologize, as I haven't used COBOL in many years.
2) Accessing external files. It works if I do:
... assign to external "test.in"
but I saw the post on using environment vars. I tried:
... assign to MYFILE
and then in the shell set:
export MYFILE=test.in
but the open fails. What am I missing?
Thanks.
----------------------------------------------------------------
I figured out #2 above after looking in "fileio.c". I needed to make it look like this:
SELECT INFILE ASSIGN to external "MYFILE"
and it worked as advertised.
I would still appreciate help on #1 if you have a suggestion.
----------------------------------------------------------------
Try this:[code]exit program giving/returning zero[/code]
----------------------------------------------------------------
That didn't work, but it was close enough. What did work was:
stop run returning 1.
So now I can detect in my shell script when the COBOL program fails.
Thanks.
----------------------------------------------------------------
There is also the internal register "RETURN-CODE"
(ala. MF).
ie.
MOVE 1 TO RETURN-CODE.
STOP RUN.
Roger
----------------------------------------------------------------
The RETURN-CODE special register can be used to pass a return code to the calling program or operating system (or shell) when the current Cobol program ends.
The RETURN-CODE special register has the implicit definition:
77 RETURN-CODE GLOBAL PICTURE S9(04) USAGE BINARY VALUE ZERO.
(Part of Cobol Reference Manual, IBM 2006)
Jean-Michel
----------------------------------------------------------------
Almost right :-)
It's actually -
77 RETURN-CODE PIC S9(08) COMP-5 VALUE 0.
(Alternatively in 2002 syntax -
77 RETURN-CODE USAGE BINARY-LONG SIGNED VALUE 0.)
ie. It is a machine endian 4 byte signed integer.
Also it is not GLOBAL. It is per program.
Roger
----------------------------------------------------------------
Subject: SPLIT KEYS & UNLOCK
Hello everybody,
I was wondering if there was a way to use split keys?
When inspecting the source code and fileio.c, it seems that this would be very difficult; am I wrong?
I also need to support UNLOCK. As from V1.1, this seems rather simple (a LOT of difference from 0.33, kudos!!!). Is there an ongoing implementation? If not I am willing to do it. What would be the preferred way:
- Add a member to cob_fileio_funcs
- Or a kludge: add COB_READ_UNLOCK = 0x200, and emit a read(f, COB_READ_UNLOCK)
Thanks for the hard work,
Michel
----------------------------------------------------------------
A preliminary version of UNLOCK is in
the current 1.1 tarball.
What is missing here are the calls for EXTFH users
(Empty WITH_SEQRA_EXTFH/WITH_INDEX_EXTFH idef's).
I cannot put these in without breaking existing
1.0/1.1 EXTFH users. (ie. calls to new external extfh_index_onlock/extfh_seqra_unlock).
This needs to be done post 1.1 release.
Split keys, as you surmise, is somewhat more difficult.
The compiler/parser part should not be too difficult
(with the exception of handling the pseudo reference/field
composing the composite key).
The runtime is harder.
Firstly we should, if possible, not change any fileio
structures (because of EXTFH compatibility). To this extent, I am looking at reusing "linptr" in the structure.
This is only used for LINAGE and can never be set for ISAM.
The current 1.1 tarball contains some moves in this direction to cast this pointer for linage use. Eventually this can be renamed to something like "linorkeyptr" and defined as "void *" so that we can use it for split keys.
As to the actual implementation, C-ISAM/D-ISAM/VBISAM all
have native support for split keys. For BDB, we would have to code it ourselves.
Roger
----------------------------------------------------------------
Subject: moving foreward
I've been trying to get a collection of COBOL programs re-hosted onto a PC architecture. It is with great interest that I am following this program. It seems the best effort so far. Even the paid for systems are lacking. Not only are they lacking technically they are ridiculous in their pricing model.
I realize this program is largely, if not completely, a volunteer effort. Most of us have day jobs and working on a program as complicated as a COBOL compiler must fit in with everything else.
From this person, thank you. The compiler is a great piece of work and will solve a lot of problems for those of us porting and maintaining large COBOL based systems.
One favor - can someone offer any insight on the plans for implementation? What features are coming and what will not be.
If there is a hint of time frame it would be most appreciated.
Mike
----------------------------------------------------------------
Well, that person is currently me :-)
Thanks.
As you rightly surmise, this is an
"outside of job" effort.
With 1.0/1.1, we are pretty near the 85 standard
with a couple of exceptions (not including
the, as optional defined, standard features).
(No, I will not state what they are :-), nobody
until yet has come across them).
Over and above the 85 standard, we have several MF/ACU and 2002 extensions (eg. 2002 FUNCTION's and several MF/ACU specific library calls).
Also, much to my disgust, I had to implement several
parser variations for ported MF code.
As to where we are going, this is somewhat dependent
on my local TODO list.
If you have a particular request, you can add it to the
thread "OpenCOBOL 1.1 wishlist".
Roger
----------------------------------------------------------------
I must say you've done a great job. I built a compiler ages ago; PL/M compiler written in Fortran running on a Honeywell computer generating code for the 8085 so I appreciate the complexity of your effort compiling COBOL. No mean feat!
Two questions if I may; do you plan to handle the SCREEN SECTION? Also, where can I get the latest tarball? I am running on the latest Linux kernel. The distribution varies, now using Fedora 9.
Mike
----------------------------------------------------------------
The latest tarball is always the link at the left
side of this page under "Download", "OpenCOBOL 1.1 prerelease".
The direct link is -
http://www.sim-basis.de/open-cobol-1.1.tar.gz
SCREEN SECTION -
Most of the syntax side is done which means
that you should be able to compile.
What is missing is a good portion of the runtime.
DISPLAY mostly works. ACCEPT is virtually non-existent.
I will be looking at this over the next couple of weeks.
Roger
----------------------------------------------------------------
Thanks Roger.
I will work on build/test every time I see a new tarball.
Thanks!
Mike
----------------------------------------------------------------
One problem is the notification of updates.
We do not have anything in place for this.
The pre-release tarball is anyway provided as
a courtesy by me such that it gets exposure.
I regularly update this with current development/fixes.
Usually, you can download late Sunday evening/early Monday morning (Middle European Time)to get (I hope) a fairly well tested tarball.
Roger
----------------------------------------------------------------
Roger, I've told you that this would be no problem, if we would make a new category "experimental builds" in sourceforge and upload every build with your internal revision number, similar to that what winmerge does. You caqn found this example at http://sourceforge.net/project/showfiles.php?group_id=13216&package_id=92246
. If we would do it like this
a) there could be a short note what was done in that tarball
b) we would have a nice rss-feed for newer versions
c) we would have stats and could see how often you do this good work of providing these and see how often the tarballs are downloaded
----------------------------------------------------------------
And I repeat that the tarball is
immediately available.
Not like SF. You must put it
in a staging area which maybe updated
sometime when.
The problem is automating to SF.
Roger
----------------------------------------------------------------
Here, with either a modem or
a slow DSl, then you can wait till
something happens. I put a request to
SF to think about slow connections.
However thay seem to think that everybody
has a fat pipe.
Geez.
Tried it recentally?
Roger
----------------------------------------------------------------
I do only uploads via svn to sf, this is quite fast (with a "fat pipe").
----------------------------------------------------------------
Even taking into account the delay, one of the
problems is a SF download. If you are clever enough
then, sure, you can bypass going http. BUT, the
only SAFE link is to the SF download which leads you
into the SF http hell.
Ever tried using SF with a P2 (Pentium II) with 256KB
mem and W2K? I would suggest that all SF developers be forced to do this. (And, yes, One of my boxen does have this here)
Roger
----------------------------------------------------------------
SF is getting slower and slower and needs more and more time to load, this is true and a good point.
But to have these features for "fat pipes and pc" is maybe better to do not have it for anyone?
Maybe we can bypass this if we put the tarball to a new svn folder as a download page, there we would have an upload time and a short description what was changed, you could upload the file via some fast svn-client, downloads would be available through svn-download or via http://open-cobol.svn.sourceforge.net/viewvc/open-cobol/tarballs (for example).
CVS seems to be too slow for packed tarballs (does this make a difference?).
Or we would just make an anouncement section on this website what was changed in the current tarball and let some script generate an rss-feed of this section.
If this is not possible on this version of the system I may could help you update this xoops and board installation, there should be a rss-generation available now.
What do you think about these points?
----------------------------------------------------------------
Keisuke is looking at an alternative.
As I said, the pre-release is put
as a coutesy from me. Otherwise
you would have to build from source.
The link is somewhat confusing agreed,
however it leads to the current tarball.
Tarballs are nice -
For (Posix systems, including Cygwin) -
wget http://www.sim-basis.de/open-cobol-1.1.tar.gz
Push/Pull as I do.
Roger
----------------------------------------------------------------
Subject: Manuals and Docs
Hello,
Is there a blurb anywhere that discusses the documentation plans. Unless I missed something, the Wiki UserManual page is a little shy of details. :)
I can't offer to write an entire book or anything grand, but if you need help, I can probably find spare time to write up a chapter or two. I've only barely wet my toes but this system is definitely worthy of support, and thanks for that.
Cheers,
Brian Tiffin
----------------------------------------------------------------
Yes, indeed, doc is what we are lacking.
The question is what should we document?
The whole COBOL standard as per OC?
Hmmm.
The COBOL-2002 standard runs to 900+ pages.
Remember that this is ONLY the syntax.
NOT specific implementations.
I think that we do not need to document COBOL syntax
except where it differs from the standard/MF/ACU/mainframe.
I am looking at providing a simple GETGOING document
to aid in simple usage.
Further stuff can/should be added to the texi/* files.
Roger
----------------------------------------------------------------
Well, I try and not promise time to efforts that I may not be able to deliver on, but I sometimes do. :-( :-)
Do you have anything that comes up as faqs that a few lines of documentation could save you time from repeatedly answering?
Maybe as a first cut, I'll try writing up something for the interface to libcob (from scanning through libcob/system.def and documenting what I learn as I figure them out). Bear's help and pointing out C$SLEEP made me curious to try out the other library calls.
[i]And here is where I open my mouth and maybe promise too much[/i] but I think a usage document that describes, in a few words or samples, the reserved words and notes on OpenCOBOL's implementation would be handy for new users.
I'll admit; I'm rusty in COBOL so I'd like to keep expectations low for now, but this system is great and worthy of some volunteer time. Go ahead and post a tech writer request for anything (simple to figure out at this stage) that you feel will save you time for the important coding bits. I do look forward to plumbing the depths of OC 1.0/1.1.
Cheers
----------------------------------------------------------------
Hope you don't mind Roger; but I updated the Install Guide wiki entry. Added a note about bash path cache to the bottom. Go ahead and change it (or dump it) as you see fit.
Just FYI; my first make pass for 1.1 worked great, but
$ cobc -V
kept coming back with 1.0.
$ strace cobc -V
displayed 1.1,
$ which cobc
showed /usr/local/bin. I was confused and confounded for a few minutes. Then I remembered to
$ hash -r
to reset the path cache. This will rarely happen, (first time [i]make install[/i] when a pre-compiled package is installed and cobc has been executed out of /usr/bin within the same bash console session).
Cheers
----------------------------------------------------------------
Haa Hash and everything :-)
That's Posix!
Not having looked at the changes,
have you done compatible Cygwin/MinGW checks?
Roger
----------------------------------------------------------------
I just tried it on my Cygwin setup. Same issue, but a rarer case for first time builders, as they would have had to mv a previous build to /usr/bin. I'll assume that brand of sophisticated user is less likely to get caught with the dual binary and the path cache problem.
And nothing really to do with OC in particular. But, first time builders are the ones that don't need any extra complications. (He said, having been one recently) :)
So it is more a gotcha warning than anything.
Cheers
----------------------------------------------------------------
Btiffin,
I've been following your posts the past couple of days. I'd be interested in working with you on the documentation process.
Roger, Good work as always on OC and thanks for the job you and your team are doing. I do understand what you are saying about just what should be documented since we do have the standards. So with that in mind I'll give my thoughts.
I think we probably have a few different types of folks trying to use OC.
1. COBOL Programmers that are still active.
2. COBOL Programmers like me and Btiffin that haven't used it in a while.
3. Folks new entirely to COBOL.
Also of course there are different reasons for using OC. Some might want to convert existing COBOL programs to a FOSS alernative. Others (like me) want to start using it on new projects. Perhaps some want to learn about it, or have to for school.
Since I am very rusty it took me a while to get going again. Finally I picked up Sams Teach Yourself Cobol in 24 Hours. Yes I know...ugh..but it's getting me going on the syntax again at least. Each couple of weeks I'll pick up another book. Was thinking of Murach's (looking for comments or suggestions please from anyone).
Of course some of the code in the books doesn't quite work. But I'll worry about that eventually.
In any case, Free Software I think (as has been said) needs Free Documentation. A first step would be to point folks to where we can find the standard. I've searched google but so far can only find such on ANSI's site. It's been a while since I looked and it seemed quite expensive.
Having a tutorial or videos would be very useful for refreshers for those who have used COBOL and as basic training for those who havent. Essentially something additional beyond the get started we have now.
So if you're willing to have some help Btiffin, and if you're ok with us putting our heads together on this Roger, I'd like to volunteer myself. Of course having your direction would be beneficial to make sure we meet your expections.
Kind Regards.
----------------------------------------------------------------
Got the standard, think this is the right one:
http://webstore.ansi.org/RecordDetail.aspx?sku=INCITS%2fISO%2fIEC+1989-2002
Well it's the 1989 - 2002 standard, not the 1985 one.
----------------------------------------------------------------
aoirthoir;
This all sounds great!
I've been focusing my relearning efforts on the parts of COBOL in OpenCOBOL that weren't around in the early 80's. Lots and Lots. Once I get my head round, and feel a deep enough understanding to try and explain things, I want to add a callable library "chapter" and an intrinsic function chapter to the open-cobol.texi file.
I'll be honest, I could be many weeks getting my head round. ;)
I agree about the need for three classes of documentation (or at the least, the writers keeping in mind the three different potential target audiences). And from the few days I've been playing so far, OpenCOBOL is exceeding my expectations on supported features. Lots to learn.
In the meanwhile, I want to start an OpenCOBOL Open Copylib sample and example source code repository.
Being new, I always feel a little shy starting into a volunteer effort, not wanting to rock anyone's boat, and not feeling grounded enough in regards to the overall group feelings about things, so I'll usually be unaggressive and wait for the nod from someone else before proceeding too far.
[b]Next questions[/b]; what do the readers of the OpenCOBOL forum feel would be a worthwhile repository? Small standalone programs highlighting 1 or 2 items? Source code suitable for COPY and a template usage spec? Both types mixed in one? Separated?
Do you have any suggested names for such a repository? OCOCl? [i]OpenCOBOL OpenCopylib[/i] for instance.
Would it be worthwhile having an OpenCOBOL management application to go along with this/these libraries?
Or has such an effort been started and I simply haven't read enough back posts to the forum or mailinglist?
Thanks again aoirthoir; OpenCOBOL deserves a level of documentation that matches the level of the product. High bar that.
Cheers
Brian
----------------------------------------------------------------
Btiffin,
All of that sounds great also. Maybe we can collaborate on IRC or phone somehow (assuming you are in the states) for more real time work. I'm in the same process of learning COBOL again as well. We were on the 72? standard when I coded, though it was already 87 by the time I started. And yes COBOL had already been..ahem "dead" at that time also.
So learning together would be excellent. I am of the mind that real projects help people learn. When I started working for the company that taught me COBOL, I knew nothing about it or programming. One of the employees was instructed to teach me and he gave me a "how many gallons of paint will it take to paint this wall" program to code. And kept me on it for two weeks. Finally I told my boss to just give me something real to test. He did and I learned.
So for the learning efforts real projects that we are interested in will help. If we need tools to work with OC, the more we code them in OC the better off we will be. Myself, I will be using OC to create my BLOG, a code generator for COBOL, MySQL and PHP. A blog is more in line with a new user, rather than a code generator. So if we could come up with similar type projects and go from there, that's just one suggestion.
Also regarding your copylib question, I think having both apps and copylibs would be best. The 2002 standard implements User Defined Functions. I don't know if OC 1 has that as part of the "some of 2002" or not. If not I hope it moves in that direction. Frankly, I would rather see things like UDF's and SQL connections rather than Object Oriented implementations. Nevertheless if OC does implement UDFs, having many as part of a COPYLIB library would definitely improve OCs uptake for the younger programmers.
Myself, any libraries or programs I contribute, I'd want to be released under the GNU GPL. But I think we are already on the same page there.
----------------------------------------------------------------
aoirthoir;
I'm in Canada; Ottawa. New York timezone.
Today, as part of my self teaching, I'm attempting to call libcurl from OC 1.1 and if I can work it out, I'll be trying to setup general libcurl bindings.
OpenCOBOL sure is fun to work with. ;)
Cheers
----------------------------------------------------------------
I'm interested in your success. I've been thinking, since OC has an attachment to C libraries capability, that it should be possible to use the MySQL libraries to interface with OC. The problem is that I know no C whatsoever. It's moved up in priority on my list.
----------------------------------------------------------------
aoirthoir;
I haven't got to that part yet, but OC has linkage to Berkeley DB already. Not SQL, but a powerful database in its own right.
And yes, bindings to MySQL should be quite possible. But let Roger do all the hard work and go with BDB. :)
Cheers
----------------------------------------------------------------
aoirthoir et al;
In tandem with producing more User Guide and Reference material, I was pondering starting the OpenCOBOL FAQ.
If no one objects too loudly, the initial plan is to use Python's docutils ReStructedText. I find it powerful enough while keeping the raw sources very readable.
First task will be to troll through the mailing list and this forum for all the tidbits of information scattered about.
If anyone has pointers to what should be included (or information on previous attempts or hints on where to look for gems) please feel free to post ideas here.
Cheers
----------------------------------------------------------------
Btiffin,
I forgot to mention that I am in Cleveland, Ohio, so I am in eastern time zone as well.
I think you and I are on the same track. I tried to make a bash script using wget to download all of the forum posts so that I can peruse them when I have no internet connection (certain coffee houses around here still dont have wifi). But in any case I agree with you that going through the forums would be very useful, as would having an FAQ.
One interesting note about the standard, is that it actually requires documentation from the Cobol vendor. Of course this is a FOSS project. But I think having documentation that meets the standards requirement, would allow OC to gain a foothold.
So we should start collaborating together and decide a format for the docs, so that we can just start adding as needed. Or maybe assign one part here and there to ourselves. Though I think working together at this stage is more practical. Especially considering my 20 years away from Cobol and thus my lack of skill in it right now.
----------------------------------------------------------------
Re the format. In terms of User Guide and any Refernence Manual, I think we should stick to expanding the existing open-cobol.texi (Texinfo) file.
This can kinda be done as separate pieces here and there, but there will be a little work in merging any files to get the info nodes properly in sync. Given that, we should be able to partition any work, knowing the end-game of merging won't be automated.
On the FAQ, I'd like to proceed with ReST. I like the readability of the source format, it produces skinnable HTML and does a fair job of LaTeX. For this, as long as anyone involved follows something like the PEP standard for section naming, the merge of any pieces will be close to automatic.
And then there is the COPY repository and samples/examples which should be either simple files in a directory structure or perhaps (and I don't know yet if COPY id IN lib works) in OpenCOBOL copylib form.
I just bumped into the /usr/local/share/open-cobol/copy directory today. :) And re the MySQL links, it looks like there is linkage already in OC for the Firebird SQL engine.
Much to learn still.
Cheers
----------------------------------------------------------------
A lot of those I've not worked with, like Rest or Latex.
But if you're willing to point me where you need me to go and what you want me to do, I'll give it a shot.
----------------------------------------------------------------
Don't worry about LaTeX (well it is totally cool and worth knowing. Donald Knuth's TeX engine is "thee" type setting system), as the output emitters for ReST and Texinfo take care of the TeX. LaTeX is my preferred macro set for TeX. Great for writing book quality output and PDFs.
You want to google [i]python docutils[/i] for a pointer to ReStructuredText.
http://docutils.sourceforge.net/
http://docutils.sourceforge.net/rst.html
Very simple readable input, producing nice quality outputs. rst-buildhtml and rst-buildlatex are the two programs that I use (Debian docutils package installs these).
The other thing to google is [i]texinfo[/i].
http://www.gnu.org/software/texinfo/
http://www.gnu.org/software/texinfo/manual/texinfo/
Produces TeX and Info output from single sources. See the tarball /texi/ dir for the current open-cobol.texi file. info is the GNU preferred online doc format. I can't say I'm a fan, but if you like emacs (I chose vi a long time ago) texinfo will fit right in. There will be manual operations involved in getting the hyperlinks and menus setup properly if there are split pieces of text to merge. Not a biggy.
Cheers
----------------------------------------------------------------
Note the proposed 2008 standard is (currently) freely available at -
http://www.cobolstandard.info/j4/files/std.zip
Roger
----------------------------------------------------------------
From aoirthoir's snip
[quote]
One interesting note about the standard, is that it actually requires documentation from the Cobol vendor. Of course this is a FOSS project. But I think having documentation that meets the standards requirement, would allow OC to gain a foothold.
[/quote]
And Roger's
[quote]
Note the proposed 2008 standard is (currently) freely available at -
[/quote]
So I was thinking about taking a kick at filling in requirements for the documentation parts of [i]an implementation shall provide ...[/i]
Of course what I've read being 2008 standard text, but I can only assume an 85 or 02 document would have similar requirements (with different details).
So, Roger (or Keisuke if you ever read here), do you have any burning desire to get an accredited '85 stamp (slower more prodding writing effort) or would it be better to write this up with a target audience of friendly developers and "just so you know"?
Cheers,
Brian
----------------------------------------------------------------
[quote]
Yes, indeed, doc is what we are lacking.
The question is what should we document?
The whole COBOL standard as per OC?
Hmmm.
The COBOL-2002 standard runs to 900+ pages.
Remember that this is ONLY the syntax.
NOT specific implementations.
I think that we do not need to document COBOL syntax
except where it differs from the standard/MF/ACU/mainframe.
I am looking at providing a simple GETGOING document
to aid in simple usage.
Further stuff can/should be added to the texi/* files.
Roger
[/quote]
Roger, Not sure how you feel, I think that Brian is definitely on the right track.
Regarding just what should be implemented, I know it's a big undertaking, ultimately though I think that the Open Cobol initiative should be a one stop shop for everything open cobol. Now this might mean a couple of websites as we've been talking about on other forum topics. But what I mean is that when the documentation is done (are docs ever done?) that a user of OC should be able to find everything they need to use OC right in the OC docs without having to resort to looking up other works.
Of course having access to the standards docs helps. And having other cobol books with suggest this or that way of doing things would be beneficial as well. Even other code samples that arent provided by us. But basically I would like to see an OC user be able to just use our stuff and be able to hit it running.
This is a pretty large undertaking of course. And it is something that is not going to be done over night.
----------------------------------------------------------------
Brian,
I don't know how they feel and the direction they are taking OC....this is my thought if they care for it..
So far none of the COBOL compilers fully implements the 2002 standard. I also doubt that they will implement the 2008 standard. If Roger and Keisuke are moving towards implementing more and more of it, then OC could be the most modern COBOL compiler. I think along with that, it requires modern documentation, to the latest standard.
----------------------------------------------------------------
Subject: Open COBOL 1.1 alert
The current tarball has a problem
with ALTERNATE KEYS.
I am trying to track this.
Unless you are using ALTERNATE KEYS,
then this should not affect you.
(Bear, this does not affect your tests)
Roger
----------------------------------------------------------------
OK. Alert over.
Problem fixed.
Current 1.1 tarball is fine.
Roger
----------------------------------------------------------------
Subject: Rusty; questions and a seg fault
Hello ladies and gentlemen,
I'm rusty in COBOL and the farther I get the rustier I feel.
Below is some code I'm playing with to show some younger folk the beauty of COBOL. It has to do with an all language exercise dealing with getting a line of input and then outputting each character with a beep and a one second delay.
[code]
* Beeper.cob for compsci.ca exercise
** Read a line of user input, display each character with a
** 1 second delay and a beep.
IDENTIFICATION DIVISION.
PROGRAM-ID. beeper IS INITIAL.
AUTHOR. Brian Tiffin.
DATE-WRITTEN. 11-June-2008.
DATE-COMPILED.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 USER-DATA PIC X(80) VALUE SPACES.
01 CHAR-COUNT PIC 99 VALUE ZEROES.
01 CHAR-INDEX PIC 99 VALUE ZEROES.
*HHMMSSss where ss is 100ths of a second
01 CURRENT-TIME.
02 FILLER PIC 9999.
02 CURRENT-SSSS PIC 9999.
* 03 CURRENT-SS PIC 99.
* 03 FILLER PIC 99.
01 LAST-TIME.
02 FILLER PIC 9999.
02 LAST-SSSS PIC 9999.
PROCEDURE DIVISION.
DISPLAY ": " WITH NO ADVANCING.
ACCEPT USER-DATA.
* get the user input length by scanning back for non space
PERFORM VARYING CHAR-COUNT FROM 80 BY -1
UNTIL USER-DATA(CHAR-COUNT:1) NOT = SPACE
END-PERFORM
* output each character with a beep and then pause
PERFORM VARYING CHAR-INDEX FROM 1 BY 1
UNTIL CHAR-INDEX > CHAR-COUNT
DISPLAY USER-DATA(CHAR-INDEX:1) WITH BELL
ACCEPT LAST-TIME FROM TIME
MOVE LAST-TIME TO CURRENT-TIME
PERFORM HACK-DELAY
UNTIL CURRENT-SSSS > LAST-SSSS + 100
END-PERFORM
STOP RUN.
* Hack of a delay procedure due to lack of docs and dumbness
HACK-DELAY.
ACCEPT CURRENT-TIME FROM TIME.
* IF CURRENT-SSSS >= 5900 THEN
* MOVE 60 TO CURRENT-SS.
[/code]
Item 1; for Roger
This works, but if I remove the comments on CURRENT-SS and the FILLER (and the PIC clause from CURRENT-SSSS) I get a segmentation fault during
cobc -x beeper.cob
Excuse the rusty COBOL, but I want the hack delay to account for the 59 to 00 second rollover.
Debian GNU/Linux 4, GCC 4.2.4, OC 1.1 tarball dl'ed 07-Jun-2008
Item 2; for anyone
Is there a better way of doing a one second delay in OC?
Item 3; DISPLAY and WITH; how do I add a NO ADVANCING clause along with the WITH BELL. Again it's been 20 years since I worked in COBOL and it seems that things have changed a little - my brain for one.
Cheers
Edit; added that the seg fault is during cobc.
----------------------------------------------------------------
Hello,
I played a bit with your program, so I suppressed some lines and added some others.
My tarball :
$ cobc -V
cobc (OpenCOBOL) 1.1.0 Build date Jun 11 2008 21:26:59
Copyright (C) 2001-2008 Keisuke Nishida / Roger While
This is the result :
[code]
* Beeper.cob for compsci.ca exercise
** Read a line of user input, display each character with a
** 1 second delay and a beep.
IDENTIFICATION DIVISION.
PROGRAM-ID. beeper IS INITIAL.
AUTHOR. Brian Tiffin & Bear.
DATE-WRITTEN. 11-June-2008.
DATE-COMPILED.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 USER-DATA PIC X(80) VALUE SPACES.
01 CHAR-COUNT PIC 99 VALUE ZEROES.
01 CHAR-INDEX PIC 99 VALUE ZEROES.
PROCEDURE DIVISION.
begin.
display space
with foreground-color 3
background-color 1
blank screen
end-display
DISPLAY ": " WITH NO ADVANCING.
ACCEPT USER-DATA.
*> get the user input length by scanning back for non space
PERFORM VARYING CHAR-COUNT FROM 80 BY -1 UNTIL USER-DATA(CHAR-COUNT:1) NOT = SPACE
END-PERFORM
*> output each character with a beep and then pause
PERFORM VARYING CHAR-INDEX FROM 1 BY 1 UNTIL CHAR-INDEX > CHAR-COUNT
DISPLAY USER-DATA(CHAR-INDEX:1)
line 3 column char-index WITH BELL
end-display
call "C$SLEEP" using "1" *> This is the way to do a 1 second delay
END-PERFORM
.
EXIT PROGRAM.
[/code]
This is one way to solve your problems ...
I hope you'll enjoy.
Bear
----------------------------------------------------------------
I did enjoy. Thanks Bear.
Posted a FIXED form version to the other board, just to add a little history lesson.
Cheers
----------------------------------------------------------------
Yes, Bears version is fine.
Re. the segfault.
Yes, I have fixed this in current 1.1 tarball.
The problem is that then you are comparing
a group item which is implicitly alphanumeric
(PIC X(n)) against a numeric literal.
The standards are unclear on this point.
I will see if I can clarify this.
Now, having said I fixed this, I believe there
are some other corner cases that we are not checking.
So, this goes onto my TODO list.
Roger
----------------------------------------------------------------
Subject: Ring my bell ... ...and other features of DISPLAY/ACCEPT
Hello,
I answered recently btiffin's post about the BELL feature in DISPLAY statement. So I found out something I would like to submit in followin lines :
[code]
identification division.
program-id. CLOCHE.
*>
*> This program was written in order to test
*> the DISPLAY statement and BELL / BEEP features
*>
procedure division.
begin.
display "Do You Hear My Bell ? ..." with bell
call "C$SLEEP" using "1"
display "....I guess no ..."
call "C$SLEEP" using "1"
display "And now ? "
line 05 column 38
with bell
end-display
display "I guess YES"
line 07 column 38
end-display
call "C$SLEEP" using "1"
.
fin.
exit program.
[/code]
It beeps only when line/column is specified ?.
Best regards
Bear
----------------------------------------------------------------
He-he :-)
I am ahead of you :-)
I noticed that as well.
Fixed in current 1.1 tarball.
(As should be the segfault from btiffin)
Roger
----------------------------------------------------------------
This is why you are the "CHEF" of our Cobol cuisine !
:-D
Respect
Bear
----------------------------------------------------------------
:-)
And, of course, a few lines of example code
to reproduce any problem are worth any amount of discussion.
Thanks, Bear, for always providing sample code.
*****
NOTE to all others -
Please provide sample code for any problem
*****
Just so long as you do NOT expect the
ACCEPT to work as it should absolutely immediately :-)
Yes, I am looking at it. Maybe have
some code ready over the weekend.
(For the technically minded, in libcob/screenio.c, we
have to work with curses getch() and interpret input
accordingly. Applies to SCREEN and MF ACCEPT.
This will also allow function-key returns,screen positioning (for SCREEN) and correctly filling CRT STATUS and CURSOR fields)
Roger
----------------------------------------------------------------
Of course, Bear, that does not mean that you cannot post
a prog with ACCEPT that does not do what it should :-)
Please do so :-)
That saves me a lot of time as this screen stuff is something that cannot be autochecked in the "make check".
Roger
----------------------------------------------------------------
Thank you Roger,
I'm really glad to participate as a testing end-user programmer.
So I noticed that PROMPT, UPDATE gives errors when compiling and AUTO stops at end of field and SECURE displays what is entered via the keyboard.
I wrote a little program to show you that.
[code]
identification division.
program-id. FIELDS.
*>
*> This program was written in order to test
*> the ACCEPT statement in color environment
*> + other features
*>
data division.
working-storage section.
77 I pic 99.
77 J pic 99.
77 K pic 99.
77 L pic 99.
77 w pic X(010).
procedure division.
begin.
perform varying I from 0 by 1 until I > 7
display SPACE
with foreground-color I
background-color I
BLANK SCREEN
end-display
perform varying J from 0 by 1 until J > 7
add 2 J giving L
add 1 J giving K
evaluate J
when 7
accept w line L column 5 with
foreground-color J
background-color I
highlight
auto
end-accept
when other
accept w line L column 5 with
foreground-color J
background-color I
highlight
*> prompt
end-accept
end-evaluate
end-perform
end-perform
.
fin.
exit program.
[/code]
So Roger I will continue until you stop me :-)
Best Regards
Bear
----------------------------------------------------------------
I need to change everything as regards
curses.
Stand by.
Roger
----------------------------------------------------------------
Incidentally, that is a good prog :-)
Problem is that your usage is NOT
standard. Well, we know that you are trying
to do what MF does.
(Geez)
(Just reply - no real problems)
Roger
----------------------------------------------------------------
I found this :
http://supportline.microfocus.com/documentation/books/sx22sp1/lrpubb.htm
And I try to make the "format 5" work. Seems very close to what I use.
I must tell you that I'm a bit lost when talk about standard. :-(
In any case, single field management has much in common with screen section. We need to know when a key was pressed, for example Esc, F1,...F9, arrows, etc ...
Best Regards
Bear
----------------------------------------------------------------
Yep, however the 85 and 2002 standards cost money.
But proposed 2008 is at -
http://www.cobolstandard.info/wg4/open/WD1-10-pdf.zip
Somewhat (regarding 85/2002) can be intuited from this.
And the MF/ACU docs are online.
Roger
----------------------------------------------------------------
OK. Bear, use this download -
http://www.sim-basis.de/develop/open-cobol-1.1.tar.gz
This is just a proof of concept.
It breaks the SCREEN SECTION totally.
For all other users, this download is high
risk that is not even guaranteed to compile :-)
In other words, this is for Bear only :-)
For simple ACCEPT, it should do PROMPT, SECURE,
AUTO.
Interesting, I am about to follow up on the syntax
for PROMPT with MF.
It states in the doc (current for all versions) that
on the ACCEPT clause and PROMPT, then the CHARACTER clause is optional. (Note that the CHARACTER is optional).
That cannot be. You would be left with a "literal" which
is a valid display field.
It would not be parsable even under the ridiculous MF relaxed constraints. Will check.
In the meantime, I have decided to delete the optional
CHARACTER clause as related to PROMPT from OC.
If we eventually need some other means to define this,
then no problem.
Roger
----------------------------------------------------------------
Also, for the aforemetioned download, then
we update CURSOR and CRT STATUS if defined.
eg.
CONFIGURATION SECTION.
SPECIAL-NAMES.
CURSOR IS CRTPOS
CRT STATUS IS CRTSTAT
.
Bear, you might want to include this in your test
progs.
Roger
----------------------------------------------------------------
Roger You astonished me !
I downloaded the link you've given, and tested in a hurry !
This is the source I used to detect some features (update, prompt).
[code]
identification division.
program-id. FIELDS.
*>
*> This program was written in order to test
*> the ACCEPT statement in color environment
*> + other features.
*> Strategic lines are commented.
*>
data division.
working-storage section.
77 I pic 99.
77 J pic 99.
77 K pic 99.
77 L pic 99.
77 w pic X(010).
procedure division.
begin.
perform varying I from 0 by 1 until I > 7
display SPACE
with foreground-color I
background-color I
BLANK SCREEN
end-display
perform varying J from 0 by 1 until J > 7
add 2 J giving L
add 1 J giving K
evaluate J
when 7
move "Last Line" to w *> Filling the field before accept
accept w line L column 5 with *> 'Last Line' must appear in the field
foreground-color J *> Corrections must be allowed at least
background-color I *> with backspace
highlight *>
update *>
reverse-video *> Works Fine & Really reverses the video
end-accept
when other
accept w line L column 5 with *> field w must contain characters
foreground-color J *> of the sequence typed or
background-color I *> space if nothing has been entered
highlight *> At least backspace must be allowed
prompt auto secure *>
end-accept *>
display w line L column 20 with *> I display to what I entered
foreground-color J *>
background-color I *>
highlight *>
bell *> this is only for making "music" :-)
end-display
end-evaluate
end-perform
end-perform
.
fin.
exit program.
[/code]
I hope it will help you to play some more ...
Respect
Bear
----------------------------------------------------------------
Another test with DISPLAY BLANK LINE
[code]
identification division.
program-id. BLANKS.
*>
*> This program has been written in order to test
*> the DISPLAY statement and BLANK SCREEN, BLANK LINE,
*> ERASE EOS & EOL options
*>
DATA DIVISION.
WORKING-STORAGE SECTION.
77 w80 pic X(080).
77 I pic 99.
77 J pic 99.
77 K pic 99.
77 L pic 99.
PROCEDURE DIVISION.
BEGIN.
perform varying I from 0 by 1 until I > 7
display space
with foreground-color 0
background-color I
blank screen
end-display
call "C$SLEEP" using "1"
perform varying J from 0 by 1 until J > 7
display "Here comes EOS"
line 03 column 03
with foreground-color 0
background-color J
erase EOS
end-display
perform varying K from 0 by 1 until K > 7
add 5 K giving L
display "Here comes EOL" line L column 05
with foreground-color 0
background-color K
erase EOL
end-display
add 15 K giving L
display "Here comes BLANK LINE" line L column 30
with foreground-color 0
background-color K
BLANK LINE
end-display
end-perform
call "C$SLEEP" using "1"
end-perform
end-perform
.
fin.
EXIT PROGRAM.
[/code]
BLANK LINE reasonably must blank the whole line, and that's not what is done.
Best regards
Bear
----------------------------------------------------------------
OK. New tarball up at the address as above.
Covers the last posts plus adds in support
for back space, cursor key left/right.
Roger
----------------------------------------------------------------
In the mean time I have started to sort out the
SCREEN SECTION. So, now both tarballs are
the same.
Bear, if I need to check something with you, then
I will point you to the "develop" download.
Roger
----------------------------------------------------------------
Thank you Roger !
I tested all the "BLANKS" program, and added a bit "HIGHLIGHT" so it make this program more colorful. ;-)
[code]
identification division.
program-id. BLANKS.
*>
*> This program has been written in order to test
*> the DISPLAY statement and BLANK SCREEN, BLANK LINE,
*> ERASE EOS & EOL options
*>
DATA DIVISION.
WORKING-STORAGE SECTION.
77 w80 pic X(080).
77 I pic 99.
77 J pic 99.
77 K pic 99.
77 L pic 99.
PROCEDURE DIVISION.
BEGIN.
perform varying I from 0 by 1 until I > 7
display space
with foreground-color I
background-color I
blank screen
end-display
call "C$SLEEP" using "1"
perform varying J from 0 by 1 until J > 7
display "Here comes EOS"
line 03 column 03
with foreground-color J
background-color J
highlight
erase EOS
end-display
perform varying K from 0 by 1 until K > 7
add 5 K giving L
display "Here comes EOL" line L column 05
with foreground-color K
background-color K
highlight
erase EOL
end-display
add 15 K giving L
display "Here comes BLANK LINE" line L column 30
with foreground-color K
background-color K
highlight
BLANK LINE
end-display
end-perform
call "C$SLEEP" using "1"
end-perform
end-perform
.
fin.
EXIT PROGRAM.
[/code]
Locally I will add some blinks to see what happens.
:-D
For accept statements, when PROMPT is used and nothing typed, the field must be loaded with SPACE or 0 (ZERO) according to the PICTURE.
when UPDATE is used, the DEL character seems to be ineffective, and BACKSPACE does not work on the last position of the field (the rightest).
Reasonably HOME has to put the cursor at the beginning of the field and END at its latest position.
Anyway, very good job, Roger.
I will take a look on screenio.* to get ideas for tests.
I suppose function keys (F1, F2, ... ESC, arrows) will come further.
Do we need to open a new post for function keys .
Very Best Regars
Bear
----------------------------------------------------------------
F-Keys are reported if the CRT STATUS is
defined (as said in previous post).
I am looking at defining internal fields when
(CRT STATUS and/or CURSOR are not defined)
if it can be determined that, in this compilation unit, that
some screen I/O is done.
Re: Loading with space, I will check what happens with MF.
HOME/END, Yep, coming!
(As is the cursor manipulation between lines
for SCREEN)
Thanks once again for this super support.
Roger
----------------------------------------------------------------
Thank your Roger.
I think I'going to learn something with CRT STATUS. Because I never used it before.
My skeleton of ACCEPT is :
[code]
accept accept_field ...
on exception exception_field *> exception value like ESC goes directly into this integer
not on exception
continue
end-accept
.
*> Here we are out from the accept statement, so we can test different values of exception_field
evaluate ...
end-evaluate
[/code]
With this syntax, no need of special-names .
IF THERE IS ANOTHER WAY TO MANAGE THIS, I WILL ADOPT IT.
Best regards
Bear
----------------------------------------------------------------
OK. New tarball up.
Back space looks like it works. At least it
does what MF does.
HOME/END keys work.
INS/DEL character will have to wait until the weekend.
If the user has not defined an explicit CRT STATUS
item, then an item with name COB-CRT-STATUS will be generated.
This can be tested for non-zero after an ACCEPT.
Zero is normal return. Values 1001 to 1064 correspond
to function keys 1 to 64.
Currently only 0 and the above values are possible. However
other values may possibly be implemented.
The strange 1nnn codes are mandated by the standard.
The standard defines the status as a 4 digit conceptual entity. 0000 is successful return, 1xxx are function keys,
2xxx are context-dependent keys, 8000 and 8001 are field entry failues and 9xxx are implementor-defined conditions.
[NOT] ON EXCEPTION is implemented for ACCEPT. An exception is defined as a non-zero crt status.
I am not sure what you mean about PROMPT. That has
nothing to do with field contents.
Have fun.
Roger
----------------------------------------------------------------
Well Roger, you told me to have fun.
So I wrote this funny program to test CRT STATUS & others ...
I tested it in gnome terminal environment, and as you can imagine, F1 opens terminal help and pressing ESC, F11 or F9 gives same kind of behaviour.
[code]
identification division.
program-id. ROGERS.
*>
*> Specially Built For Accept Statement Playing ;-D
*>
environment division.
configuration section.
source-computer. Debian-Etch.
object-computer. Debian-Etch.
data division.
working-storage section.
01 w pic X(001).
01 funkey pic 9(04).
procedure division.
debut.
display "TESTING Function Keys" *> I'm not shure that this text is really
line 03 columns 33 with *> displayed at the right line/col position
foreground-color 1
background-color 7
blank screen
end-display
.
perform until w = "Q" or "q"
display "Enter something : "
line 10 col 32 with erase eos
foreground-color 1
background-color 7
end-display
accept w
line 10 column 50 with
foreground-color 2
background-color 7
prompt reverse-video auto
on exception
perform except-key
not on exception
perform normal-key
end-accept
end-perform
go to fin.
.
except-key.
move COB-CRT-STATUS to funkey *> Special word
display "Exception Key = "
line 12 column 30
end-display
display funkey line 12 col 46
with foreground-color 7
background-color 4
highlight
end-display
call "C$SLEEP" using "1"
.
normal-key.
move COB-CRT-STATUS to funkey
display "Normal Key = "
line 12 column 30
end-display
display funkey line 12 col 43
with foreground-color 7
background-color 2
highlight
end-display
call "C$SLEEP" using "1"
.
fin.
display "GAME OVER !"
line 24 column 38 with
foreground-color 7
background-color 4
highlight bell
BLANK LINE
end-display
call "C$SLEEP" using "1"
.
ultime.
exit program.
[/code]
I have noticed that Up/Down arrows & PgUp/Down are not detected as exception key.
I tried to play with PuTTy, or Eric's Telnet98 (a fine emulator) with $TERM=ansi. I had some problems in both cases.
I hope you'll play with this little OC toy.
I had fun
Best regards
Bear
----------------------------------------------------------------
Up/Down arrows have no meaning for a single field accept.
They will be necessary when I code up for the real
SCREEN section ACCEPT.
PgUp/Down will never be interpreted They have no
meaning currently. We could conceivably map these
to context-dependent input and use the "2xxx" status
return. However, that is for much later.
PuTTy works fine going to Linux if you set the PuTTy
keyboard to "linux" and set TERM to "linux".
Roger
----------------------------------------------------------------
Thank You Roger for informations about PuTTy context.
Just to tell you if Up/Down arrows have no meaning for a single accept it is helpful inside a SEQUENCE of single accepts, particularly to go back/next to the previous/next (single) accept.
So making them available will be nicer. Do we have access to the ESC ?
Very Best Regards
Bear
----------------------------------------------------------------
I think we can map unusual keys to a 2xxx status
depending on an environment variable. Otherwise, anything
that is not meaningful should be "beeped".
ESC is somewhat special in curses history and in
all termio. It usually signifies the start of
a control sequence. To do this curses sets a timeout when the first character is ESC (Dependent on the curses initialization). So, generally speaking as regards Cobol, no you will never get an ESC.
Roger
----------------------------------------------------------------
Bumping an old post to post questions about extended display / accept:
[quote]OpenCOBOL-FAQ:
External variables that influence screen handling include
COB_SCREEN_EXCEPTIONS=Y
To enable exceptions during ACCEPT.
COB_SCREEN_ESCAPE=Y
To enable handling of the escape key. [/quote]
These must be set at compile time, right?
If I do a accept with foreground-color, it always gets positioned at 0101 and the screen is blanked before.
Therefore the following do not work as expected (Should it?): The first two display lines are missing.
[code] *-----------------------------------------------------------------
IDENTIFICATION DIVISION.
PROGRAM-ID. 'TESTCRT'.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
CRT STATUS IS CRT-STATUS
DECIMAL-POINT IS COMMA.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
DATA DIVISION.
FILE SECTION.
*
WORKING-STORAGE SECTION.
*
77 mychar pic x.
77 crt-status pic 9(04).
copy screenio.
*-----------------------------------------------------------------
LINKAGE SECTION.
*-----------------------------------------------------------------
PROCEDURE DIVISION.
declaratives.
end declaratives.
*-----------------------------------------------------------------
main section.
00.
display "This is my interesting text"
end-display
display "The next one is very important and therefore, "
"colored"
end-display
display "All fine"
with foreground-color cob-color-green
end-display
accept mychar with foreground-color cob-color-red
end-accept
display crt-status end-display
accept mychar
end-accept
*
stop run
*
continue.
ex. exit program.
*-----------------------------------------------------------------
*--- End of program TESTCRT --------------------------------------[/code]
Is there a way to get shortcuts like CTRL+H?
Does somebody has a link to a newer draft?
human
----------------------------------------------------------------
There would be a way for shortcuts with S-Lang. ;) It has support for keymaps and code hooks. I'm not sure if Warren's uber powerful cobcurses project supports hooked key maps or not.
Cheers,
Brian
----------------------------------------------------------------
If we could kick ncurses at all (dependency) and get these things, this could be nice.
This could be a target for OC 1.2, if Roger accepts it and someone codes it.
human
----------------------------------------------------------------
Subject: String lengths
Why does
[code]display length of "£"[/code]
output "2"?
I'm guessing it's a character-set encoding thing - is "£" not in standard 8-bit ASCII?
This code doesn't work either - similar issue?
[code]
IDENTIFICATION DIVISION.
PROGRAM-ID. test.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 wv-variables.
03 field1 pic x(10).
PROCEDURE DIVISION.
a01-control SECTION.
move '£10.00' to field1
display field1
inspect field1
replacing all "£" by "$"
display field1
stop run
.
[/code]
----------------------------------------------------------------
Looks like you have a locale problem.
The pound character is certainly present
in the ISO 8 bit character sets.
On my boxen, I use ISO encoding and not UTF.
Here (after inserting the DISPLAY LENGTH), I get -
roglinux:~ # ./pound
1
£10.00
$10.00
Roger
----------------------------------------------------------------
Subject: another file question
Hello. Is there a way to connect a file to stdin for reading and another file for writing as stdout?
I took a look at cob_file_open() and it doesn't appear that I can. This isn't a must have of course, but it would be nice to be able to do it.
----------------------------------------------------------------
Yes.
We have the MF syntax for this -
SELECT mystdin ASSIGN TO KEYBOARD.
SELECT mystdout ASSIGN TO DISPLAY.
The file type is automatically set to
LINE SEQUENTIAL so you do not need to specify this.
Roger
----------------------------------------------------------------
Subject: SOURCE FORMAT IS FREE - howto?
Hello,
How exactly (if still supported) is the
[code]
SOURCE FORMAT IS FREE
[/code]
directive used?
I found a NEWS entry stating
[code]
>>SOURCE FORMAT IS FREE
[/code]
but that doesn't seem to work. And I'm a little lost reading through ppparse sources. Is DIRECTIVE a literal or a replacement?
I've not been playing with 1.0 for awhile, but I think I had the same problem as I'm having with 1.1
Thanks
Brian Tiffin
----------------------------------------------------------------
Do you mean the compiler option?
[code]
> cobc -h
Usage: cobc [options] file...
Options:
--help Display this message
--version, -V Display compiler version
-v Display the programs invoked by the compiler
-x Build an executable program
-m Build a dynamically loadable module (default)
-std= Compile for a specific dialect :
cobol2002 Cobol 2002
cobol85 Cobol 85
ibm IBM Compatible
mvs MVS Compatible
bs2000 BS2000 Compatible
mf Micro Focus Compatible
default When not specified
See config/default.conf and config/*.conf
-free Use free source format
-fixed Use fixed source format (default)
-O, -O2, -Os Enable optimization
-g Produce debugging information in the output
-debug Enable all run-time error checking
-o Place the output into
-b Combine all input files into a single
dynamically loadable module
-E Preprocess only; do not compile, assemble or link
-C Translation only; convert COBOL to C
-S Compile only; output assembly file
-c Compile and assemble, but do not link
-t Generate and place a program listing into
-I Add to copybook search path
-L Add to library search path
-l Link the library
-D Pass to the C compiler
-conf= User defined dialect configuration - See -std=
--list-reserved Display all reserved words
-save-temps Do not delete intermediate files
-MT Set target file used in dependency list
-MF Place dependency list into
-ext Add default file extension
-Wall Enable all warnings
-Wobsolete Warn if obsolete features are used
-Warchaic Warn if archaic features are used
-Wcolumn-overflow Warn any text after column 72
-Wredefinition Warn redefinition of data items
-Wconstant Warn inconsistent constant
-Wparentheses Warn lacks of parentheses around AND within OR
-Wterminator Warn lacks of scope terminator (END-XXX)
-Wstrict-typing Warn type mismatch strictly
-Wcall-params Warn non 01/77 items for CALL params (NOT set with -Wall)
-Wtruncate Warn possible field truncation (NOT set with -Wall)
-ftrace Include trace code in the output
-fsyntax-only Syntax error checking only; don't emit any output
-fstatic-call Output static function calls for the CALL statement
-fdebugging-line Enable debugging lines
-fsource-location Include source location in the output
-fimplicit-init Do automatic initialization of the Cobol runtime system
-fline-directive Include line directive in the output
-fstatic-linkage Statically allocate non-USING LINKAGE parameters
-fsign-ascii Numeric display sign ASCII (Default on ASCII machines)
-fsign-ebcdic Numeric display sign EBCDIC (Default on EBCDIC machines)
-fstack-check PERFORM stack checking (Turned on by -debug or -g)
-fnotrunc Do not truncate binary fields according to PIC (ala MF)
[/code]
Set either of these (-fixed is default)...
[code]
-free Use free source format
-fixed Use fixed source format (default)
[/code]
Example:
[code]
> cobc -x -free test.cbl
[/code]
Sorry, if that's not what you meant...
----------------------------------------------------------------
Thanks, but no. I'm up on -free but I've been following hints that there is a directive possible in the sources.
NEWS entry (from 0.20) in the 1.1 tarball. And the ppparse files seem to have the strings. I've been mixing old fixed format files and the new free but I'd prefer to leave the directive in the source file, than have to look to see if -free is needed.
Again, thanks.
Brian Tiffin
----------------------------------------------------------------
Aaah yes, this source switching is somewhat tricky.
Theoretically it should work.
However there are practical details.
Let me review this.
Note there are certain conditions that must be met
for the source to switch between modes.
Roger
----------------------------------------------------------------
OK. Try the current 1.1 tarball.
So, if you want to switch to free-format without
specifying the compile time option, then you can
insert as the first line -
>>SOURCE FORMAT IS FREE
Note that the first '>' must begin at column 8 or greater.
Roger
----------------------------------------------------------------
Tada!
Yeah, I had tried column 1, 2, 7, 8, 12. And now it works quite nicely.
Thanks Roger.
[i]Long live OpenCOBOL[/i]
----------------------------------------------------------------
Subject: Installation error on Solaris 10 x86
Hi! I have a machine with Solaris 10 5/08 installed, and I'm trying to install OpenCOBOL.
I've compiled the libgmp as described on the GMP home page, then installed ncurses 5.6 from sunfreeware (package format), then libtool 1.5.24 from sunfreeware (package format too), and then db 4.4.2, from sunfreeware too.
Then I've added the /usr/sfw/bin, /usr/local/bin and /usr/local/BerkeleyDB.4.4/bin to the PATH variable of the root user.
Then I've added /usr/sfw/lib, /usr/local/lib, and /usr/local/BerkleyDB.4.4/lib to the LD_LIBRARY_PATH variable.
I've linked /usr/sfw/bin/gmake to /usr/sfw/bin/make, /usr/sfw/bin/gld to /usr/sfw/bin/ld, /usr/sfw/bin/gar to /usr/sfw/bin/ar, and /usr/sfw/bin/gm4 to /usr/sfw/bin/m4.
Then, uncompressed the open-cobol-1.0.tar.gz, untared it, and executed ./configure.
After this, when trying to execute "make", I receive this error:
if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.. -DSUPER_OPTIMIZE -I.. -O2 -march=i686 -mtune=pentium3 -finline-functions -fomit-frame-pointer -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -MT libcob_la-fileio.lo -MD -MP -MF ".deps/libcob_la-fileio.Tpo" -c -o libcob_la-fileio.lo `test -f 'fileio.c' || echo './'`fileio.c; \
then mv -f ".deps/libcob_la-fileio.Tpo" ".deps/libcob_la-fileio.Plo"; else rm -f ".deps/libcob_la-fileio.Tpo"; exit 1; fi
gcc -DHAVE_CONFIG_H -I. -I. -I.. -DSUPER_OPTIMIZE -I.. -O2 -march=i686 -mtune=pentium3 -finline-functions -fomit-frame-pointer -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -MT libcob_la-fileio.lo -MD -MP -MF .deps/libcob_la-fileio.Tpo -c fileio.c -fPIC -DPIC -o .libs/libcob_la-fileio.o
fileio.c:308: error: syntax error before "DB"
fileio.c:308: warning: no semicolon at end of struct or union
fileio.c:309: warning: type defaults to `int' in declaration of `key'
fileio.c:309: warning: data definition has no type or storage class
fileio.c:310: error: syntax error before "data"
fileio.c:310: warning: type defaults to `int' in declaration of `data'
fileio.c:310: warning: data definition has no type or storage class
...
Does anybody something about some differences we must consider when installing OpenCOBOL in Solaris 10 5/08, for the x86 platform?
Thanks a lot in advance for your attention!!!
HeCSa.
----------------------------------------------------------------
You forgot the include paths.
What you are doing seems enormously complicated.
I would get gmp, ncurses and BDB installed directly under
/usr then you will not have any problems.
Roger
----------------------------------------------------------------
Subject: Questions from a volunteer tech writer
Hello,
I've opened this thread hoping to encapsulate some of the questions I'm having before I commit pen to paper to try and help write up some usage docs for OC1.0 and 1.1. This may take awhile, as I'm rusty and easily confused. ;)
As I hope to cover quite a few issues (eventually), I'll try and tag each question so we don't have to chase numbers through the thread.
It is also the intent to save time for the friendly OpenCOBOL dev team, not make work, so feel free to ignore, flame or fill in details as time permits.
C$SLEEP:
C$SLEEP. In seconds? Really? Not nano, micro or even milli?
I tried changing the common.c sources to usleep (and the range limit; one week's worth of seconds), which works on my Debian 4 box, but that doesn't seem to be the intent for OpenCOBOL. So I thought I'd ask. I'm not sure if you have plans for a CBL_THREAD_SLEEP etc.
[i]For Windows Sleep() compatibility; even a millisecond resolution would be nicer imho[/i].
Cheers,
Brian
----------------------------------------------------------------
No, we cannot do that. The system routines
(as defined in libcob/system.def) are basically split
into two categories. Those that begin "CBL_" are from
Microfocus syntax. Those that begin "C$" are ACU syntax.
All of these have predefined usage and therefore may not
be changed.
We could set up some CBL_OC_xxx routines if required.
Regarding sub-second sleeping - Here we could use
nanosleep which is Posix conform unlike usleep.
(And it is available under Win).
Roger
----------------------------------------------------------------
Thank you sir. Now I know. And with the hint, I know a little more about where to look.
Seconds it is then.
And yes, I figure OpenCOBOL deserves its own flavour of extensions. But ... not to make work or anything.
Cheers Roger,
Brian
P.S. Thanks for the SOURCE FORMAT IS fix, nice.
----------------------------------------------------------------
If I'm right C$SLEEP has also the ability of shorter times than a second:[code]CALL "C$SLEEP" USING 0.85[/code] should work, too. Is this possible with OC?
----------------------------------------------------------------
Hmm, from current ACU doc -
---------
Parameter
NUM-SEC Numeric or alphanumeric parameter
The number of seconds to sleep.
This parameter is a an unsigned fixed-point numeric parameter, or an
alphanumeric data item containing an unsigned fixed-point number.
---------
Whatever that is supposed to mean.
Roger
----------------------------------------------------------------
I think this means, that all this should work (tested as working for ACU):
[code]...
SPECIAL-NAMES. DECIMAL-POINT IS COMMA.
...
77 mynvar1 pic 9 value 1.
77 mynvar2 pic 9v99 value 0,85.
77 mystrvar pic x(03) value "0.9".
...
CALL "C$SLEEP" USING 0,85
CALL "C$SLEEP" USING "0.25"
CALL "C$SLEEP" USING mynvar1
CALL "C$SLEEP" USING mynvar2
CALL "C$SLEEP" USING mystrvar[/code]
Concerning ACU using [code] CALL "C$SLEEP" USING "0,25"[/code] seems to wait for ever, but this is a bug for me (no need to implement ACU-Bugs into OC...)
How long does OC (current tarball) wait if we use these calls?
----------------------------------------------------------------
Well, without a DECIMAL POINT clause presence in SPECIAL-NAMES,it will not compile :-)
However, OC gives (seconds), in the order of the sleeps, -
0
0
1
0
0
To be expected as OC only picks up the integer part.
Roger
----------------------------------------------------------------
Should I make a new point on the wishlist: "pick up the whole number when using C$SLEEP"?
----------------------------------------------------------------
Nope, why worry about a broken and ill-defined interface.
Lets do something like CBL_OC_SLEEP and use the
Posix defined nanosleep. Just need to define the paramters
for this. eg. 2 params; secs and nanosecs (<= 999999999)
or 1 param with huge nanosecs.
Roger
----------------------------------------------------------------
Hm, worry about C$SLEEP bacause if 0.85 is written and 0 seconds are waited is a little bit hard.
What about implementing at least 1 decimal for C$SLEEP (for the old sources) and writing a new CBL_OC_SLEEP for the new written programs.
Again: Should I post about these points in wishlist or could they stay here?
----------------------------------------------------------------
@human; I can't speak for Roger, but this conversation will definitely help with my side-plans of updating the open-cobol.texi file. Although it may get buried in other issues, so there is that angle.
New tag CBL_ERROR_PROC:
The docs I've read about CBL_ERROR_PROC state that setting RETURN-CODE to zero in the error procedure will disable all other error handlers (including RTS). I still get libcob: err-msg coming out at the end of a run, with MOVE 0 TO RETURN-CODE or with MOVE 1 TO RETURN-CODE. Design intent? Me not gettin' it?
New tag DIVIDE-BY-ZERO:
And as a side issue when sampling the CBL_ERROR_PROC, I was trying DIVIDE 10 BY 0 GIVING VAL. I'm not getting a run time error. (And thinking maybe the compiler was optimizing something away, tried with DIVIDE 10 BY DIVISOR GIVING VAL. with various ways of getting DIVISOR set to zero. All tests simply set VAL to 0. Again, is this me not gettin' it?
New tag SAMPLE-PREFERENCE:
How would you like sample programs bundled? In the open-cobol.texi and/or somewhere else? (Hoping that part of the answer has something to do with downloadable files off of opencobol.org - perhaps in the wiki section? Along with at least snippets in the info file?)
Side issue with SAMPLE-PREFERENCE; And this is for everyone's opinion please. FIXED or FREE form source code? A combination of both? And should they be complete sources or would snippets suffice. (My prefs; BOTH forms (most FREE, some FIXED, one or two in both just to show the difference) and complete samples; perhaps with snippets in the info file for brevity).
Cheers,
Brian
P.S. I'm liking OpenCOBOL more and more every minute. And I do hope to have a baby-steps version of an open-cobol.texi with a couple of library calls documented to show the OpenCOBOL project team shortly. The rust is flaking off now but the easily confused part is probably permanent. :)
P.P.S For everyone; If you know anything that could help me figure this stuff out, go ahead and respond. Part of the objective is to free time for Roger's developments, not slow him down dealing with some chatty newb.
----------------------------------------------------------------
CBL_ERROR_PROC -
Design intent. RETURN-CODE is a local (program) variable in OC. Actually I am not sure that MF does the correct thing in all instances here.
Divide by zero -
Why should you get a runtime error?
The standard states that dividing by zero should raise
an exception and, indeed, this is what happens.
If you do not code an ON SIZE ERROR clause, then that is your problem :-)
Preferences -
We can put complete examples in a seperate "examples" or
"samples" directory in the release.
Regarding FREE/FIXED - Generally, if not specifically showing/demonstrating a particular feature of the format
(eg. fixed line continuation, etc.) then complete programs
should be compilable with both.
This means restricting comments to whole line using a
"*>" construct with the asterisk in column 7. Also, of course, no other use of the indicator column.
Roger
----------------------------------------------------------------
CBL_ERROR_PROC; Thanks. Understood.
DIVIDE-BY-ZERO; Ok, so maybe all the rust hasn't flaked off. :) I'll read up more.
Sample-prefs; Cool. Will do.
Cheers,
Brian
----------------------------------------------------------------
:-)
Sample-prefs - Note that, for complete programs,
you can force the format (compatibly) with
the ">>SOURCE FORMAT IS FREE/FIXED" beginning at column 8 as the first line in sources. (Note the word FORMAT and/or IS) are optional as per standard)
Note you can also change within the source from one to the other (once again as per standard).
Roger
----------------------------------------------------------------
Yep; thanks for that fix Roger. All my freeform OC source starts with >>SOURCE FORMAT IS FREE. (I just had it commented out until your recent tarball.)
Changing within the source is definitely something I'll play with today.
My last professional COBOL gig was in 1983. It all seems so new-fangled now. :) Happy.
Cheers
----------------------------------------------------------------
Yea, :-)
85 standard is fairly OK.
And we are in good shape with OC regarding
this.
I add in 2002 features as deemed necessary/appropiate/possible.
Re SOURCE FORMAT changing within source -
Yep, that should be OK. I tested it.
Easiest way to code this is to put the
">>SOURCE ..." at column 8 REGARDLESS of
what format you are currently in.
Roger
----------------------------------------------------------------
... so the beat goes on ...
What about having a new CBL_OC_SLEEP with nanoseconds (should this really work on all machines?) and if there is a C$SLEEP found by the compiler just do a "sleep_acu_to_oc" where the given parameter is recalculated as nanoseconds and call CBL_OC_SLEEP?
----------------------------------------------------------------
Sure, but what shoud be the param(s)
No probs to implement.
Roger
----------------------------------------------------------------
C$SLEEP;
@human; Most OS's will support nanosleep, but few architectures will offer true 1/10^9th timer resolution. So, I think (I'm just offering my opinion now) it would be nice to leave C$SLEEP in whole seconds and a new CBL_OC_NANOSLEEP call that accepts a single nanosecond argument. And either through an idiom (or preferably) Roger ;) sets, at run-time, a constant that holds the lowest supported timer resolution for the current machine.
Roger; again only opining. The new CBL_OC_SLEEP (I'd call it _NANOSLEEP - just because), takes a single nanoseconds argument and if you feel up to it, support for the "after exception or interrupt" time remaining field as a flag that the POSIX nanosleep takes as its second NULL or timespec pointer field.
I can't see needing super and sub seconds in the same call. For longer pauses, use C$SLEEP and a one second resolution. For subsecond pauses, use the new call with (usually) a nanoseconds count under 1000000000, but with a potential range of 4.2 (or 2.1) full seconds and sub range.
Hmm, or go full out and accept both the sec and nsec on the actual call and let the new call cover both. Hmm.
But, I think I'll still offer the opinion of single nanosecond param with the sec field of the timespec set to zero, and no remaining time flag at all. Fully rounded out with a magic SUPPORTED-TIMER-RESOLUTION (or some such COBOL standard naming) manifest or runtime constant.
Cheers
----------------------------------------------------------------
CBL_NANOSLEEP it is then.
One param - identifier/numeric literal specifying
the number of nans to sleep (<= 999999999)
As the nanosleep is Posix standard, there should
not be any problems using this; however, I suppose
I should check for this in configure.
Roger
----------------------------------------------------------------
So CBL_NANOSLEEP can be called when less than a second is needed. Could OC devide the given params of C$SLEEP to full seconds=old processing and the rest to CBL_NANOSLEEP?
With that processing we would have fully implemented C$SLEEP and a nice extension with CBL_NANOSLEEP.
As I said before: there are problems if C$SLEEP using 0.4 waits 0 seconds and the program really need to wait.
----------------------------------------------------------------
No, the C$SLEEP was implemented as is
because of customer request.
It is in production.
"Never change a working system" :-)
You can be very sure that that the OC
system interfaces (libcob/system.def) will
not change.
Roger
----------------------------------------------------------------
New tag CBL_EXIT_PROC:
From scanning, it looks like the CBL_EXIT_PROC call only takes the install-control-flag and a procedure-pointer. Not the install-params structure subfielded by procedure-pointer and priority. Correct? Or, more to the point, it will accept the structure, but the priority is ignored, even on the install-control-flag value of 3? And the flag 2 "Query prio" feature is not supported?
Not complaining, just asking as I write up a code sample.
[b]Associated Bug Report[/b]; In common.c, CBL_EXIT_PROC, the COB_CHK_PARMS is called with CBL_ERROR_PROC instead of CBL_EXIT_PROC. Masked problem as they both accept 2.
On C$SLEEP. Naming the NANOSLEEP, I didn't mean to suggest CBL_NANOSLEEP (I was lazy typing), I was thinking CBL_OC_NANOSLEEP, to allow for an entire class of CBL_OC_ extensions. Because I know you'll be giving us all kinds of goodies in the future. ;) But, as always, it's your call in the end.
Cheers,
Brian
----------------------------------------------------------------
Re #1. Correct.
Re. Bug. - Good catch. Of course no amount of testing
would pick this up. Corrected and tarball updated.
Re. nano. OK. CBL_OC_NANOSLEEP it is.
(Will post when something is there)
Roger
----------------------------------------------------------------
Roger; I don't think you've made an official announcement yet (not that I've seen), but
call "CBL_OC_NANOSLEEP" using "4000000000" end-call.
works great! So does using "500" & "000000" (half-second), and 5000000000 (five seconds, which is a larger range than I was expecting). Nifty. Using the & compiler string catenation is going to come in handy for readability.
Cheers
----------------------------------------------------------------
New tag; Debug
Roger, what do D indicator lines allow?
New tag; SELECT ASSIGN
With something like
[code]
SELECT OUTFILE
ASSIGN to DDNAME
[/code]
What the options for DDNAME? Can this be set from the environment from bash? Or does the DDNAME identifier need to be explicitly set from COBOL? I'm asking as the code will compile without DDNAME in a data division, but testing it, I can't get an [b]export DDNAME=file[/b] to work.
Thanks,
Brian
----------------------------------------------------------------
To Debug:
If you put a D in column 7 OC handles this as a comment. These lines are only compiled if you run cobc with -fdebugging-line.
By using this you can put some test messages etc. into your program that are only used if necessary (and therefore build with -fdebugging-line).
----------------------------------------------------------------
Debug;
Thanks human. That answer will fit nicely in the FAQ.
Cheers,
Brian
----------------------------------------------------------------
Debug - Note this ONLY applies to fixed-format.
There really is not an equivalent in free-format (at least not according to the standard).
SELECT/ASSIGN -
When this is an implicit/explicit identifier (as in your example), then it refers to either -
a) implicit (ie. not defined as an item in the program)
- An implicitly defined alphanumeric field with this name of length 1024.
b) explicit (ie. you have a definition of this item)
Exceptions - When identifier is either KEYBOARD or DISPLAY,
then the file is automatically connected to stdin/stdout respectively.
This is what MF does.
When the ASSIGN is a literal (eg. "MYFILE"), then
file name substitution may take place.
Firstly, the environment is checked for variables of
the form DD_MYFILE, dd_MYFILE or MYFILE (in this order).
If it finds any of these then this value is substituted.
Otherwise, the filename is as quoted, but may be further altered by the presence of the COB_FILE_PATH variable which can define a default directory for files that do not have an absolute path.
Also what MF does.
We also support use of environment variables within literal names (eg. ASSIGN "$MYDIR/myfile")
Roger
----------------------------------------------------------------
Subject: PROMPT / UPDATE in ACCEPT
Hello Roger,
I opened another topic in relation with ACCEPT statement and this follows our conversation about "ring my bell ...".
Here is my worldwide known FIELDS.CBL program ;-D
[code]
identification division.
program-id. FIELDS.
*>
*> This program was written in order to test
*> the ACCEPT statement in color environment
*> + other features.
*> Strategic lines are commented.
*>
data division.
working-storage section.
77 I pic 99.
77 J pic 99.
77 L pic 99.
77 w pic X(010).
procedure division.
begin.
*> --------------- Check #1------------------
perform varying I from 0 by 1 until I > 7
display "The PROMPT / UPDATE TEST"
line 01 column 25
with foreground-color I
background-color I
HIGHLIGHT
BLANK SCREEN
end-display
*> ----------------------- End of #1 --------------
*> --------------- Check #2 ---------------
perform varying J from 0 by 1 until J > 7
add 4 J giving L
evaluate J
when 7
move "Last Line" to w *> Filling the field before accept "update"
when other
continue
end-evaluate
if w = spaces
display "SPACES" line L column 01 with
foreground-color J
background-color I
highlight
end-display
else
display w line L column 01 with
foreground-color J
background-color I
highlight
end-display
end-if
evaluate J
when 7
accept w line L column 15 with *> 'Last Line' must appear in the field
foreground-color J *> Corrections must be allowed at least
background-color I *> with backspace
highlight *>
update *>
reverse-video *> Works Fine & Really reverses the video
end-accept
when other
accept w line L column 15 with *> field w must contain characters
foreground-color J *> of the sequence typed or
background-color I *> space if nothing has been entered
highlight *> At least backspace must be allowed
prompt auto secure *>
end-accept *>
end-evaluate
display w line L column 30 with *> I display to what I entered
foreground-color J *>
background-color I *>
highlight *>
bell *> this is only for making "music" :-)
end-display
end-perform
end-perform
.
fin.
exit program.
*> ---------------- end of everything -----
[/code]
First of all in #1 text is displayed at line 1 column 1 instead of line 1 & col 25.
Second point the update feature which is fine but not the prompt. The prompt has incidence of the whole receiving field. So I slightly modified the program in order to display the field BEFORE and AFTER the accept. I Seems to act like update : Try to enter 'ABCDEFG' then 123 on the next accept, and you'll have 123DEFG instead of 123 .
This must work like a "TO" parameter in screen section, and not like "using".
This has been said, if just ENTER is pressed during the accept with prompt, it means that "nothing" has been sent to the receiving field and this field is erased.
Don't You think So, Master ?
Very Best Regards
Bear
PS In update, when "end" is typed, I must strike twice on backspace to activate.
----------------------------------------------------------------
Hmm. For #1 -
The doc for MF states that the order for execution
is (DISPLAY) :
1) The AT phrase
2) The BLANK phrase
3) The BELL phrase
4) The rest of the DISPLAY operation
It states for the BLANK phrase -
(excerpt) - All the screen is cleared and the cursor is
placed at line 1 column 1.
Therefore, according to the doc, we do the right thing.
However, MF SE appears not to do this. It displays the
field at col 25. Even stranger, MF changes the FG/BG only
from beginning of line to end of field.
Not sure what is right/wrong here. The doc or the software.
For #2 -
No, this is working as designed and is exactly what MF does.
For #3 - I think this is correct. The first BS "opens up"
the last character. Compare with no AUTO phrase.
Roger
----------------------------------------------------------------
Hello Roger,
First of all thank you for quick answer !
On #1, I will do my best. I tested with ACU and results are
rigmarol ! I think that OC is right.
For #2, with ACU, results are not what MF does. So I have to do with.
For #3, I have other results but I work with ACU, so ...
If the field is edited like most editors do (using DEL ..) this will not be a real problem.
For some exception key you told something interesting about the use of an environment variable in order to get values.
I must say this may be the real solution to access at Up/Down arrow, Up/Down page, ..., because it gives to the programmer possibilities when he needs. I use them (in ACU :-))
Best regards
Bear
----------------------------------------------------------------
For #1 - I have decided that MF is inconsistent here.
I will do the (re)positioning after the BLANK SCREEN.
So, your example will correctly display at col 25.
For #2 - I am still trying to work out all the intricacies
here :-)
There are some subtle interactions with PROMPT/SECURE/UPDATE. Not least of all as they change meaning dependent on whether or not the ACCEPT'ed item
is in the SCREEN section :-(
For exception keys - Working on something now :-)
I will also (time permitting) provide a copy proc in
the "copy" directory defining the exceptions; something like -
78 COB-SCR-OK VALUE 0.
78 COB-SCR-F1 VALUE 1001.
78 COB-SCR-F2 VALUE 1002.
...
78 COB-SCR-F64 VALUE 1064
78 COB-SCR-PAGE-UP VALUE 2001.
78 COB-SCR-PAGE-DOWN VALUE 2002.
etc.
I have yet to decide the 2xxx values.
Roger
----------------------------------------------------------------
For #1 - I agree with you (2,500 % !)
For #2 - I'm anxious to see the next tarball ! I think that there must be some place between 0 & 2999 to set someting like
x027 :-D
Respect ...
Bear
----------------------------------------------------------------
Tarball is up.
#1 fixed as said.
#2 Proof of concept -
For extended exceptions -
Set/export COB_SCREEN_EXCEPTIONS=Y
This activates the 2xxx exception codes.
In copy/screenio.cpy there are the currently defined
exception codes.
(Current extended 2xxx exceptions - Pg Up/Down, Curs Up/Down)
These can be extended as required. When time allows, I will
go through the curses keys and see what else can/should be added.
Roger
----------------------------------------------------------------
Roger, This is wonderful !
I set COB_SCREEN_EXCEPTIONS=Y into my /etc/profile and tested with success.
The only thing I'm sitting on is the ESC key. How can I get the
information through the accept that ESC key has been pressed ?
Do I need to change my tests, and replace ESC by something else ?
Best Regards
Bear
----------------------------------------------------------------
Well, it is a bit unusual to use the ESC key.
The reason, as I said, is that it can be the start
of a sequence. So curses starts an internal timer when
it sees the ESC so as to determine if it is the start
of a sequence.
We can theoretically check for ESC. Let me test it.
Note that anyway there will be a perceptible delay
between pressing the ESC and getting the reaction.
(Shades of vi)
Incidentally, I am not sure what Linux variant you are using but it is not usual to edit /etc/profile.
Normally one edits (or creates if not there) /etc/profile.local.
Check if your /etc/profile sources /etc/profile.local.
If so put your preferences in /etc/profile.local because this will never be overwritten by a system update whereas /etc/profile maybe.
Roger
----------------------------------------------------------------
Roger, Thank you for all the tips and tricks.
My Linux is Debian Etch. I think that yours may be SUSE.
Finally I reported all variables COB_ and DB_HOME in my home directory in .bashrc and I made a copy into .bashrc_save .
Concerning ESC I will let you a bit time to test.
I promise I won't bother you till the next time ... ;-D
Best regards
Bear
----------------------------------------------------------------
Re. bash -
OK. Check /etc/bash.bashrc.local.
It should be sourced from /etc/bash.bashrc.
Re. ESC -
Aside from the delay (1 sec with ncurses), I am getting
false positives dependent on the emulator from certain keys.
Professional emulator like SecureCRT are more or less OK (but not 100%). Putty is particularly bad (depending on which keypad is loaded).
I am inclining to not do this.
Can you use eg. F12 instead of ESC?
Roger
----------------------------------------------------------------
Ok for F12 until something better can be found for ESC.
This will enable me going forward.
Just tell me what would be the theorical value of ESC in screenio.cpy : 1027 or 2027 ?
Thank you for bash tips...
You did great job Roger, thank you again.
Bear
----------------------------------------------------------------
Well, at the moment I have it at 2005 being
the next number :-)
Roger
----------------------------------------------------------------
Well we find it on next tarball in copy ?
Mine is :
cobc (OpenCOBOL) 1.1.0 Build date Jun 25 2008 11:14:39
Copyright (C) 2001-2008 Keisuke Nishida / Roger While
[code]
*> Exception keys
78 COB-SCR-PAGE_UP VALUE 2001.
78 COB-SCR-PAGE_DOWN VALUE 2002.
78 COB-SCR-KEY-UP VALUE 2003.
78 COB-SCR-KEY-DOWN VALUE 2004.
[/code]
According to the wonderful job you have done, can I begin testing the screen section ?
Very best regards
Bear
----------------------------------------------------------------
He-he :-)
The 2005 is only in my dev environment.
Sure, test SCREEN SECTION.
What will not work is any form of positioning
(other than what you have with field accepts),
although TAB should work.
Note that all this screen I/O stuff only currently works
with alphanumeric (PIC X) fields.
Do not expect for 1.1 release anything else :-)
(I know what has to be done and I have the roadmap)
Roger
----------------------------------------------------------------
Should I presume from this, that right justified numeric input is a long way off (think Micro Focus Adisctrl)
Jack
----------------------------------------------------------------
Subject: INSTALLING PROBLEM ? on screenio.c
Yep, OK. Noted and will fix in next tarball.
Note this does not in any way affect OC processing.
Roger
----------------------------------------------------------------
Hello,
I had this warning during 'make' process : just to report.
screenio.c: In function 'cob_check_pos_status':
screenio.c:290: warning: pointer targets in passing argument 1 of 'sprintf' differ in signedness
screenio.c:305: warning: pointer targets in passing argument 1 of 'sprintf' differ in signedness
screenio.c:309: warning: pointer targets in passing argument 1 of 'sprintf' differ in signedness
Regards
Bear
----------------------------------------------------------------
Subject: INSTALLING OPEN-COBOL PROGRAMS ON A SERVER
Hello Worldwide
What are the prerequisites to upload before installing my
compiled programs on a server ?
Thank you
Bear
----------------------------------------------------------------
I'm still pretty new to the OC, but if you are using GNU/Linux, the ldd command shows the library dependencies for an executable.
Using the beeper program you helped me with for example
[code]
$ ldd beeper
linux-gate.so.1 => (0xffffe000)
libcob.so.1 => /usr/local/lib/libcob.so.1 (0xb7f81000)
libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7f5c000)
libgmp.so.3 => /usr/lib/libgmp.so.3 (0xb7f18000)
libncurses.so.5 => /lib/libncurses.so.5 (0xb7ee7000)
libdb-4.5.so => /usr/lib/libdb-4.5.so (0xb7dcd000)
libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7c7f000)
/lib/ld-linux.so.2 (0xb7fbf000)
libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb7c7b000)
libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb7c62000)
[/code]
So at least those libraries. There may be more. If you have Debian, the aptitude system will show the dependencies for the open-cobol 1.0 package.
Windows equivs being [i]depends[/i] and/or [i]dumpbin[/i]
Cheers,
Brian
----------------------------------------------------------------
Very helpful informations
Thank you
Bear
----------------------------------------------------------------
Subject: LINE DRAWING
Hello World,
Has anybody a (good) idea for drawing vertical lines, horizontal, etc.
This will change look and feel for boxes.
In ACU a box is drawn by the display statement like
[code]
012000 display BOX
line 14 position 01
size 28 lines 04
left Title "BoxTitle"
003900 foreground-color 4
background-color 7
end-display
[/code]
Of course this is not standard, but it looks fine.
After a week information in C langage I am trying to understand ncurses to provide a module doing this.
[code]
move 14 to box-line
move 01 to box-position
move 28 to box-size
move 04 to box-height
move 4 to box-fgcolor
move 7 to box-bgcolor
move "BoxTitle" to box-toptitle
move "L" to box-topplace
call "drawbox" using box-item
on exception
...
not on exception
...
end-call
[/code]
Bear
PS I have a lot of stupid ideas like that for windows, subwindows, etc... :-D
----------------------------------------------------------------
a) use ASCII Lines x'01' to x'06'
b) use Cobcurses
----------------------------------------------------------------
a) I tried this :
[code]
identification division.
program-id. TSTGPH.
*>
*>
*>
data division.
working-storage section.
77 I pic 9.
77 L pic 99.
01 some.
02 some-01 pic X value X'01'.
02 some-02 pic X value X'02'.
02 some-03 pic X value X'03'.
02 some-04 pic X value X'04'.
02 some-05 pic X value X'05'.
02 some-06 pic X value X'06'.
01 some-r redefines some.
02 some-o pic X occurs 6.
procedure division.
debut.
display "TESTING LINE DRAWING"
line 01 column 30 with blank screen
end-display
perform varying I from 1 by 1 until I > 6
add 5 I giving L
display I line L column 10
end-display
display some-o (I) line L column 12
end-display
call "C$SLEEP" using "1"
end-perform
.
utlime.
exit program.
[/code]
Results are ^A, ^B, etc
b) I want only draw lines.
Regards
----------------------------------------------------------------
Depending on the char table of your machine it may vary, but if You use the extended ascii (see http://www.asciitable.com/ for example) it could work.
----------------------------------------------------------------
Sorry, I had to be precise :
cobc (OpenCOBOL) 1.1.0 Build date Jun 25 2008 11:14:39
Copyright (C) 2001-2008 Keisuke Nishida / Roger While
Debian Etch
$TERM=xterm / linux
Regards
----------------------------------------------------------------
It's been a long time since I played with a VT and line drawing.
Try ESC )0 or ESC (0 or ESC *0 or ESC +0 to set xterm G1, G2, G3 or G4 DEC special character set before the other codes.
This always seemed like voodoo to me and very very terminal specific, but once figured, worked like a charm ... until the next time, then it all broke. :)
Cheers
Those are the character zero by the way. I think 'A' and 'B' do something too for British or American char sets.
----------------------------------------------------------------
Hello,
Be sure I'm not going to rewrite terminfo in OC. Maybe I should ;-D !
I'm looking into C programs to create something, but I have the knowledge of a newbie.
I'm studying ncurses (Dan Gookin's programmer's guide to ncurses).
As you can see, when I talk about something I post an example to fix ideas.
This forum is international, and people comes from Alaska, Japan, Spain,
Canada, Argentina, France, and our master Roger maintains OC from Germany.
For sure I forgot some other countries.
My wish is that somebody can show me the way by posting a little C program (or a part of)
to make my development more 'confortable'.
In this post I'm not waiting help from Roger, who has a lot of things to do, and does it the best he can.
I have great respect for him.
I'm waiting for a "plug-in". If I'll write something in C that is functional, I will post it.
Making a good toolbox will help OC to progress.
Best regards
Bear
----------------------------------------------------------------
Well, of course, we are now going into esoterics.
I think, first of all, that we should concentrate
on the Cobol language (including standard conformance)
Nice idea, just not suited to what Cobol was/is.
ACU designed their own interfaces targeted at
the Win users.
Which maybe explains why MF took over ACU :-)
Roger
----------------------------------------------------------------
Correct Roger !
We should concentrate on the Cobol language.
Just a parenthesis about ACU (which is now part of MF)
In my job I develop with ACU on windows (because the compiler is installed there).
Deployment is done on linux machines and users have generally putty emulator.
I use 99.9 % characters windows (not graphical) and some of my machines ARE NOT RUNNING UNDER WINDOWS.
All of my programs have F1-style-help and others to open windows, display lists, scroll up/down, etc.
This is to explain my "deep attachment" ... ang why I wanted so much access to all kind of keys including escape.
Regards
Bear
----------------------------------------------------------------
Sure, I understand.
With regard to ESC, sure, there is no problem
in implementing it (I have it in my dev tree)
BUT, what I am concerned about is the false
positives resulting from emulators.
Just an eg. - with Putty, as said, depending
on loaded character set, we get (wrongly) ESC
being pressed. In Putty, with default iso*1 this
occurs. With iso*15 (which should get the euro symbol
but doesn't) it occurs less. With win1252, I can
get the euro symbol but other keys do not work and
I get other false positives eg. with the Alt and/or AltGr
key.
In other words, I would not like to unconditionally do this.
What I am thinking here is that users may be surprised
by a false return.
This maybe an exceptional case where we need yet another
environment variable to define (only when extended status is defined). Acceptable?
(COB_SCREEN_ESC=Y)
(Only activated when also COB_SCREEN_EXCEPTIONS=Y)
Roger
----------------------------------------------------------------
Acceptable
Bear
----------------------------------------------------------------
Maybe it's better to read environment-vars for the interpreted sequence. With that it should be no problem if there's another emulation, you just have to define OC_KEY_ESC etc. with the right values.
----------------------------------------------------------------
Done. COB_SCREEN_ESC=Y with combination
COB_SCREEN_EXCEPTIONS=Y will activate ESC.
Up to you how this is interpreted.
(Uptil now, I do not have a 100% interpretation
of when/what provokes the ESC).
However that is not my problem, that is emualtor/(n)(pd)curses problem.
Tarball updated.
Roger
----------------------------------------------------------------
Im testing new tarball
cobc (OpenCOBOL) 1.1.0 Build date Jun 26 2008 18:15:13
Copyright (C) 2001-2008 Keisuke Nishida / Roger While
Be careful when COB_SCREEN_ESC is not defined AND
COB_SCREEN_EXCEPTION is defined it gives a segmentation error.
As you said the ESC is slow, but acceptable.
So I can define
88 Exit-Pressed 1012, 2005.
----------------------------------------------------------------
OK. Will check.
Thanks
Roger
----------------------------------------------------------------
Indeed, referencing a null pointer does not produce particularly good results :-(
Fixed.
Roger
----------------------------------------------------------------
Thank You, Roger
As I told you, I'm playing with C and Ncurses. So I post my work so the community can have opinion and may use it.
My first program TESTEG, written in OC calls CADRES, written in C and linked with ncurses.
to compile TESTEG :
cobc -x -free -I ../Copies -Wall $1.CBL
where $1 represents TESTEG
[code]
identification division.
program-id. TESTEG.
*>
*> caller for line drawing
*>
data division.
working-storage section.
77 wl1 pic 99 comp-x.
77 wc1 pic 99 comp-x.
77 wl2 pic 99 comp-x.
77 wc2 pic 99 comp-x.
77 intro pic X.
procedure division.
debut.
display "Testing box drawing"
line 01 column 22 with
foreground-color 1
background-color 7 blank screen
end-display
move 12 to wl1
move 10 to wc1
move 16 to wl2
move 70 to wc2
perform CADRES
move 02 to wl1
move 30 to wc1
move 22 to wl2
move 40 to wc2
perform CADRES
accept intro
go to fin.
.
CADRES.
call "CADRES" using wl1 wc1 wl2 wc2
on exception
display "SOMETHING IS WRONG with CADRES"
not on exception
continue
end-call
.
fin.
ultime.
exit program.
[/code]
I used comp-x, is there another format adapted.?
The second program called CADRES is used in the same manner as if it was a OC_written dynamic module.
cc -shared -o ../Library/$1.so -lncurses $1.c
(with $1=CADRES)
[code]
/****************************************************************************
This program draws boxes according to the upper left coordinate L1,C1 and the
lower right coordinate (L2,C2) of the "box".
This program is written by a newbie so it is highly perfectible.
It is a good illustration for what we can do with OC.
****************************************************************************/
#include
void CADRES(int *ptr_L1,int *ptr_C1,int *ptr_L2,int *ptr_C2)
{
int L1=*ptr_L1;
int C1=*ptr_C1;
int L2=*ptr_L2;
int C2=*ptr_C2;
int l1, c1;
int l2, c2;
int i,j,imax,jmax ;
imax=L2-L1;
jmax=C2-C1;
l1=L1-1;
c1=C1-1;
l2=L2-1;
c2=C2-1;
// initscr(); // No needed here because of BLANK SCREEN in the caller
/* Corner localization according with values sent by Cobol */
move(l1,c1);
addch(ACS_ULCORNER);
move(l1,c2);
addch(ACS_URCORNER);
move(l2,c1);
addch(ACS_LLCORNER);
move(l2,c2);
addch(ACS_LRCORNER);
for (i=1;i ** Intentional error **
* won't get here. RTS error handler will stop run
display "procedure division, following run-time error".
display global-value.
display reenter-value.
exit program.
*****************************************************************
*****************************************************************
* Exit procedure:
entry "exit-proc".
display "**CUSTOM EXIT HANDLER will pause**".
call "C$SLEEP" using "3".
exit program.
*****************************************************************
* Error procedure:
entry "err-proc" using err-msg.
display "**error procedure entered**".
* These lines are to demonstrate local and working storage
display global-value.
move 66 to global-value.
display reenter-value.
move 77 to reenter-value.
* Process err-msg.
***** Determine Length of error Message
perform varying ind from 1 by 1
until (err-msg(ind:1) = x"00") or (ind = length of err-msg)
continue
end-perform
display err-msg(1:ind).
* trap an error caused in error_proc
if not been-here then
set been-here to true
display "** cause error inside error_proc **"
call "erroneous" *> Intentional error
end-if
* In OpenCOBOL 1.1, the return-code is local and does
* not influence further error handlers
*move 1 to return-code.
move 0 to return-code.
display "**error procedure exit**".
exit program.
[/code]
Expected Output:
[quote]
INTENTIONAL PROBLEM INSTALLING EXIT PROC
0001
DIVIDE BY ZERO EXCEPTION
**error procedure entered**
99
11
Cannot find module 'erroneous'.
** cause error inside error_proc **
**error procedure entered**
66
11
Cannot find module 'erroneous'.
**error procedure exit**
libcob: Cannot find module 'erroneous'
**CUSTOM EXIT HANDLER will pause**
[/quote]
At this stage, ruthless critique welcomed.
Cheers,
Brian
----------------------------------------------------------------
Another sample for critique.
[code]
>>SOURCE FORMAT IS FREE
*> **************************************************************
*> OpenCOBOL Logical bit operation library call examples
*> **************************************************************
*>
*> Copyright (C) 2008 The OpenCOBOL Project
*>
*> This program is free software; you can redistribute it and/or
*> modify it under the terms of the GNU General Public License as
*> published by the Free Software Foundation; either version 2,
*> or (at your option) any later version.
*>
*> This program is distributed in the hope that it will be
*> useful, but WITHOUT ANY WARRANTY; without even the implied
*> warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
*> PURPOSE. See the GNU General Public License for more details.
*>
*> You should have received a copy of the
*> GNU General Public License along with this software;
*> see the file COPYING. If not, write to
*> the Free Software Foundation, 51 Franklin Street, Fifth Floor
*> Boston, MA 02110-1301 USA
*> **************************************************************
identification division.
program-id. logicals.
author. Brian Tiffin.
date-written. 28-Jun-2008.
data division.
working-storage section.
*> define an alphnum field large enough to hold call name
01 BITWISE pic x(8).
*> results from library call are 32 bit integers
01 result pic x(4) comp-5.
*> The default source is an 8 byte binary X'FFFF0000FFFF0000'
*> default destination target 8 byte 0
*> length is passed by value, and for demo varies from 1 to 8
01 src pic s9(18) comp-5 value -281470681808896.
01 dst pic s9(18) comp-5 value 0.
01 len pic x(4) comp-5.
*> org is defined to resest destination target for each len
01 org pic s9(18) comp-5 value 0.
*>
*> Demonstration of callable bitwise logical operators
*>
procedure division.
display "Bitwise logical library calls".
move "CBL_AND" to BITWISE.
move -1 to org.
perform demonstrate-bitwise.
move "CBL_OR" to BITWISE.
move 0 to org.
perform demonstrate-bitwise.
move "CBL_NOR" to BITWISE.
move 0 to org.
perform demonstrate-bitwise.
move "CBL_XOR" to BITWISE.
move 4294901760 to org.
perform demonstrate-bitwise.
move "CBL_IMP" to BITWISE.
move 0 to org.
perform demonstrate-bitwise.
move "CBL_NIMP" to BITWISE.
move 0 to org.
perform demonstrate-bitwise.
move "CBL_EQ" to BITWISE.
move 0 to org.
perform demonstrate-bitwise.
*>
*> NOT only uses the target field, no source
*>
move src to org.
display "CBL_NOT".
perform varying len from 1 by 1
until len > 8
move org to dst
call "CBL_NOT" using dst
by value len
returning result
display "org: ", org, ", dst: ", dst, ", len: ", len
if result not equal 0
display "res: ", result
end-if
end-perform.
exit program.
stop run.
*>
*> **************************************************************
*>
demonstrate-bitwise.
display BITWISE
perform varying len from 1 by 1
until len > 8
move org to dst
call BITWISE using src
dst
by value len
returning result
display "src: ",src,", org: ",org,", dst: ",dst, ", len: ",len
if result not equal 0
display "res: ", result
end-if
end-perform.
[/code]
Outputs
[code]
Bitwise logical library calls
CBL_AND
src: -000281470681808896, org: -000000000000000001, dst: -000000000000000256, len: 000000001
src: -000281470681808896, org: -000000000000000001, dst: -000000000000065536, len: 000000002
src: -000281470681808896, org: -000000000000000001, dst: -000000000000065536, len: 000000003
src: -000281470681808896, org: -000000000000000001, dst: -000000000000065536, len: 000000004
src: -000281470681808896, org: -000000000000000001, dst: -000001095216726016, len: 000000005
src: -000281470681808896, org: -000000000000000001, dst: -000281470681808896, len: 000000006
src: -000281470681808896, org: -000000000000000001, dst: -000281470681808896, len: 000000007
src: -000281470681808896, org: -000000000000000001, dst: -000281470681808896, len: 000000008
CBL_OR
src: -000281470681808896, org: +000000000000000000, dst: +000000000000000000, len: 000000001
src: -000281470681808896, org: +000000000000000000, dst: +000000000000000000, len: 000000002
src: -000281470681808896, org: +000000000000000000, dst: +000000000016711680, len: 000000003
src: -000281470681808896, org: +000000000000000000, dst: +000000004294901760, len: 000000004
src: -000281470681808896, org: +000000000000000000, dst: +000000004294901760, len: 000000005
src: -000281470681808896, org: +000000000000000000, dst: +000000004294901760, len: 000000006
src: -000281470681808896, org: +000000000000000000, dst: +071776123356119040, len: 000000007
src: -000281470681808896, org: +000000000000000000, dst: -000281470681808896, len: 000000008
CBL_NOR
src: -000281470681808896, org: +000000000000000000, dst: +000000000000000255, len: 000000001
src: -000281470681808896, org: +000000000000000000, dst: +000000000000065535, len: 000000002
src: -000281470681808896, org: +000000000000000000, dst: +000000000000065535, len: 000000003
src: -000281470681808896, org: +000000000000000000, dst: +000000000000065535, len: 000000004
src: -000281470681808896, org: +000000000000000000, dst: +000001095216726015, len: 000000005
src: -000281470681808896, org: +000000000000000000, dst: +000281470681808895, len: 000000006
src: -000281470681808896, org: +000000000000000000, dst: +000281470681808895, len: 000000007
src: -000281470681808896, org: +000000000000000000, dst: +000281470681808895, len: 000000008
CBL_XOR
src: -000281470681808896, org: +000000004294901760, dst: +000000004294901760, len: 000000001
src: -000281470681808896, org: +000000004294901760, dst: +000000004294901760, len: 000000002
src: -000281470681808896, org: +000000004294901760, dst: +000000004278190080, len: 000000003
src: -000281470681808896, org: +000000004294901760, dst: +000000000000000000, len: 000000004
src: -000281470681808896, org: +000000004294901760, dst: +000000000000000000, len: 000000005
src: -000281470681808896, org: +000000004294901760, dst: +000000000000000000, len: 000000006
src: -000281470681808896, org: +000000004294901760, dst: +071776119061217280, len: 000000007
src: -000281470681808896, org: +000000004294901760, dst: -000281474976710656, len: 000000008
CBL_IMP
src: -000281470681808896, org: +000000000000000000, dst: +000000000000000255, len: 000000001
src: -000281470681808896, org: +000000000000000000, dst: +000000000000065535, len: 000000002
src: -000281470681808896, org: +000000000000000000, dst: +000000000000065535, len: 000000003
src: -000281470681808896, org: +000000000000000000, dst: +000000000000065535, len: 000000004
src: -000281470681808896, org: +000000000000000000, dst: +000001095216726015, len: 000000005
src: -000281470681808896, org: +000000000000000000, dst: +000281470681808895, len: 000000006
src: -000281470681808896, org: +000000000000000000, dst: +000281470681808895, len: 000000007
src: -000281470681808896, org: +000000000000000000, dst: +000281470681808895, len: 000000008
CBL_NIMP
src: -000281470681808896, org: +000000000000000000, dst: +000000000000000000, len: 000000001
src: -000281470681808896, org: +000000000000000000, dst: +000000000000000000, len: 000000002
src: -000281470681808896, org: +000000000000000000, dst: +000000000016711680, len: 000000003
src: -000281470681808896, org: +000000000000000000, dst: +000000004294901760, len: 000000004
src: -000281470681808896, org: +000000000000000000, dst: +000000004294901760, len: 000000005
src: -000281470681808896, org: +000000000000000000, dst: +000000004294901760, len: 000000006
src: -000281470681808896, org: +000000000000000000, dst: +071776123356119040, len: 000000007
src: -000281470681808896, org: +000000000000000000, dst: -000281470681808896, len: 000000008
CBL_EQ
src: -000281470681808896, org: +000000000000000000, dst: +000000000000000255, len: 000000001
src: -000281470681808896, org: +000000000000000000, dst: +000000000000065535, len: 000000002
src: -000281470681808896, org: +000000000000000000, dst: +000000000000065535, len: 000000003
src: -000281470681808896, org: +000000000000000000, dst: +000000000000065535, len: 000000004
src: -000281470681808896, org: +000000000000000000, dst: +000001095216726015, len: 000000005
src: -000281470681808896, org: +000000000000000000, dst: +000281470681808895, len: 000000006
src: -000281470681808896, org: +000000000000000000, dst: +000281470681808895, len: 000000007
src: -000281470681808896, org: +000000000000000000, dst: +000281470681808895, len: 000000008
CBL_NOT
org: -000281470681808896, dst: -000281470681808641, len: 000000001
org: -000281470681808896, dst: -000281470681743361, len: 000000002
org: -000281470681808896, dst: -000281470698455041, len: 000000003
org: -000281470681808896, dst: -000281474976645121, len: 000000004
org: -000281470681808896, dst: -000280379759984641, len: 000000005
org: -000281470681808896, dst: -000000004294901761, len: 000000006
org: -000281470681808896, dst: -071776123356119041, len: 000000007
org: -000281470681808896, dst: +000281470681808895, len: 000000008
[/code]
Useful? Meaningless?
And for Roger; while I'm here with this one.
What are [b]CBL_XF4, CBL_XF5 and CBL_X91[/b] meant for? They seem to be 7-bit character shifts of some sort? My EBCDIC knowledge is near zero.
Cheers
----------------------------------------------------------------
The CALL's X"F4", X"F5", X"91" are from MF.
You can find them in the online MF doc under
Library Routines.
F4/F5 are for packing/unpacking bits from/to bytes.
91 is a multi-use call. Implemented are the subfunctions
get/set cobol switches (11, 12) and get number of call params (16).
Roger
----------------------------------------------------------------
Thanks Roger;
Next one. Samples of C$JUSTIFY, C$TOUPPER, C$TOLOWER
[code]
>>SOURCE FORMAT IS FIXED
*> **************************************************************
*>
*> Copyright (C) 2008 The OpenCOBOL Project
*>
*> This program is free software; you can redistribute it and/or
*> modify it under the terms of the GNU General Public License as
*> published by the Free Software Foundation; either version 2,
*> or (at your option) any later version.
*>
*> This program is distributed in the hope that it will be
*> useful, but WITHOUT ANY WARRANTY; without even the implied
*> warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
*> PURPOSE. See the GNU General Public License for more details.
*>
*> You should have received a copy of the
*> GNU General Public License along with this software;
*> see the file COPYING. If not, write to
*> the Free Software Foundation, 51 Franklin Street, Fifth Floor
*> Boston, MA 02110-1301 USA
*> **************************************************************
identification division.
program-id. justify.
author. Brian Tiffin.
security. none.
date-written. 01-Jul-2008.
environment division.
configuration section.
source-computer. IBMPC.
object-computer. IBMPC.
data division.
working-storage section.
01 source-str pic x(80)
value " this is a test of the internal voice communication
- " system".
01 just-str pic x(80).
01 justification pic x.
01 result pic s9(8) comp-5.
procedure division.
move source-str to just-str.
* Left justification
move "L" to justification.
perform demonstrate-justification.
* case change to upper, demonstrate LENGTH verb
call "C$TOUPPER" using just-str
by value length just-str
returning result.
* Centre
move "C" to justification.
perform demonstrate-justification.
* case change to lower
call "C$TOLOWER" using just-str
by value 80
returning result.
* Right, default if no second argument
call "C$JUSTIFY" using just-str
returning result.
* NOTE: The move "R" is solely for show-justification
move "R" to justification.
perform show-justification.
exit program.
stop run.
*****************************************
demonstrate-justification.
call "C$JUSTIFY" using just-str
justification
returning result
end-call
if result not equal 0 then
display "Problem: " result
stop run
end-if
perform show-justification
.
*****************************************
show-justification.
evaluate justification
when "L" display "Left justify"
when "C" display "Centred (in UPPERCASE)"
when other display "Right justify"
end-evaluate
display "|" source-str "|"
display "|" just-str "|"
display space
.
[/code]
Producing...
[code]
Left justify
| this is a test of the internal voice communication system |
|this is a test of the internal voice communication system |
Centred (in UPPERCASE)
| this is a test of the internal voice communication system |
| THIS IS A TEST OF THE INTERNAL VOICE COMMUNICATION SYSTEM |
Right justify
| this is a test of the internal voice communication system |
| this is a test of the internal voice communication system|
[/code]
Once again, ruthless critiques welcome
Cheers
Brian
Edit; fixed misspelling of communication
----------------------------------------------------------------
Brian, a comment :-)
Please do not use AUTHOR, DATE-WRITTEN, DATE-MODIFIED,DATE-COMPILED, INSTALLATION, REMARKS or SECURITY in the ID division. These were obsoleted in the 85 standard. They are, of course, accepted and ignored. However we would not like to promote their usage. (They may at any time get removed).
The same applies to certain legacy (mainframe) keywords -
EJECT, SKIP1, SKIP2, SKIP3.
Incidentally, did you know that the minimum valid (according to standard) source code is the one-liner -
PROGRAM-ID. MYONELINER.
:-)
Compiles as either an executable or a module. Doesn't do much though :-)
Roger
----------------------------------------------------------------
Thanks Roger. Will do (or more like, will don't) :)
Cheers
Brian
----------------------------------------------------------------
Hello Brian,
Your example concerning text justification is very professional. Why don't you use the free format ?
After some hesitation, I adopted because it's really easier to code ...
Best Regards
Bear
----------------------------------------------------------------
There are a lot of possible reasons for coding fixed format:
1. It's easier to code if you did it that way for a long time.
2. There are some COBOL-Editors (please don't ask me for them...) that need fixed format.
3. It's easier to read if posted here as CODE, because for lines with 150 chars (number of chars depending on the resolution of your monitor) you need to scroll horizontal.
----------------------------------------------------------------
Bear;
I'll ditto Human, and in this particular case I wanted to demonstrate a continuation line. A lot of it is a 25 year old hold over to what I was used to.
Plus my cobol.vim file always auto newlines any sources that go past column 72. :)
But, I'll be using both forms for the samples. Opinion appreciated. Thanks.
Cheers,
----------------------------------------------------------------
Heads up here -
I was going to suggest to Brian that he try several ways
of compiling test progs to detect differences in
dialects and to try to standardize the test code as much
as possible. On the lines of -
cobc -x -Wall prog.cob
cobc -x -Wall -std=mf prog.cob
cobc -x -Wall -std=cobol85 prog.cob
cobc -x -Wall -std=cobol2002 prog.cob
One would aim for no errors/warnings on all these.
(I know it is not always possible depending on
extensions, in which case a comment line in the prog would
be appropiate)
I was somewhat baffled by the fact that for 85/2002 that
OC was not spewing out the warnings it should have done.
Specifically lack of statement terminators (END-xxx).
Quickly reviewed the code and discovered an oversight in
the END-xxx checking that has been latent for at least as far back as OC 0.23 :-(
Fixed up rather hastily and tarball updated.
So, Brian (and all), get the latest tarball and check your
compatibility :-)
Roger
----------------------------------------------------------------
It would be nice to have some markers (for example in column 73 if using fixed format) like[code] perform mf-things MARKMF
perform 85-things MARK85
perform 2002-things MARK02[/code] For Doing things like[code]
cobc -x -Wall -std=mf -inclMark=MARKMF -exclMark=MARK85 -exclMark=MARK02 prog.cob
cobc -x -Wall -std=cobol85 -inclMark=MARK85 -exclMark=MARKMF -exclMark=MARK02 prog.cob
cobc -x -Wall -std=cobol2002 -inclMark=MARK02 -exclMark=MARKMF -exclMark=MARK85 prog.cob[/code]
(the -exclMark should be commented out, the -inclMark should be commented in)
I think ACU had something like that. Has anybody an idea for doing that stuff in free format?
With techniques like that we could have samples working on all std's
----------------------------------------------------------------
Note that OC (per Cobol standard) also supports floating comments in fixed-format.
That means that the '*>' construct can also be used
in fixed-format with the proviso that the asterisk must
must be on column 7 or greater to be effective. Logical, as in fixed-format, columns 1 - 6 are stripped.
Therefore it is quite valid in fixed-format to put a floating comment construct following a statement on the same line.
Roger
----------------------------------------------------------------
Updated justify.cob that compiles without warning for
-std mf, cobol85 and cobol2002
[code]
>>SOURCE FORMAT IS FIXED
*> **************************************************************
*>
*> Copyright (C) 2008 The OpenCOBOL Project
*>
*> This program is free software; you can redistribute it and/or
*> modify it under the terms of the GNU General Public License as
*> published by the Free Software Foundation; either version 2,
*> or (at your option) any later version.
*>
*> This program is distributed in the hope that it will be
*> useful, but WITHOUT ANY WARRANTY; without even the implied
*> warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
*> PURPOSE. See the GNU General Public License for more details.
*>
*> You should have received a copy of the
*> GNU General Public License along with this software;
*> see the file COPYING. If not, write to
*> the Free Software Foundation, 51 Franklin Street, Fifth Floor
*> Boston, MA 02110-1301 USA
*> **************************************************************
*> Author: Brian Tiffin
*> Date: 01-Jul-2008
*> Purpose: Demonstrate the usage of OpenCOBOL call library
*> C$JUSTIFY, C$TOUPPER, C$TOLOWER
*> Tectonics: cobc -x -Wall justify.cob
*> Using OpenCOBOL 1.1, posted 02-Jul-2008
*> History: 02-Jul-2008, updated to remove warnings
identification division.
program-id. justify.
environment division.
configuration section.
source-computer. IBMPC.
object-computer. IBMPC.
data division.
working-storage section.
01 source-str pic x(80)
value " this is a test of the internal voice communication
- " system".
01 just-str pic x(80).
01 justification pic x.
01 result pic s9(8) comp-5.
procedure division.
move source-str to just-str.
* Left justification
move "L" to justification.
perform demonstrate-justification.
* case change to upper, demonstrate LENGTH verb
call "C$TOUPPER" using just-str
by value length just-str
returning result
end-call.
* Centre
move "C" to justification.
perform demonstrate-justification.
* case change to lower
call "C$TOLOWER" using just-str
by value 80
returning result
end-call.
* Right, default if no second argument
call "C$JUSTIFY" using just-str
returning result
end-call.
move "R" to justification.
perform show-justification.
exit program.
stop run.
*****************************************
demonstrate-justification.
call "C$JUSTIFY" using just-str
justification
returning result
end-call
if result not equal 0 then
display "Problem: " result end-display
stop run
end-if
perform show-justification
.
*****************************************
show-justification.
evaluate justification
when "L" display "Left justify" end-display
when "C" display "Centred (in UPPERCASE)" end-display
when other display "Right justify" end-display
end-evaluate
display "|" source-str "|" end-display
display "|" just-str "|" end-display
display space end-display
.
[/code]
Thanks once again to Mr. While.
Cheers,
Brian
----------------------------------------------------------------
This is probably the last of the samples I'll post here.
Standard IO, TRIM, WHEN-COMPILED and a little INSPECT REPLACING.
[code]
>>SOURCE FORMAT IS FIXED
*> **************************************************************
*>
*> Copyright (C) 2008 The OpenCOBOL Project
*>
*> This program is free software; you can redistribute it and/or
*> modify it under the terms of the GNU General Public License as
*> published by the Free Software Foundation; either version 2,
*> or (at your option) any later version.
*>
*> This program is distributed in the hope that it will be
*> useful, but WITHOUT ANY WARRANTY; without even the implied
*> warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
*> PURPOSE. See the GNU General Public License for more details.
*>
*> You should have received a copy of the
*> GNU General Public License along with this software;
*> see the file COPYING. If not, write to
*> the Free Software Foundation, 51 Franklin Street, Fifth Floor
*> Boston, MA 02110-1301 USA
*> **************************************************************
*>
*> **************************************************************
*> * Standard IO programming with OpenCOBOL *
*> **************************************************************
*> Author: Brian Tiffin
*> Date: 04-Jul-2008
*> Tectonics: cobc -x standardio.cob
*> Usage: ./standardio
*> or ./standardio output
*> Notes:
*> OpenCOBOL executables can use normal stdio redirection and
*> with the ENVIROMENT variable extensions can also be used
*> for web CGI server side programming.
IDENTIFICATION DIVISION.
PROGRAM-ID. standard-io.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DATAREC PIC X(80).
01 ENVREC PIC X(32767).
01 DATEREC PIC XXXX/XX/XXBXX/XX/XXXXXXX/XX.
PROCEDURE DIVISION.
*> Get datetime of program compile
MOVE FUNCTION WHEN-COMPILED TO DATEREC.
*> The DISPLAY verb and PICTURE in OpenCOBOL makes output easy.
*> (but, PIC does not allow colons, so ...
*> replace the PIC /'s (after the B) with colons.
INSPECT DATEREC REPLACING ALL "/" BY ":" AFTER INITIAL SPACE.
DISPLAY
"Intrinsic function WHEN-COMPILED returned " DATEREC
END-DISPLAY.
*> OpenCOBOL's DISPLAY verb includes most extended functionality
*> NO ADVANCING supresses the default newline of DISPLAY
DISPLAY "Input: " WITH NO ADVANCING END-DISPLAY.
*> Simple console accept to an 80 character COBOL data record
ACCEPT DATAREC END-ACCEPT.
*> Trim the input for display using an intrinsic funtion
*> TRIM is a new extension from proposed 2008 COBOL standard
DISPLAY "|" FUNCTION TRIM(DATAREC) "|" END-DISPLAY.
*> sysin can also be used, and is the same as the previous accept
DISPLAY "Input: " WITH NO ADVANCING END-DISPLAY.
ACCEPT DATAREC FROM SYSIN END-ACCEPT.
*> Without trimming, OpenCOBOL will display all of DATAREC
*> which is an 80 character alphanumeric field.
DISPLAY "|" DATAREC "|" END-DISPLAY.
*> OpenCOBOL supports the ACCEPT ... FROM ENVIRONMENT
*> and DISPLAY ... UPON ENVIRONMENT extensions.
*> This sample uses bash's usually long ls command coloring var
ACCEPT ENVREC FROM ENVIRONMENT "LS_COLORS" END-ACCEPT.
*> Without the trim, this would display a full 32K field
DISPLAY
"Value of LS_COLORS environment variable is: "
FUNCTION TRIM(ENVREC)
END-DISPLAY.
EXIT PROGRAM.
STOP RUN.
[/code]
With sample output
[code]
$ ./standardio
Intrinsic function WHEN-COMPILED returned 2008/07/04 04:55:5100-04:00
Input: test
|test|
Input: test
|test |
Value of LS_COLORS environment variable is: no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35: ...
[/code]
I truncated the env var output so it wouldn't cause too much browser grief for everyone.
This may be your last chance for ruthless critiques before these start getting added to OpenCOBOL releases, so ... :)
Cheers
Brian
----------------------------------------------------------------
Ok, last one wasn't the last. :)
[code]
>>SOURCE FORMAT IS FREE
*> Author: Brian Tiffin for the OpenCOBOL Project
*> and posts from opencobol.org
*> Dated: 11-July-2008
*> Purpose: Count trailing spaces
*> Tectonics: cobc trailingsp.cob
*> cobcrun trailingsp
*> Note: hard loop profiler, results will vary.
IDENTIFICATION DIVISION.
PROGRAM-ID. trailingsp.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 START-PROFILE PIC 9(18).
01 END-PROFILE PIC 9(18).
01 SHOW-PROFILE PIC Z(5)9.
01 TITLE-PROFILE PIC X(18).
01 WAY PIC 9.
01 B-COUNT PIC 999 VALUE 0.
01 TEST-CASE PIC X(80)
VALUE "This is my string.".
PROCEDURE DIVISION.
PERFORM VARYING WAY FROM 1 BY 1
UNTIL WAY > 4
ACCEPT START-PROFILE FROM TIME END-ACCEPT
EVALUATE WAY
WHEN 1
MOVE "PERFORM varying: " TO TITLE-PROFILE
PERFORM ONE-WAY 10000 TIMES
WHEN 2
MOVE "INSPECT reverse: " TO TITLE-PROFILE
PERFORM TWO-WAY 10000 TIMES
WHEN 3
MOVE "INSPECT trailing: " TO TITLE-PROFILE
PERFORM THREE-WAY 10000 TIMES
WHEN 4
MOVE "Trim and length: " TO TITLE-PROFILE
PERFORM FOUR-WAY 10000 TIMES
END-EVALUATE
ACCEPT END-PROFILE FROM TIME END-ACCEPT
SUBTRACT
START-PROFILE FROM END-PROFILE GIVING START-PROFILE
END-SUBTRACT
MOVE START-PROFILE TO SHOW-PROFILE
DISPLAY
TITLE-PROFILE SHOW-PROFILE "ticks, " B-COUNT
END-DISPLAY
END-PERFORM.
GOBACK.
*> ******************************************************************
ONE-WAY.
PERFORM VARYING B-COUNT FROM LENGTH OF TEST-CASE BY -1
UNTIL TEST-CASE(B-COUNT:1) NOT EQUAL SPACE
END-PERFORM
SUBTRACT
B-COUNT FROM LENGTH OF TEST-CASE GIVING B-COUNT
END-SUBTRACT
.
TWO-WAY.
MOVE ZERO TO B-COUNT
INSPECT FUNCTION REVERSE(TEST-CASE)
TALLYING B-COUNT
FOR ALL LEADING ' '
.
THREE-WAY.
MOVE ZERO TO B-COUNT
INSPECT TEST-CASE
TALLYING B-COUNT
FOR TRAILING SPACE
.
FOUR-WAY.
COMPUTE
B-COUNT = LENGTH TEST-CASE - FUNCTION LENGTH(FUNCTION TRIM(TEST-CASE))
END-COMPUTE
.
[/code]
Results will vary, maybe 0 on a lot of machines.
[code]
PERFORM varying: 8ticks, 062
INSPECT reverse: 4ticks, 062
INSPECT trailing: 4ticks, 062
Trim and length: 3ticks, 062
[/code]
Cheers,
Brian
----------------------------------------------------------------
Whilst this is OK for the defined value
of TEST-CASE, consider the case when the
content of TEST-CASE is unknown.
eg. Set TEST-CASE to SPACES.
In ONE-WAY, you will get undefined results.
In a PERFORM/UNTIL using an index/subscript,
always test (in the UNTIL phrase) the index/subscript for a possible exit condition BEFORE the condition using the
index/subscript.
ie. UNTIL check-index OR condition-using-index.
Also note that OR evaluates left to right and therefore
the above UNTIL conditions can NOT be reversed
(You must check the index BEFORE using the index)
Incidentally, this is one of the most prevalent
mistakes made in Cobol programming.
In FOUR-WAY, careful using FUNCTION TRIM.
The default, with no second param defined, is to trim
leading AND trailing spaces.
So strictly speaking in this example it should be
FUNCTION TRIM (TEST-CASE TRAILING).
Roger
----------------------------------------------------------------
Thanks Roger.
I fixed the TRIM, but I don't think I see the problem with ONE-WAY. I think.
LENGTH OF will always return a valid index no? Something that will always be a valid reference for (IND:1)? That code will stop at 1 won't it? For all space? I tested with ZEROES too.
The only weirdness is SPACES and FOUR-WAY returning 79 ?? ... I'm new to the trim bit, but should it return one space or no spaces after a trim?
I definitely have to get used to running more test-cases.
And I still can't rid of the truncation warnings. In this case START-PROFILE to SHOW-PROFILE. Is there a trick for that?
And again, thanks for the heads up.
Cheers,
Brian.
----------------------------------------------------------------
Most definitely ONE-WAY has a problem.
It relies on undefined behaviour.
To demonstrate, replace your definition of TEST-CASE
with something like this -
[code]
01 MYTEST01.
03 MYFIRSTFLD PIC XXX VALUE SPACES.
03 TEST-CASE PIC X(80) VALUE SPACES.
[/code]
It will loop.
Even worse, the behaviour is also dependent on whether
or not B-COUNT is signed. If it is signed you will get
a negative reference into MYFIRSTFLD.
(Which only eventually terminates as the character in memory preceeding the 01 level is likely not to be space)
Roger
Roger
----------------------------------------------------------------
Well, well, well.
So, luckily, I'm too dense to let being WRONG stop me. Corrected ONE-WAY (more like; Changed ONE-WAY). But now I'm off to read more refreshers. Hopefully I'll get to a point soon where you won't have to worry about me leading everyone too far into bug city.
[i]"Those that can, do. Those that can't teach, write documentation."[/i]
Please excuse the taint everyone. Learn by FAIL. :)
Cheers,
Brian
----------------------------------------------------------------
New version. Holy moly. BINARY-LONG data representation really is a performance changing choice.
This version comes with a question still. Is the logical OR operation in ONE-WAY still safe for the TEST-CASE(B-COUNT:1) ? Does the OR short-circuit - meaning there is no need to check the other condition?
By the way, changing B-COUNT from pic 99999 to binary-long had a huge impact on the performance values on this PC. So much so, I cranked up the time to loop by an order of magnitude.
Oh, and thanks Roger, light bulbs came on yesterday re the VARYING clause. (Aside from feeling like an idiot) Thanks.
Cheers,
Brian
[code]
PERFORM varying: 9ticks, +000000062
INSPECT reverse: 34ticks, +000000062
INSPECT trailing: 27ticks, +000000062
Trim and length: 15ticks, +000000062
[/code]
[code]
>>SOURCE FORMAT IS FREE
*> Author: Brian Tiffin for the OpenCOBOL Project
*> Dated: 11-July-2008
*> Purpose: Count trailing spaces
*> Tectonics: cobc trailingsp.cob
*> cobcrun trailingsp
*> Note: hard coded loop profiler, results will vary.
*> Logic errors corrected thanks to Roger While
IDENTIFICATION DIVISION.
PROGRAM-ID. trailingsp.
DATA DIVISION.
WORKING-STORAGE SECTION.
78 TIMES-TO-PROFILE VALUE 100000.
01 START-PROFILE USAGE BINARY-LONG.
01 END-PROFILE USAGE BINARY-LONG.
01 SHOW-PROFILE PIC Z(5)9.
01 TITLE-PROFILE PIC X(18).
01 WAY PIC 9.
01 B-COUNT USAGE BINARY-LONG VALUE 0.
01 TEST-HOLDER.
02 TEST-HEAD PIC XXX.
02 TEST-CASE PIC X(80)
VALUE "This is my string.".
PROCEDURE DIVISION.
PERFORM VARYING WAY FROM 1 BY 1
UNTIL WAY > 4
ACCEPT START-PROFILE FROM TIME END-ACCEPT
EVALUATE WAY
WHEN 1
MOVE "PERFORM varying: " TO TITLE-PROFILE
PERFORM ONE-WAY TIMES-TO-PROFILE TIMES
WHEN 2
MOVE "INSPECT reverse: " TO TITLE-PROFILE
PERFORM TWO-WAY TIMES-TO-PROFILE TIMES
WHEN 3
MOVE "INSPECT trailing: " TO TITLE-PROFILE
PERFORM THREE-WAY TIMES-TO-PROFILE TIMES
WHEN 4
MOVE "Trim and length: " TO TITLE-PROFILE
PERFORM FOUR-WAY TIMES-TO-PROFILE TIMES
END-EVALUATE
ACCEPT END-PROFILE FROM TIME END-ACCEPT
SUBTRACT
START-PROFILE FROM END-PROFILE GIVING START-PROFILE
END-SUBTRACT
MOVE START-PROFILE TO SHOW-PROFILE
DISPLAY
TITLE-PROFILE SHOW-PROFILE "ticks, " B-COUNT
END-DISPLAY
END-PERFORM.
GOBACK.
*> ******************************************************************
ONE-WAY.
PERFORM VARYING B-COUNT FROM LENGTH OF TEST-CASE BY -1
UNTIL (B-COUNT < 1)
OR (TEST-CASE(B-COUNT:1) NOT EQUAL SPACE)
END-PERFORM
SUBTRACT
B-COUNT FROM LENGTH OF TEST-CASE GIVING B-COUNT
END-SUBTRACT
.
TWO-WAY.
MOVE ZERO TO B-COUNT
INSPECT FUNCTION REVERSE(TEST-CASE)
TALLYING B-COUNT
FOR ALL LEADING ' '
.
THREE-WAY.
MOVE ZERO TO B-COUNT
INSPECT TEST-CASE
TALLYING B-COUNT
FOR TRAILING SPACE
.
FOUR-WAY.
COMPUTE
B-COUNT = LENGTH TEST-CASE -
FUNCTION LENGTH(FUNCTION TRIM(TEST-CASE TRAILING))
END-COMPUTE
.
[/code]
----------------------------------------------------------------
Yes, if the condition to the left of the OR evaluates to TRUE, then the complete condition is TRUE and anything to the right is not evaluated. This is exactly what C does.
Note however this is NOT true for AND. Conditions joined
with AND may be evaluated in any order (Once again exactly as C does).
I plan to to post on the Cobol Quiz thread a nice example of this :-)
Not that it will bring much is this case, but you could also define "WAY" as BINARY-LONG.
As to the timing results, they are to be expected.
TWO/THREE/FOUR-WAY involve calls to (potentially compilcated) OC library routines whereas ONE-WAY is
effectively inline. It IS totally inline if you specify
the maximum optimization option (-O2) to the compile
(And you might squeeze another few ticks out of it).
Roger
----------------------------------------------------------------
I'll add a FAQ entry regarding the AND / OR evaluation predictability just to clarify for everyone.
On profiling; Is there anything better than the 100th of a second resolution of ACCEPT from TIME?
Hard coded profile loops seem a little bit grade-school along with being completely tied to hardware (and mine is usually not-current). So is there any way to get access to the HI-RES clock values? clock_gettime and clock_getres? clock_settime being outside what would be needed.
Cheers,
Brian
----------------------------------------------------------------
Well the AND/OR is a fundamental part of the COBOL language.
Re HI-RES.
Take off your Linux hat and put on your Posix/Windows hat :-)
clock_gettime does not exist on Win.
(I am not sure what the alternative is)
Even on some Posix systems it may not actually be present
(Some versions of MinGW, Solaris, MacOS, etc.)
Even then, assuming it is present, we need help from the OC configure to determine in what library it is defined.
It may be in the standard C library (libc), it may be in the realtime library (librt and therefore we need -lrt) or
it maybe somewhere else.
Having determined some compatible way to get around all of this, there remains the question of what we should return.
We cannot return a nanosecond value based on the absolute values returned by clock_gettime. The seconds and nanosecond values are times since the Epoch (1970 generally). This means that the secs value is already 10 digits. If we multiply up and add nsecs, we are already overflowing a BINARY-DOUBLE (AKA PIC S9(18) COMP-5).
Theoretically, we could, at execution start, prime up a static variable/structure and return a relative nanosec
value relative to this value.
Roger
----------------------------------------------------------------
Re: Profile timing
I'm not sure if this is really worth pursuing but I found this snippet while searching about for QueryPerformanceCounter
http://dev.mysql.com/sources/doxygen/mysql-5.1/my__getsystime_8c.html
A more complete picture of the sources with the GNU copyright
http://www.google.ca/codesearch?hl=en&q=my_getsystime+show:86kJT-M0wB8:8rR33jnAci0:U49IKPVTOlg&source=universal&cs_p=http://ftp.osuosl.org/pub/nslu2/sources/mysql-4.1.18.tar.gz&cs_f=mysql-4.1.18/mysys/my_getsystime.c#l24
Who made the world such a complicated place? :)
Cheers,
Brian
----------------------------------------------------------------
Everyone;
After finding out some details on FUNCTION TRIM, and a zero-length field issue, FUNCTION TRIM will always result in at least one character, so a trim of all spaces will result in one space. The sample was data dependency broken.
Before the code dump, I'd like to highlight some profiling numbers of note.
The PERFORM VARYING with native data representation really kicks.
[code]
$ ./trailingsp
PERFORM varying: 9ticks, +000000062
INSPECT reverse: 32ticks, +000000062
INSPECT trailing: 28ticks, +000000062
Trim and length: 15ticks, +000000062
[/code]
With MOVE SPACES TO TEST-CASE.
[code]
$ ./trailingsp
PERFORM varying: 12ticks, +000000080
INSPECT reverse: 42ticks, +000000080
INSPECT trailing: 34ticks, +000000080
Trim and length: 5ticks, +000000080
[/code]
[code]
>>SOURCE FORMAT IS FREE
*> Author: Brian Tiffin for the OpenCOBOL Project
*> Dated: 11-July-2008
*> Purpose: Count trailing spaces
*> Tectonics: cobc trailingsp.cob
*> cobcrun trailingsp
*> Note: hard coded loop profiler, results will vary.
*> Logic errors corrected thanks to Roger While;
*> original did not properly test reference index in ONE-WAY.
*> Issue of zero-length fields and the result of the trim function
*> on all space fields was explained. The FUNCTION TRIM will
*> return at least one space to avoid potential problems.
IDENTIFICATION DIVISION.
PROGRAM-ID. trailingsp.
DATA DIVISION.
WORKING-STORAGE SECTION.
78 TIMES-TO-PROFILE VALUE 100000.
01 START-PROFILE USAGE BINARY-LONG.
01 END-PROFILE USAGE BINARY-LONG.
01 SHOW-PROFILE PIC Z(5)9.
01 TITLE-PROFILE PIC X(18).
01 WAY PIC 9.
01 B-COUNT USAGE BINARY-LONG VALUE 0.
01 TEST-HOLDER.
02 TEST-HEAD PIC XXX.
02 TEST-CASE PIC X(80)
VALUE "This is my string.".
PROCEDURE DIVISION.
MOVE SPACES TO TEST-CASE.
PERFORM VARYING WAY FROM 1 BY 1
UNTIL WAY > 4
ACCEPT START-PROFILE FROM TIME END-ACCEPT
EVALUATE WAY
WHEN 1
MOVE "PERFORM varying: " TO TITLE-PROFILE
PERFORM ONE-WAY TIMES-TO-PROFILE TIMES
WHEN 2
MOVE "INSPECT reverse: " TO TITLE-PROFILE
PERFORM TWO-WAY TIMES-TO-PROFILE TIMES
WHEN 3
MOVE "INSPECT trailing: " TO TITLE-PROFILE
PERFORM THREE-WAY TIMES-TO-PROFILE TIMES
WHEN 4
MOVE "Trim and length: " TO TITLE-PROFILE
PERFORM FOUR-WAY TIMES-TO-PROFILE TIMES
END-EVALUATE
ACCEPT END-PROFILE FROM TIME END-ACCEPT
SUBTRACT
START-PROFILE FROM END-PROFILE GIVING START-PROFILE
END-SUBTRACT
MOVE START-PROFILE TO SHOW-PROFILE
DISPLAY
TITLE-PROFILE SHOW-PROFILE "ticks, " B-COUNT
END-DISPLAY
END-PERFORM.
GOBACK.
*> ******************************************************************
ONE-WAY.
PERFORM VARYING B-COUNT FROM LENGTH OF TEST-CASE BY -1
UNTIL (B-COUNT < 1)
OR (TEST-CASE(B-COUNT:1) NOT EQUAL SPACE)
END-PERFORM
SUBTRACT
B-COUNT FROM LENGTH OF TEST-CASE GIVING B-COUNT
END-SUBTRACT
.
TWO-WAY.
MOVE ZERO TO B-COUNT
INSPECT FUNCTION REVERSE(TEST-CASE)
TALLYING B-COUNT
FOR ALL LEADING ' '
.
THREE-WAY.
MOVE ZERO TO B-COUNT
INSPECT TEST-CASE
TALLYING B-COUNT
FOR TRAILING SPACE
.
FOUR-WAY.
IF TEST-CASE EQUAL SPACES
COMPUTE B-COUNT = LENGTH OF TEST-CASE
ELSE
COMPUTE
B-COUNT = LENGTH OF TEST-CASE -
FUNCTION LENGTH(FUNCTION TRIM(TEST-CASE TRAILING))
END-COMPUTE
END-IF
.
[/code]
Cheers
----------------------------------------------------------------
Playing with the SYSTEM library service
Cheers
[code]
>>SOURCE FORMAT IS FREE
*> *********************************************************************
*> Author: Brian Tiffin
*> Date: 19-July 2008
*> Purpose: Play with SYSTEM CALL
*> Tectonics: cobc -x systemcall.cbl
*> ./systemcall cat say.cob
*> easily broken, ./systemcall vi would probably do.
identification division.
program-id. systemcall.
environment division.
input-output section.
file-control.
select optional pipefile
assign to tmpfile
organization is line sequential.
data division.
file section.
fd pipefile.
01 pipedata pic x(80).
working-storage section.
01 pipestatus pic 9.
88 endofpipe value high-values.
01 stat pic s9(9).
01 commands pic x(256).
01 arguments pic x(241).
01 tmpfile pic x(1024).
*> redirect a system call to a temp file and display results
procedure division.
accept arguments from command-line.
if arguments equal spaces
move "ls" to arguments
end-if.
call "tmpnam" using tmpfile
returning stat.
if stat = 0
display "tmpnam: |" stat "|" end-display
end-if.
string function trim(arguments trailing) delimited by size
" > " delimited by size
tmpfile delimited by space
low-value delimited by size
into commands
end-string.
display "|" function trim(commands trailing) "|" end-display.
call "SYSTEM" using function trim(commands trailing) returning stat.
if stat not = 0
display "SYSTEM: |" stat "|" end-display
end-if.
open input pipefile.
read pipefile
at end move high-values to pipestatus
end-read.
if pipestatus not equal high-values
display "|" pipedata "|" end-display
end-if.
perform
until pipestatus = high-values
read pipefile
at end move high-values to pipestatus
end-read
if pipestatus not = high-values
display "|" pipedata "|" end-display
end-if
end-perform.
close pipefile.
call "remove" using tmpfile returning stat.
if stat not = 0
display "remove: |" stat "|" end-display
end-if.
goback.
[/code]
using cat say.cob, should look something like
[code]
$ ./systemcall cat say.cob
|cat say.cob > /tmp/fileLir4y3|
| IDENTIFICATION DIVISION. |
| PROGRAM-ID. say. |
| ENVIRONMENT DIVISION. |
| DATA DIVISION. |
| LINKAGE SECTION. |
| 01 HELLO PIC X(6). |
| 01 WORLD PIC X(6). |
| PROCEDURE DIVISION USING HELLO WORLD. |
| DISPLAY HELLO WORLD. |
| EXIT PROGRAM. |
| |
[/code]
----------------------------------------------------------------
Subject: Tips and Tricks
Hello everyone,
Starting another thread. This one to collect OpenCOBOL user tips, tricks and warnings.
The plan ([i]if anyone likes the idea[/i]) is to add a section to the wiki and the Texinfo sources. Tips and tricks from a COBOL perspective, a development angle, conversion and migration shortcuts or anything that makes life with OpenCOBOL more fun than it already is.
Things like
[i]vim editor ex filter resequencer using perl[/i]
[code]
:%!perl -ne 'printf("\%06d\%s", $. * 10, substr($_, 6, -1) . "\n");'
[/code]
If you think it's a worthwhile proposal, post some snippets of wisdom and I'll try and put something together.
Cheers
----------------------------------------------------------------
Subject: OpenCOBOL GPL legalese question
Hello everyone,
Not being a lawyer I was wondering if anyone could offer advice on copyright, indemnification notices and possibly stashing them away in copylib text instead of inline.
given;
[code] *> **************************************************************
*>
*> Copyright (C) 2008 The OpenCOBOL Project
*>
*> This program is free software; you can redistribute it and/or
*> modify it under the terms of the GNU General Public License as
*> published by the Free Software Foundation; either version 2,
*> or (at your option) any later version.
*>
*> This program is distributed in the hope that it will be
*> useful, but WITHOUT ANY WARRANTY; without even the implied
*> warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
*> PURPOSE. See the GNU General Public License for more details.
*>
*> You should have received a copy of the
*> GNU General Public License along with this software;
*> see the file COPYING. If not, write to
*> the Free Software Foundation, 51 Franklin Street, Fifth Floor
*> Boston, MA 02110-1301 USA
*> **************************************************************
[/code]
Would it be appropriate to have this in a COPY file? For instance, COPYLEFT-2008.CPY
[code]
* Include Free Software Notice
COPY COPYLEFT-2008.
[/code]
Or does it need to be in the actual sources for lawyers to not go after Roger when one of the community samples bones up someone's multi-million dollar PC database? Not that that will ever happen; this is Murphy CYA imho.
The other question is; is there a "The OpenCOBOL Project"? or should community contributions just put all the grief on Roger's shoulders and pass it on as
[code]Copyright (C) 2008 Roger While[/code]
? or is there another way to copyleft something into the OpenCOBOL community without going as far as Public Domain?
In my opinion the
[code]AUTHOR. author-name.[/code]
entry in the IDENTIFICATION DIVISION gives ample credit where credit is due, but these are legal questions, so I thought I'd ask here.
Please excuse the interruption.
Cheers
----------------------------------------------------------------
btiffin,
For the best way to place your copyright notice the Free Software Foundation has guidelines here:
http://www.gnu.org/licenses/gpl-howto.html
------
Now regarding whether you should place the notice
Copyright (C) 2008 Roger While
in programs you create. In the USA as soon as you have committed a work to fixed format, it is immediately copyrighted to you, with or without a copyright notice.
Any changes you make to the files that Roger and the others have created, become a derivative work of their work. The GNU GPL grants you a license to make such changes. The changes would be copyrighted by you.
Many projects to ease the notice of credit, rather than adding the names of the authors of each change to every file, list these in a separate file. I am not sure if Roger and the rest of the OC crew are doing this, but I think they are.
If you create COBOL programs with OC, those programs are your work. So in that case you should note yourself as the copyright holder. In the USA you can assign copyrights to another, giving up your right to them. Usually there has to be some "consideration" for this to occur. Such as payment or trade of some sort. In addition any works you create in the USA are most often (unless stipulated otherwise by a contract) are work for hire and copyrighted by the person or company that is paying you.
In some parts of the world an author also has moral rights. I've not figured out just what this means exactly, but as I understand those cannot even be given up.
Hope this helps.
----------------------------------------------------------------
Thanks.
Yeah, the howto page is where I snagged the text (before formatting it fixed, nothing past column 72).
Your information does fill in some holes, but I'd like to keep the question open. Is it worthwhile worrying about transferring the copylefts to some group entity?
Cheers
----------------------------------------------------------------
Sometimes it is worth transferring if you wish to see that your copyleft is enforced in the event that you would be unable to do so in the future. Sometimes people transfer this right to the Free Software Foundation just for this purpose.
Also regarding my earlier comment about Moral Rights not being able to be given up, this doesnt mean that some of your copyrights cant be given up. They can. Just the moral rights are retained, something we don't have in the USA so I've not taken time to educate myself on them just yet.
----------------------------------------------------------------
Subject: Problems linking to libcurl
Hello,
As an experiment, I was playing with libcurl.so and it's beating me. Something (me probably) is trashing ram getting to the curl_easy_perform(handle) call.
[code]
identification division.
program-id. showcurl.
author. Brian Tiffin.
data division.
working-storage section.
01 handle usage is pointer.
01 result pic s9(8) comp-5.
01 url.
02 filler pic x(20) value 'http://opencobol.org'.
02 filler pic x(1) value X"00".
01 str-ptr usage is pointer.
linkage section.
01 current-url pic x(21).
procedure division.
* 3 is CURL_GLOBAL_ALL
call "curl_global_init" using by value 3
returning result.
call "curl_easy_init" returning handle.
display "handle: " handle.
* 10002 is CURLOPT_URL
call "curl_easy_setopt" using handle
by value 10002
by reference url
returning result.
display "set url: " result.
* Prove the curl handle is getting information
* 1048577 is CURLINFO_EFFECTIVE_URL
call "curl_easy_getinfo" using handle
by value 1048577
by reference str-ptr
returning result.
set address of current-url to str-ptr.
display "get url: " result ", " current-url.
* memory trashed by something
call "curl_easy_perform" using handle
returning result.
exit program.
stop run.
[/code] The call to curl_easy_perform segfaults or depending on the wind, detects heap corruption with a dump.
[code]
$ cobc -x -lcurl showcurl.cob
[/code]
On this dump, I've masked the actual addresses with &&&
[code]
handle: 0x080585e0
set url: +00000000
get url: +00000000, http://opencobol.org.
*** glibc detected *** ./showcurl: free(): invalid pointer: 0x&&&&&&&& ***
======= Backtrace: =========
/lib/i686/cmov/libc.so.6[0x&&&&&&&&]
/lib/i686/cmov/libc.so.6(cfree+0x90)[0x&&&&&&&&]
/usr/lib/libcurl.so.4[0x&&&&&&&&]
/usr/lib/libcurl.so.4[0x&&&&&&&&]
/usr/lib/libcurl.so.4[0x&&&&&&&&]
/usr/lib/libcurl.so.4[0x&&&&&&&&]
/usr/lib/libcurl.so.4(curl_easy_perform+0x43)[0x&&&&&&&&]
./showcurl[0x&&&&&&&&]
./showcurl(showcurl+0x12)[0x&&&&&&&&]
./showcurl(main+0x27)[0x&&&&&&&&]
/lib/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0x&&&&&&&&]
./showcurl[0x&&&&&&&&]
============================
[/code]
OC1.1 from a few days ago. libcurl 7.18.2 (SSL), Debian 4 lenny. And I'll admit, that I may well be passing things around incorrectly. The code simply segfaults at the point of the curl_easy_perform call (with -ftraceall or -g), or produces this dump without those compile options.
[i]On the display, I'm a little unsure if the null terminator on the dereference of current-url is proper; DISPLAY seems to convert them to a period X"2e". (I think.)[/i]
The expectation is that the HTML from the given URL is sent raw to stdout. The simple.c example from the libcurl site works fine here. So it leads me to believe I'm doing something wrong.
I've got a curlwrap.c that does the init, set and perform in a single C function and calling it from OC works great, but I'd appreciate any hints on what I may be doing wrong between shared library calls.
libcurl seems like a great path to web enabling OC with little fuss.
Cheers
----------------------------------------------------------------
OK. A couple of things here.
The basic problem is handling/passing a
POINTER type.
Remember that reference to a POINTER item
is the address of the Cobol item NOT the content
of the item.
The way to get this working is to use the
BY VALUE phrase.
HOWEVER, there is/was a (non)bug in OC whereby
passing a POINTER by VALUE did not do the correct thing.
Fixed today in current OC 1.1 tarball.
(I say non-bug, because it is non-standard).
Then change all references of USING handle to
USING BY VALUE handle.
Then it should work.
Note - libcurl is spectacularly unforgiving in
it's parameter interpretation (It's even documented
as such). One wrong param or even one wrong bit in a param and it is likely to blow in an explosive manner :-)
There are anyway problems in using libcurl from Cobol as
many params in libcurl are of "long" type. This, of course,
is dependent on 32/64 bit. (Of course, C is no problem).
The safe way to do this is through wrapper functions
(If you are careful what you pass from Cobol and type cast appropiately).
Roger
----------------------------------------------------------------
Woohoo!
Thanks yet again Mr While. You sure make working in OC a productive and educational experience.
Yeah, I had tried to get my head around by value, by content and by reference and experimented with them all while looking at the generated C code. The new release works like a charm and what I thought should work works. First try and OpenCOBOL displayed the opencobol.org webpage. Now to try and build something real while exploring.
I was leaning towards the idea of "thick" wrappers that did a sequence of the libcurl calls inside C functions, but that has a pre-guessing developer intent downside. Now, from what you mentioned, thin wrappers will only need to be added if/when a stack parameter needs a little help. This is awesome.
Cheers
And Happy Canada Day from Ottawa. It's our birthday.
----------------------------------------------------------------
Hello Brian,
This is really an educational experience. Can you post your program after corrections. I never heard about libcurl before !
Best regards
Bear
----------------------------------------------------------------
Bear; why yes I can.
[code]
identification division.
program-id. showcurl.
author. Brian Tiffin.
data division.
working-storage section.
01 handle usage is pointer.
01 result pic s9(8) comp-5.
01 url.
02 filler pic x(20) value 'http://opencobol.org'.
02 filler pic x(1) value X"00".
01 str-ptr usage is pointer.
linkage section.
01 current-url pic x(21).
procedure division.
* 3 is CURL_GLOBAL_ALL
call "curl_global_init" using by value 3
returning result.
call "curl_easy_init" returning handle.
display "handle: " handle.
* 10002 is CURLOPT_URL
call "curl_easy_setopt" using by value handle
by value 10002
by reference url
returning result.
display "set url: " result.
* Prove the curl handle is getting information
* 1048577 is CURLINFO_EFFECTIVE_URL
call "curl_easy_getinfo" using by value handle
by value 1048577
by reference str-ptr
returning result.
set address of current-url to str-ptr.
display "get url: " result ", " current-url.
* default operations is read the url and send to stdout
call "curl_easy_perform" using by value handle
returning result.
display "perform: " result.
* Clean up
call "curl_easy_cleanup" using by value handle.
exit program.
stop run.
[/code]
I'll be setting up the manifest constants as symbols soon.
[code]
$ cobc -lcurl -x showcurl.cob
$ ./showcurl
$# Note; needs OC 1.1 tarball posted after June 30th.
[/code]
Sends the raw HTML of opencobol.org to stdout. libcurl provides a plethora of web enabling options.
http://curl.haxx.se/libcurl/ for more info, but highlights include FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS and FILE. libcurl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, Kerberos4), file transfer resume, http proxy tunneling and more!
On my Debian box, I installed libcurl4-openssl-dev to get at the header files. And that version of libcurl supports the https, and secure ftp etc. The libcurl3 runtime package was already installed, as [i]curl[/i] is a handy GNU/Linux command to have.
There will be some work involved in getting true and proper OpenCOBOL bindings, but a worthy effort imho. And I'll be experimenting with getting data to files for COBOL reading or using the libcurl callbacks to get usable memory buffers.
Cheers
P.S. Bear, I'm hoping to get permission to include your source code postings into the hopefully soon forthcoming OpenCOBOL Copylib samples and examples collection. :)
----------------------------------------------------------------
Thank you Brian,
I tested your program, Debian Etch, tarball from July 1st & libcurl3-openssl.
I will be very glad to see my code in samples & examples. It is so useful to find tips & tricks in cobol for beginners. We are all beginners in something ;-)
Bear
----------------------------------------------------------------
Thanks to you Bear. Here is another one. This one accepts the url from the command line. If no arg, prompts for it. If no data comes from the prompt, then use a default.
[code]
>>SOURCE FORMAT IS FIXED
*> **************************************************************
*>
*> Copyright (C) 2008 The OpenCOBOL Project
*>
*> This program is free software; you can redistribute it and/or
*> modify it under the terms of the GNU General Public License as
*> published by the Free Software Foundation; either version 2,
*> or (at your option) any later version.
*>
*> This program is distributed in the hope that it will be
*> useful, but WITHOUT ANY WARRANTY; without even the implied
*> warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
*> PURPOSE. See the GNU General Public License for more details.
*>
*> You should have received a copy of the
*> GNU General Public License along with this software;
*> see the file COPYING. If not, write to
*> the Free Software Foundation, 51 Franklin Street, Fifth Floor
*> Boston, MA 02110-1301 USA
*> **************************************************************
identification division.
program-id. showcurl.
author. Brian Tiffin.
data division.
working-storage section.
01 handle usage is pointer.
01 result pic s9(8) comp-5.
01 url.
02 filler pic x(20) value 'http://opencobol.org'.
02 filler pic x(1) value X"00".
01 user-url pic x(80).
01 ind pic 99.
01 str-ptr usage is pointer.
01 display-url pic x(80).
linkage section.
01 current-url pic x(80).
procedure division.
* 3 is CURL_GLOBAL_ALL
call "curl_global_init" using by value 3
returning result.
call "curl_easy_init" returning handle.
display "handle: " handle.
* Get a url from the user or command line
accept user-url from command-line.
if user-url equal spaces then
display "url: " with no advancing
accept user-url
if user-url equal spaces then
move url to user-url
end-if
end-if.
* take first piece as the actual url
string user-url delimited by space into display-url.
move display-url to user-url.
* get the real length
perform varying ind from length user-url by -1
until user-url(ind:1) not equal space
end-perform.
* Add a C null byte
if ind equal length user-url then
subtract 1 from length user-url giving ind.
move X"00" to user-url(ind + 1:1).
* tell cURL the url
* 10002 is CURLOPT_URL
call "curl_easy_setopt" using by value handle
by value 10002
by reference user-url
returning result.
display "set url: " result.
* Prove the curl handle is getting information
* 1048577 is CURLINFO_EFFECTIVE_URL
call "curl_easy_getinfo" using by value handle
by value 1048577
by reference str-ptr
returning result.
set address of current-url to str-ptr.
* skip the null terminator for display
string current-url delimited by low-value
into display-url.
display "get url: " result ", " display-url.
* default operations is read the url and send to stdout
call "curl_easy_perform" using by value handle
returning result.
display "perform: " result.
* Clean up
call "curl_easy_cleanup" using by value handle.
exit program.
stop run.
[/code]
Example runs
[code]
$ ./showcurl wanip.org
handle: 0x08059630
set url: +00000000
get url: +00000000, wanip.org
99.241.xxx.xxx
perform: +00000000
$ ./showcurl
handle: 0x08059630
url: wanip.org
set url: +00000000
get url: +00000000, wanip.org
99.241.xxx.xxx
perform: +00000000
$ ./showcurl wanip.org and then other command line stuff
handle: 0x08059630
set url: +00000000
get url: +00000000, wanip.org
99.241.xxx.xxx
perform: +00000000
$ ./showcurl
handle: 0x08059630
url: somekindajunkurl
set url: +00000000
get url: +00000000, somekindajunkurl
perform: +00000006
[/code]
I obfuscated my displayed ip address a little bit
Cheers
P.S. OpenCOBOL is a blast! :)
----------------------------------------------------------------
Brian, if you are going to follow up on this curl stuff,
it might be useful to have a copy proc for the curl constants. eg.
78 CURLOPT_URL VALUE 10002.
(I assume these are constant among installs?)
The 78 level is not a standard but is in wide use. Comes from MF and defines constant items. References get replaced at compile time. (See copy/screenio.cpy for example of ACCEPT exception codes)
Re. my thoughts about the "long" type. It is a pity
that Cobol does not have a USAGE that varies in length
according to 32/64 bit installation (As POINTERS do).
Hmm, I wonder if we can adapt the 2002 bin field syntax a bit for a new type. 2002 bin (ie. COMP-5) fields are -
BINARY-[CHAR, SHORT, LONG, DOUBLE] SIGNED/UNSIGNED corresponding to 1, 2, 4, 8 bytes native integers signed or unsigned (ie. PIC [S]9(n) COMP-5 where n is 1, 4, 8, 18
respectively). (Note SIGNED is the default)
Hmm, how about BINARY-C-LONG [SIGNED/UNSIGNED] giving
4 or 8 bytes depending on 32/64 bit implementation.
Should be relatively easy to do and would seem to be quite
useful.
Roger
----------------------------------------------------------------
Yes, I do plan on following up and working out the manifest and runtime constants.
I'll have to investigate, but I hope (and assume) the typedef enums are constant and consistent across platforms/releases. Getting at most of them is a pain. They are generated by preprocessor macros and are not a simple read and port to COBOL. I got at the 10002 and the CURLOPT_URL by using printf.
Same goes for error codes, though at least those are listed in curl.h as simple values. So I'll make up an error message table of some form or other as well (probably simple English only at first).
I like the idea of datatyping the 4 or 8 byte (or other) requirements on the COBOL side and not having to worry about extra layers of wrapper. Anything you could work out would be marvelous.
I'll know a lot more about the potential headaches over the next couple of days. The next step is to try and work out some of the callbacks and to use some operations a little more sophisticated than the manual (and relatively easy) experiments I've done so far.
Cheers
And once again; thank you sir.
----------------------------------------------------------------
OK.
Current tarball has a speculative implementation of
USAGE BINARY-C-LONG (SIGNED/UNSIGNED). SIGNED is default
and does not have to be specified.
Therefore, if you are interfacing to some stupid library
that has "long"s as params, then you can -
01 MYCLONG USAGE BINARY-C-LONG.
CALL "blahblah" USING BY VALUE MYCLONG.
Which will generate the appropiate 4/8 byte values depending on OC generation.
Roger
----------------------------------------------------------------
Yet again; that's awesome Roger!
Questions for everyone:
I've started a COPY source file for the libcurl bindings, but I'd like some opinions before proceeding too far.
The result codes are sequentially numbered constants in curl.h but I'd also like to provide a corresponding error message string. Not too sure the best way to proceed with this.
Once I get past this, I'll be writing a C program to generate the curlsym.cpy file. It'll just be easier in the long run that way, and it'll save trying to manually figure out the constants from the curl.h preprocessor macros.
By the way ... the first (or second) libcurl app I plan on writing is an OpenCOBOL program to download the current 1.1 tarball. :)
[code]
*> manifest constants for libcurl bindings
*> Usage: COPY curlsym inside data division
*> Result codes
78 CURLE_OK VALUE 0.
*> Error codes
78 CURLE_UNSUPPORTED_PROTOCOL value 1.
78 CURLE_FAILED_INIT value 2.
78 CURLE_URL_MALFORMAT value 3.
78 CURLE_OBSOLETE4 value 4.
78 CURLE_COULDNT_RESOLVE_PROXY value 5.
78 CURLE_COULDNT_RESOLVE_HOST value 6.
78 CURLE_COULDNT_CONNECT value 7.
78 CURLE_FTP_WEIRD_SERVER_REPLY value 8.
*> Error strings
01 LIBCURL_ERRORS.
02 CURLEVALUES.
03 filler pic x(30) VALUE "CURLE_UNSUPPORTED_PROTOCOL ".
03 filler pic x(30) VALUE "CURLE_FAILED_INIT ".
03 filler pic x(30) VALUE "CURLE_URL_MALFORMAT ".
03 filler pic x(30) VALUE "CURLE_OBSOLETE4 ".
03 filler pic x(30) VALUE "CURLE_COULDNT_RESOLVE_PROXY ".
03 filler pic x(30) VALUE "CURLE_COULDNT_RESOLVE_HOST ".
03 filler pic x(30) VALUE "CURLE_COULDNT_CONNECT ".
03 filler pic x(30) VALUE "CURLE_FTP_WEIRD_SERVER_REPLY ".
01 filler redefines LIBCURL_ERRORS.
02 CURLEMSG occurs 8 times pic x(30).
*> global init constants
78 CURL_GLOBAL_ALL VALUE 3.
*> curl set option constants
78 CURLOPT_URL VALUE 10002.
*> libcurl get option constants
78 CURLINFO_EFFECTIVE_URL VALUE 1048577.
[/code]
The above is very incomplete...
Test usage...
[code]
>>SOURCE FORMAT IS FIXED
*> **************************************************************
*>
*> Copyright (C) 2008 The OpenCOBOL Project
*>
*> This program is free software; you can redistribute it and/or
*> modify it under the terms of the GNU General Public License as
*> published by the Free Software Foundation; either version 2,
*> or (at your option) any later version.
*>
*> This program is distributed in the hope that it will be
*> useful, but WITHOUT ANY WARRANTY; without even the implied
*> warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
*> PURPOSE. See the GNU General Public License for more details.
*>
*> You should have received a copy of the
*> GNU General Public License along with this software;
*> see the file COPYING. If not, write to
*> the Free Software Foundation, 51 Franklin Street, Fifth Floor
*> Boston, MA 02110-1301 USA
*> **************************************************************
*> Author: Brian Tiffin
*> Date: 02-Jul-2008
*> Purpose: Experiment with and test libcurl bindings
identification division.
program-id. showcurl.
data division.
working-storage section.
*> include the libcurl symbols
copy curlsym.
01 handle usage is pointer.
01 result pic s9(8) comp-5.
01 url.
02 filler pic x(20) value 'http://opencobol.org'.
02 filler pic x(1) value X"00".
01 user-url pic x(80).
01 ind pic 99.
01 str-ptr usage is pointer.
01 display-url pic x(80).
linkage section.
01 current-url pic x(80).
procedure division.
call "curl_global_init" using by value CURL_GLOBAL_ALL
returning result
end-call.
call "curl_easy_init" returning handle end-call.
display "handle: " handle end-display.
* Get a url from the user or command line
accept user-url from command-line end-accept.
if user-url equal spaces then
display "url: " with no advancing end-display
accept user-url end-accept
if user-url equal spaces then
move url to user-url
end-if
end-if.
* take first piece as the actual url
string user-url delimited by space into display-url end-string.
move display-url to user-url.
* get the real length
perform varying ind from length user-url by -1
until user-url(ind:1) not equal space
end-perform.
* Add a C null byte
if ind equal length user-url then
subtract 1 from length user-url giving ind end-subtract
end-if.
move X"00" to user-url(ind + 1:1).
* tell cURL the url, the only mandatory easy field
call "curl_easy_setopt" using by value handle
by value CURLOPT_URL
by reference user-url
returning result
end-call.
display "set url: " result end-display
* Prove the curl handle is getting information
call "curl_easy_getinfo" using by value handle
by value CURLINFO_EFFECTIVE_URL
by reference str-ptr
returning result
end-call.
set address of current-url to str-ptr.
* skip the null terminator for display
string current-url delimited by low-value
into display-url
end-string.
display "get url: " result ", " display-url end-display.
* default operations is read the url and send to stdout
call "curl_easy_perform" using by value handle
returning result
end-call.
if result not equal 0 then
display "perform: " result ", " CURLEMSG(result)
end-display
end-if.
* Clean up
call "curl_easy_cleanup" using by value handle end-call
exit program.
stop run.
[/code]
Along the lines of
[code]
$ ./showcurl somebadurl
handle: 0x08059630
set url: +00000000
get url: +00000000, somebadurl
perform: +00000006, CURLE_COULDNT_RESOLVE_HOST
[/code]
But I think the messages should be localized, and instead of RTFM, I thought I'd Ask A Friendly Human first.
Along with any hints about i18n and L10n, I have a question about a COPY source being FIXED of FREE form and how that should be handled?
Cheers
Brian
----------------------------------------------------------------
Looks good.
Some comments about libcurl.
I have never in all my life seen such an ill-conceived
interface. Packing everything including the dog's dinner into one call is insane (curl_easy_setopt).
Have you seen the prototype -
----------------------
#define curl_easy_setopt(handle, option, value) \
__extension__ ({ \
__typeof__ (option) _curl_opt = option; \
if (__builtin_constant_p(_curl_opt)) { \
if (_curl_is_long_option(_curl_opt) && !_curl_is_long(value)) \
_curl_easy_setopt_err_long(); \
if (_curl_is_off_t_option(_curl_opt) && !_curl_is_off_t(value)) \
_curl_easy_setopt_err_curl_off_t(); \
if (_curl_is_string_option(_curl_opt) && !_curl_is_string(value)) \
_curl_easy_setopt_err_string(); \
if (_curl_is_write_cb_option(_curl_opt) && !_curl_is_write_cb(value)) \
_curl_easy_setopt_err_write_callback(); \
if ((_curl_opt) == CURLOPT_READFUNCTION && !_curl_is_read_cb(value)) \
_curl_easy_setopt_err_read_cb(); \
if ((_curl_opt) == CURLOPT_IOCTLFUNCTION && !_curl_is_ioctl_cb(value)) \
_curl_easy_setopt_err_ioctl_cb(); \
if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION && !_curl_is_sockopt_cb(value))\
_curl_easy_setopt_err_sockopt_cb(); \
if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION && \
!_curl_is_opensocket_cb(value)) \
_curl_easy_setopt_err_opensocket_cb(); \
if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION && \
!_curl_is_progress_cb(value)) \
_curl_easy_setopt_err_progress_cb(); \
if ((_curl_opt) == CURLOPT_DEBUGFUNCTION && !_curl_is_debug_cb(value)) \
_curl_easy_setopt_err_debug_cb(); \
if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION && \
!_curl_is_ssl_ctx_cb(value)) \
_curl_easy_setopt_err_ssl_ctx_cb(); \
if (_curl_is_conv_cb_option(_curl_opt) && !_curl_is_conv_cb(value)) \
_curl_easy_setopt_err_conv_cb(); \
if ((_curl_opt) == CURLOPT_SEEKFUNCTION && !_curl_is_seek_cb(value)) \
_curl_easy_setopt_err_seek_cb(); \
if (_curl_is_cb_data_option(_curl_opt) && !_curl_is_cb_data(value)) \
_curl_easy_setopt_err_cb_data(); \
if ((_curl_opt) == CURLOPT_ERRORBUFFER && !_curl_is_error_buffer(value)) \
_curl_easy_setopt_err_error_buffer(); \
if ((_curl_opt) == CURLOPT_STDERR && !_curl_is_FILE(value)) \
_curl_easy_setopt_err_FILE(); \
if (_curl_is_postfields_option(_curl_opt) && !_curl_is_postfields(value)) \
_curl_easy_setopt_err_postfields(); \
if ((_curl_opt) == CURLOPT_HTTPPOST && \
!_curl_is_arr((value), struct curl_httppost)) \
_curl_easy_setopt_err_curl_httpost(); \
if (_curl_is_slist_option(_curl_opt) && \
!_curl_is_arr((value), struct curl_slist)) \
_curl_easy_setopt_err_curl_slist(); \
if ((_curl_opt) == CURLOPT_SHARE && !_curl_is_ptr((value), CURLSH)) \
_curl_easy_setopt_err_CURLSH(); \
} \
curl_easy_setopt(handle, _curl_opt, value); \
})
------------------------------------
And that only works for gcc. You do not get any sort
of (pseudo) type checking with any other C compiler.
Now back to Cobol use.
More and more I am tending to say design a loose wrapper for libcurl. Here are some points -
Let's start with the option parameter (eg. CURLOPT_URL) - defined as type "CURLoption".
This is not, as you may think, an "int". It is actually an
"enum". The C compiler is quite free to choose the resultant type after enumerating (sic) all the values. The only constraint is that the resultant type must be capable (obviously) of representing all the values.
The "long" problem has already been mentioned. Now comes, to add to the fun, size_t, ssize_t, off_t. This last (off_t) is used natively (as off_t) and as curls version curl_off_t. Add into the fun things like fd_set and the socket stuff and it really looks like a big headache to use libcurl directly from Cobol.
What is actually required is to define/design/implement a new binding for Cobol. (See Curl homepage for the 30 or so existing bindings /eg. Perl, Ada95, Pascal, etc.)
Roger
----------------------------------------------------------------
They certainly did go overboard in trying to make things "easy".
I've started a spec document. Thrash and swale now seems a poor way of attacking this one. It'll require a fair amount of background work before proceeding too fast into the proverbial painted corner. So, it is unlikely that there will anything of public release quality anytime soon. But, hopefully there will be usable little bits and pieces to post along the way.
I was a forther most of my professional career so I was using the SP-Forth "bindings" as a base to start from.
Thanks for the advice Roger. I still think libcurl will be a worthwhile toolkit for OC, and in the doing, may open doors to other major/minor library systems.
For now I think it is back to the main goal of getting some docs written. :)
Cheers
Brian
Edit; And yes you are right about the light wrapper. The OC libcurl bindings will be more appropriate as a module, not a direct interface to the the libcurl library itself.
----------------------------------------------------------------
Being the anal person I am, I made some changes while working with your very nice sample code.
I changed the code that adds the null terminator to just use STRING.
I also changed the call of "curl_easy_getinfo" to set the address of current-url directly in the call.
I also got rid of all of the unneeded statement terminators. They are needed only for conditional code, and in my opinion just clutter things up when used in other cases.
Also got rid of all of the 'then' clauses. Yuck! :-)
Oh, and changed the 'pic s9(8) comp-5' to the more modern usage 'binary-long'.
Anyway, nice program. Very useful!
[code]
>>SOURCE FORMAT IS FREE
identification division.
program-id. showcurl.
data division.
working-storage section.
*> include the libcurl symbols
copy curlsym.
01 handle usage is pointer.
01 result binary-long.
01 url.
02 filler pic x(20) value 'http://opencobol.org'.
02 filler pic x(1) value X"00".
01 user-url pic x(80).
01 display-url pic x(80).
linkage section.
01 current-url pic x(80).
procedure division.
call "curl_global_init" using by value CURL_GLOBAL_ALL
returning result
call "curl_easy_init" returning handle
display "handle: " handle
*> Get a url from the user or command line
accept user-url from command-line
if user-url equal spaces
display "url: " with no advancing
accept user-url
if user-url equal spaces
move url to user-url
end-if
end-if.
*> take first piece as the actual url
*> terminate with C null terminator
string user-url delimited by space
x"00" delimited by size
into display-url
move display-url to user-url
*> tell cURL the url, the only mandatory easy field
call "curl_easy_setopt" using by value handle
by value CURLOPT_URL
by reference user-url
returning result
display "set url: " result
*> Prove the curl handle is getting information
call "curl_easy_getinfo" using by value handle
by value CURLINFO_EFFECTIVE_URL
by reference address of current-url
returning result
*> skip the null terminator for display
string current-url
delimited by low-value
into display-url
display "get url: " result ", " display-url
*> default operations is read the url and send to stdout
call "curl_easy_perform" using by value handle
returning result
if result not equal 0
display "perform: " result ", " CURLEMSG(result)
end-if
*> Clean up
call "curl_easy_cleanup" using by value handle
goback.
[/code]
Frank
----------------------------------------------------------------
Thanks Frank. I learned a few new tricks with that one.
If you don't mind, your changes may well make it into the example/sample bundle (at Roger's leisure) that will probably grow along with OC development.
We'll have to work out a shared credit scheme soon, as I want to add some of Bear's work and other posted snippets as well. Umm, on approval of course; the copyrights being transferred being one issue, along with honouring everyone's right to privacy, anonymity or use of pseudonym in the credits if desired.
This kick at libcurl probably won't be the interface exposed to programmers if an actual binding layer is developed, but I think it may make a good demo of API calls and highlight the potential of OpenCOBOL.
Your version has a cleaner, fresher smelling quality to it. :)
Cheers
Brian
----------------------------------------------------------------
I'm not concerned about credit. You did all the hard work.
One additional change that might be interesting to others is to move current-url from the LINKAGE SECTION to the WORKING-STORAGE SECTION and make it a BASED data item. IE:
01 current-url pic x(80) based.
In my opinion the LINKAGE SECTION should be used only for data items that are also specified on the PROCEDURE DIVISION USING statement.
I understand why the LINKAGE SECTION is "mis-used" in this other manner, because it was required prior to the existance of the BASED clause. But now with BASED I prefer it this way.
Or maybe it's just because I helped BASED get implemented in to OpenCobol. (Wait, perhaps I do like to get credit. :-) )
Frank
----------------------------------------------------------------
Your updates got me thinking:
I'm using your enhanced version to write up a little piece on different ways of solving some problems and how handy the advancements can be.
And credits where credits due. :)
Thanks Frank.
Cheers,
Brian
----------------------------------------------------------------
Frank's comments are OK. However be careful with
scope terminators (END-xxx)
Here is (a not particularly good) example with the identation being what you think/want to happen -
[code]
CALL "blah"
ON EXCEPTION
DISPLAY "Blup"
NOT ON EXCEPTION
DISPLAY "Blup2"
END-CALL.
[/code]
However, that is NOT how it is parsed due to DISPLAY also
having an exception phrase. So it is actually -
[code]
CALL "blah"
ON EXCEPTION
DISPLAY "Blup"
NOT ON EXCEPTION
DISPLAY "Blup2"
END-CALL.
[/code]
Therefore to be strictly correct as meant it should be -
[code]
CALL "blah"
ON EXCEPTION
DISPLAY "Blup"
END-DISPLAY
NOT ON EXCEPTION
DISPLAY "Blup2"
END-DISPLAY
END-CALL.
[/code]
Roger
----------------------------------------------------------------
Subject: FAQ; Request for comments
Hello,
This is an initial cut of an OpenCOBOL FAQ using ReStructuredText. There are a few problems (the ReST interpreter could not handle some of the CLI options - so I flubbed them until I can figure out an explicit override) but I do like the readability of the raw source.
PLEASE NOTE: This is no where near a first release of the FAQ. Solely posted here for group comment before proceeding too far.
If you'd like to see the output HTML, install docutils, place this source in a directory ocfaq.txt and simply run rst-buildhtml (rst-buildhtml will scan the directory for any and all .txt files and produce .html outputs). Note, the ReST system will allow for CSS skinning and we'll be able to make this FAQ follow Look and Feel for the OpenCOBOL project.
[code]
=============
OpenCOBOL FAQ
=============
.. Attention:: This is only a test
:Authors:
Brian Tiffin [btiffin]_
(with the invaluable assistance of many others)
:Organization:
The OpenCOBOL Project
:Version:
0.0
:Status:
Experimental - Not for public release
:Copyright:
|copyleft|
OpenCOBOL
---------
Q. What is OpenCOBOL_?
OpenCOBOL is an open-source COBOL_ compiler. OpenCOBOL implements a
substantial part of the `COBOL 85`_ and `COBOL 2002`_ standards,
as well as many extensions of the existent COBOL compilers.
OpenCOBOL translates COBOL into C and compiles the translated code using
the native C compiler. You can build your COBOL programs on various
platforms, including Unix/Linux, Mac OS X, and Microsoft Windows.
Q. How is OpenCOBOL licensed?
The compiler is licensed under GNU General Public License.
The run-time library is licensed under GNU Lesser General Public License.
History
-------
Q. What is the development history of OpenCOBOL?
OpenCOBOL was initially developed by Keisuke Nishida [Keisuke]_ .
The first public release was version 0.9.0 on January 25th, 2002.
Development continued apace, with version 0.30 released by Keisuke on
August 8th, 2004.
Roger While then took up the role as lead developer on October 30th, 2004.
Version 0.31 was released February 1st, 2005.
Q. What is the current version of OpenCOBOL?
OpenCOBOL 1.0 was released December 27th, 2007 by Roger While [Roger]_
OpenCOBOL 1.1 pre-release is currently in active development, and can be
found at `OpenCOBOL 1.1`_
Using OpenCOBOL
---------------
Q. How does the OpenCOBOL compiler work?
OpenCOBOL is a command line driven compiler. It produces intermediate C
source code that is then passed to a configured C compiler, the GNU C
compiler, **gcc** being a standard.
The main tool, **cobc**, by defaulti, produces linkable object files.
Usage: cobc [options] file...
Options:
--help Display this message
--version, -V Display compiler version
-v Display the programs invoked by the compiler
-x Build an executable program
-m Build a dynamically loadable module (default)
--std= Compile for a specific dialect
--std=cobol2002 COBOL 2002
--std=cobol85 COBOL 85
--std=ibm IBM Compatible
--std=mvs MVS Compatible
--std=bs200 BS200 Compatible
--std=mf MicroFocus
--std=default See config/default.conf and config/`*`.conf
-free Use free source format
-fixed Use fixed source format default
-O, --O2, --Os Enable optimization
-g Produce debugging information in the output
-debug Enable all run-time error checking
-o Place the output into
-b Combine all input files into a single
dynamically loadable module
-E Preprocess only; do not compile, assemble or link
-C Translation only; convert COBOL to C
-S Compile only; output assembly file
-c Compile and assemble, but do not link
-t Generate and place a program listing into
-I Add to copybook search path
-L Add to library search path
-l Link the library
-D Pass to the C compiler
--conf= User defined dialect configuration - See -std=
--list-reserved Display all reserved words
-save-temps Do not delete intermediate files
--MT Set target file used in dependency list
--MF Place dependency list into
--ext Add default file extension
-Wall Enable all warnings
-Wobsolete Warn if obsolete features are used
-Warchaic Warn if archaic features are used
-Wcolumn-overflow Warn if any text after column 72
-Wredefinition Warn incompatible redefinition of data items
-Wconstant Warn inconsistent constant
-Wparentheses Warn lack of parentheses around AND within OR
-Wterminator Warn lack of scope terminator (END-XXX)
-Wstrict-typing Warn type mismatch strictly
-Wimplicit-define Warn implicitly defined data items
-Wcall-params Warn non 01/77 items for CALL params (NOT set with -Wall)
-Wtruncate Warn possible field truncation (NOT set with -Wall)
-ftrace Generate trace code (Executed SECTION/PARAGRAPH)
-ftraceall Generate trace code (Executed SECTION/PARAGRAPH/STATEMENTS)
-fsyntax-only Syntax error checking only; don't emit any output
-fstatic-call Output static function calls for the CALL statement
-fdebugging-line Enable debugging lines ('D' in indicator column)
-fsource-location Generate source location code (Turned on by -debug or -g)
-fimplicit-init Do automatic initialization of the Cobol runtime system
-fstatic-linkage Statically allocate non-USING LINKAGE parameters
-fsign-ascii Numeric display sign ASCII (Default on ASCII machines)
-fsign-ebcdic Numeric display sign EBCDIC (Default on EBCDIC machines)
-fstack-check PERFORM stack checking (Turned on by -debug or -g)
-ffold-copy-lower Fold COPY subject to lower case (Default no transformation)
-ffold-copy-upper Fold COPY subject to upper case (Default no transformation)
-fnotrunc Do not truncate binary fields according to PIC (ala MF)
-fnull-param Pass extra NULL terminating pointers on CALL statements
Authors
-------
.. [Keisuke] Keisuke Nishida
Initial developer and creator of OpenCOBOL
.. [Roger] Roger While
OpenCOBOL 1.1 is currently in development, and Roger is the lead programmer.
.. [btiffin] Brian Tiffin
Initial FAQ
.. _OpenCOBOL: http://opencobol.org/
.. _`OpenCOBOL 1.1`: http://www.opencobol.org/modules/mydownloads/singlefile.php?cid=1&lid=2
.. _COBOL: http://en.wikipedia.org/wiki/COBOL
.. _`COBOL 85`: http://cantfindtheproper.org
.. _`COBOL 2002`: http://cantfindtheproper.org
.. |copysym| unicode:: 0xA9
.. |copyleft| replace:: Copyright |copysym| 2008 The OpenCOBOL Project
[/code]
Edit; removed Keisuke's email address. My bad.
----------------------------------------------------------------
The posted sample uses a Definition List for the main Q and As. That will change.
Cheers
----------------------------------------------------------------
Looks fine.
Brian, can you tar up your posted examples (after checking
the warnings/errors) and send me. I can not post my actual adrress here. Go to OC on SourceForge and you can find my SF mailing address there.
I will start to setup a samples/examples directory.
Re. warnings etc.
This is being pedantic but there are a couple of
warnings that are not automatically turned on with
-Wall (see cobc --help)
So to be strictly correct :-) you should check with
-Wall -Wcall-params -Wtruncate.
Roger
----------------------------------------------------------------
Sounds like a plan.
Since your post I've been using this [i]check[/i] shell script.
[code]
#!/bin/bash
echo "MF"
cobc -x -Wall -Wcall-params -Wtruncate -std=mf $*
echo "cobol85"
cobc -x -Wall -Wcall-params -Wtruncate -std=cobol85 $*
echo "cobol2002"
cobc -x -Wall -Wcall-params -Wtruncate -std=cobol2002 $*
echo "opencobol"
cobc -x -Wall -Wcall-params -Wtruncate $*
[/code]
I just added the two new warning options, and yes they picked up an S9(8) vs S9(9) problem. :)
Cheers
P.S. I'll reconfirm first, but I'd like to bag up some of Bear's posted SCREEN SECTION samples as well.
----------------------------------------------------------------
Sent two of the samples that compile warning free across the dialects. JUSTIFY and LOGICALS
More soon.
Cheers
Brian
Edit; Oh yeah, feel free to rename, duff them over, change credits, whatever. These are project donations.
----------------------------------------------------------------
To anyone interested in adding to the FAQ.
I found this link today, http://docutils.sourceforge.net/FAQ.html#how-can-i-mark-up-a-faq-or-other-list-of-questions-answers
from the author of ReST. I'd like to follow the section title option he suggests. It'll index nicely, it reads nice and it'll make marking up the answers a free and easy (all features allowed) procedure. The definition lists I used in the posted sample hinder some of the more advanced features for the answers as they require indentation, breaking some of the ease of use rules.
The only limitation with that format is that questions will need to be on a single line. For those rare long questions, a shortform could be used for the section title with a more complete version of the question in the section body.
Section titles are easy in ReST.
[code]
This is a section title
-----------------------
[/code]
As long as the dashes are the same length as the proceeding text, ReST assumes a section title. You can even use over and under lining
[code]
---------------------
Q. What is OpenCOBOL?
---------------------
[/code]
To make the raw source even more readable. Any 7bit clean ASCII character can be used for these over/under lines but ReST keeps track of section/sub/subsubsection leveling by initial appearance in the document. I'd like to pick a FAQ standard of = (top level title) - (minus - for section) and . (period - for sub sections) After that, I think just going by first user to need subsub sectioning gets to choose and conflicts can be worked out with a global search replace before merge.
Section bodies are simply blank line delimited paragraphs. Easy on the eyes and easy on the typing.
Cheers everyone,
Brian
Note; the over/under lines look a lot better with a fixed-width font. It is the character count that counts.
----------------------------------------------------------------
New FAQ for comment
[code]
*************
OpenCOBOL FAQ
*************
.. Attention:: This is only a test
.. Sectnum::
:Authors:
Brian Tiffin [btiffin]_
(with the invaluable assistance of many others)
:Organization:
The OpenCOBOL Project
:Version:
0.0
:Status:
Experimental - Not for public release
:Copyright:
|copyleft|
:Changelog:
changelog_
.. Contents:: FAQ Index
=========
OpenCOBOL
=========
Q. What is OpenCOBOL_?
----------------------
OpenCOBOL is an open-source COBOL_ compiler. OpenCOBOL implements a
substantial part of the `COBOL 85`_ and `COBOL 2002`_ standards,
as well as many extensions of the existent COBOL compilers.
OpenCOBOL translates COBOL into C and compiles the translated code using
the native C compiler. You can build your COBOL programs on various
platforms, including Unix/Linux, Mac OS X, and Microsoft Windows.
Q. How is OpenCOBOL licensed?
-----------------------------
The compiler is licensed under GNU General Public License.
The run-time library is licensed under GNU Lesser General Public License.
=======
History
=======
Q. What is the development history of OpenCOBOL?
------------------------------------------------
OpenCOBOL was initially developed by Keisuke Nishida [Keisuke]_
The first public release was version 0.9.0 on January 25th, 2002.
Development continued apace, with version 0.30 released by Keisuke on
August 8th, 2004.
Roger While then took up the role as lead developer on October 30th, 2004.
Version 0.31 was released February 1st, 2005.
Q. What is the current version of OpenCOBOL?
--------------------------------------------
OpenCOBOL 1.0 was released December 27th, 2007 by Roger While [Roger]_
OpenCOBOL 1.1 pre-release is currently in active development, and can be
found at `OpenCOBOL 1.1`_
===============
Using OpenCOBOL
===============
Q. How does the OpenCOBOL compiler work?
----------------------------------------
OpenCOBOL is a command line driven compiler. It produces intermediate C
source code that is then passed to a configured C compiler, the GNU C
compiler, **gcc** being a standard.
The main tool, **cobc**, by defaulti, produces linkable object files.
Q. What compiler options are supported?
---------------------------------------
Usage: cobc [options] file...
Options:
--help Display this message
--version, -V Display compiler version
-v Display the programs invoked by the compiler
-x Build an executable program
-m Build a dynamically loadable module (default)
--std= Compile for a specific dialect
--std=cobol2002 COBOL 2002
--std=cobol85 COBOL 85
--std=ibm IBM Compatible
--std=mvs MVS Compatible
--std=bs200 BS200 Compatible
--std=mf MicroFocus
--std=default See config/default.conf and config/`*`.conf
-free Use free source format
-fixed Use fixed source format default
-O, --O2, --Os Enable optimization
-g Produce debugging information in the output
-debug Enable all run-time error checking
-o Place the output into
-b Combine all input files into a single
dynamically loadable module
-E Preprocess only; do not compile, assemble or link
-C Translation only; convert COBOL to C
-S Compile only; output assembly file
-c Compile and assemble, but do not link
-t Generate and place a program listing into
-I Add to copybook search path
-L Add to library search path
-l Link the library
-D Pass to the C compiler
--conf= User defined dialect configuration - See -std=
--list-reserved Display all reserved words
-save-temps Do not delete intermediate files
--MT Set target file used in dependency list
--MF Place dependency list into
--ext Add default file extension
-Wall Enable all warnings
-Wobsolete Warn if obsolete features are used
-Warchaic Warn if archaic features are used
-Wcolumn-overflow Warn if any text after column 72
-Wredefinition Warn incompatible redefinition of data items
-Wconstant Warn inconsistent constant
-Wparentheses Warn lack of parentheses around AND within OR
-Wterminator Warn lack of scope terminator (END-XXX)
-Wstrict-typing Warn type mismatch strictly
-Wimplicit-define Warn implicitly defined data items
-Wcall-params Warn non 01/77 items for CALL params (NOT set with -Wall)
-Wtruncate Warn possible field truncation (NOT set with -Wall)
-ftrace Generate trace code (Executed SECTION/PARAGRAPH)
-ftraceall Generate trace code (Executed SECTION/PARAGRAPH/STATEMENTS)
-fsyntax-only Syntax error checking only; don't emit any output
-fstatic-call Output static function calls for the CALL statement
-fdebugging-line Enable debugging lines ('D' in indicator column)
-fsource-location Generate source location code (Turned on by -debug or -g)
-fimplicit-init Do automatic initialization of the Cobol runtime system
-fstatic-linkage Statically allocate non-USING LINKAGE parameters
-fsign-ascii Numeric display sign ASCII (Default on ASCII machines)
-fsign-ebcdic Numeric display sign EBCDIC (Default on EBCDIC machines)
-fstack-check PERFORM stack checking (Turned on by -debug or -g)
-ffold-copy-lower Fold COPY subject to lower case (Default no transformation)
-ffold-copy-upper Fold COPY subject to upper case (Default no transformation)
-fnotrunc Do not truncate binary fields according to PIC (ala MF)
-fnull-param Pass extra NULL terminating pointers on CALL statements
=======
Authors
=======
.. [Keisuke] Keisuke Nishida
Initial developer and creator of OpenCOBOL
.. [Roger] Roger While
OpenCOBOL 1.1 is currently in development, and Roger is the lead programmer.
.. [btiffin] Brian Tiffin
Initial FAQ
=========
Changelog
=========
Experimental version for commnent; 02-July-2008
.. _OpenCOBOL: http://opencobol.org/
.. _`OpenCOBOL 1.1`: http://www.opencobol.org/modules/mydownloads/singlefile.php?cid=1&lid=2
.. _COBOL: http://en.wikipedia.org/wiki/COBOL
.. _`COBOL 85`: http://cantfind.org
.. _`COBOL 2002`: http://catfind.org
.. |copysym| unicode:: 0xA9
.. |copyleft| replace:: Copyright |copysym| 2008 The OpenCOBOL Project
[/code]
I'm liking this, but please note that in this copy the options Usage section is incorrect (still flubbed the -std and -O2 entries for instance).
Cheers
Brian
----------------------------------------------------------------
Ladies, Gentlemen;
Here is the 0.0a pre-alpha copy of the OpenCOBOL FAQ.
I apologize in advance for the size of the post. I apologize in advance for the TODO's not yet TODONE.
But I get excited. :-)
The html can be viewed by running $ rst-buildhtml in the working dir of where you file ocfaq.txt. Note: rst-buildhtml is aggressive. It will scan the dir for any and all .txt files, so it has a tendency of littering the file system with .html files when run from the wrong working dir. --stylesheet=ocfaq.css is pending.
I'd really appreciate comments before I find a permanent home for the FAQ and start posting to comp.lang.cobol etc
This 0.0a version has TODO items, will have bugs, falsehoods, near falsehoods, omissions, and needs verification...
[code]
*************
OpenCOBOL FAQ
*************
.. Formatted for docutils, ReStructuredText. rst-buidhtml
.. Attention:: This is the 0.0a pre alpha release of the OpenCOBOL FAQ
.. Sectnum::
:Authors:
Brian Tiffin [btiffin]_
(with the invaluable assistance of many others)
:Organization:
The OpenCOBOL Project
:Version:
0.0a
:Status:
Experimental - Not for public release
:Copyright:
|copyleft|
:Changelog:
changelog_
.. Contents:: FAQ Index
=========
OpenCOBOL
=========
Q. What is OpenCOBOL_?
----------------------
OpenCOBOL is an open-source COBOL_ compiler. OpenCOBOL implements a
substantial part of the `COBOL 85`_ and `COBOL 2002`_ standards,
as well as many extensions of the existent COBOL compilers.
OpenCOBOL translates COBOL into C and compiles the translated code using
the native C compiler. You can build your COBOL programs on various
platforms, including Unix/Linux, Mac OS X, and Microsoft Windows.
Q. What is COBOL_?
------------------
COBOL is an acronym for COmmon Business Oriented Language. This author
has always thought of it as "Common Business" Oriented more than
Common "Business Oriented", but that emphasis is perhaps up to the readers
point of view.
Q. How is OpenCOBOL licensed?
-----------------------------
The compiler is licensed under `GNU General Public License`_.
The run-time library is licensed under `GNU Lesser General Public License`_.
Q. What platforms are supported by OpenCOBOL?
---------------------------------------------
`OpenCOBOL 1.0`_ the current official release version, hosted on
SourceForge.net, compiles on:
* All 32-bit MS Windows (95/98/NT/2000/XP)
* All POSIX (Linux/BSD/UNIX-like OSes)
* OS/X
`OpenCOBOL 1.1`_ also hosted on SourceForge.net, has been tested on
* MS Windows
* POSIX Systems
* OS/X
Q. How complete is OpenCOBOL?
-----------------------------
`OpenCOBOL 1.0`_ implements a substantial portion of COBOL 85,
supports many of the advances and clarifications of COBOL 2002,
and includes many extensions in common use from Micro Focus COBOL,
ACUCOBOL and other exsistent compilers.
`OpenCOBOL 1.1`_ implements a more substantial portion of the COBOL 85
Dialect, COBOL 2002 and a growing number of vendor extensions.
Some proposed COBOL 2008 features have also been implemented.
Compatibility support includes:
* MF for Micro Focus
* IBM for IBM compatibility
* MVS
* BS2000
OpenCOBOL also includes some advanced features allowing source code such as
::
CALL "cfunction" USING BY REFERENCE ADDRESS OF VAR-IN-LINKAGE-SECTION.
Passing the equivalent of char**, pointer to pointer to char. Just as an
small example of the level of coverage provided by OpenCOBOL.
Q. Will I be amazed?
--------------------
This author believes so. For an open source implementation of COBOL,
OpenCOBOL may surprise you in the depth and breadth of it's COOBOL standard
feature support, usability and robustness.
Q. Does OpenCOBOL include a Test Suite?
---------------------------------------
Why yes it does. 74 syntax tests, 170 coverage tests, and 16 data
representation tests at last count. From the development tarball,
**$ make check** will evaluate and report on the test suite.
Q. Does OpenCOBOL pass the NIST Test Suite?
-------------------------------------------
.. Attention:: Look into this
Q. Can OpenCOBOL be used for CGI?
---------------------------------
Yes. Through standard IO redirection and the extended
**ACCEPT ... FROM ENVIRONMENT ...** feature, OpenCOBOL is more than capable
of supporting advanced CGI programming.
Q. Can OpenCOBOL by used for production applications?
-----------------------------------------------------
Depends. OpenCOBOL is still in active development. Feature coverage
is growing, and while the current implementation offers great coverage,
applicability to any given situation would need to analyzed and risks
evaluated before commitment to production use.
The licensing allows for commercial use, but OpenCOBOL also ships with
notice of indemnity, meaning that there are no guarantees when using
OpenCOBOL, directly or indirectly.
There may be a time when commercial support of OpenCOBOL is offered, but
at the time of writing no known offering exists.
.. Attention:: Look into this
Q. Where can I get more information about COBOL?
------------------------------------------------
The `COBOL FAQ`_ by William M Klein is a great place to start.
A google of the search words "COBOL" or "OpenCOBOL" are bound to lead to
enough days worth of reading of in-depth articles, opinions and technical
information to satisfy the greatest of curiosities.
Q. Where can I get more information about OpenCOBOL?
----------------------------------------------------
The opencobol.org_ website is probably the best place to find out more about
the OpenCOBOL system.
Q. Do you know any good jokes?
------------------------------
Maybe.
* A computer without COBOL and Fortran is like chocolate cake without
ketchup and mustard.
*Author: unknown*
* A determined coder can write COBOL programs in any language.
*Author: unknown*
* Rumour has it that the object oriented specification for COBOL was code
named
*ADD 1 TO COBOL GIVING COBOL.*
*Author: unknown*
* Eat COBOL, three quadrillion transactions can't be wrong.
*Author: Brian Tiffin*
* What did COBOL yell to the escaping thief?
**STOP RUN RETURNING NOW.**
*Author: Brian Tiffin*
* What did COBOL reply to the executive? Why yes, I can
*PERFORM JUMPS THRU HOOPS.*
*Author: Brian Tiffin*
* What did OpenCOBOL reply to the executive? Sir, I can
*PERFORM JUMPS THRU FLAMING-HOOPS UNTIL HELL-FREEZES-OVER.*
And being COBOL, I have to show you how little code it takes:
::
identification division.
program-id. freeze.
data division.
working-storage section.
01 hell pic 9.
88 hell-freezes-over value 1.
procedure division.
perform jumps thru flaming-hoops until hell-freezes-over.
stop run.
jumps.
flaming-hoops.
divide 1 by 0 giving hell.
*Author: Brian Tiffin*
=======
History
=======
Q. What is the development history of OpenCOBOL?
------------------------------------------------
OpenCOBOL was initially developed by Keisuke Nishida [Keisuke]_
The first public release was version 0.9.0 on January 25th, 2002.
Development continued apace, with version 0.30 released by Keisuke on
August 8th, 2004.
Roger While then took up the role as lead developer on October 30th, 2004.
Version 0.31 was released February 1st, 2005.
Q. What is the current version of OpenCOBOL?
--------------------------------------------
OpenCOBOL 1.0 was released December 27th, 2007 by Roger While [Roger]_. The
decision to go 1.0 from the 0.33 version followed the 0.32 release of
05-May-2005.
A Debian apt binary package exists for OpenCOBOL 1.0 as **open-cobol** and
lists dependencies of
* libc6 (>= 2.7-1),
* libcob1,
* libcob1-dev (= 1.0-1),
* libdb4.5 (>= 4.5.20-3),
* libdb4.5-dev,
* libgmp3-dev,
* libgmp3c2,
* libltdl3-dev,
* libncurses5 (>= 5.6+20071006-3)
Thanks to the gracious efforts of Bart Martens, bartm on Debian's .org domain.
OpenCOBOL 1.1 pre-release became active on December 27th, 2007 and is
currently in active development. The pre-release source tar can be found
at `OpenCOBOL 1.1`_ with installer instructions at `OpenCOBOL Install`_ and
in the INSTALLING text file of the sources.
Q. Are there pre-built OpenCOBOL packages
-----------------------------------------
Yes. Debian APT, and RPM packages exist. Packages for NetBSD. Many.
Google *opencobol packages* for any late breaking news.
===============
Using OpenCOBOL
===============
Q. How do I install OpenCOBOL?
------------------------------
Installation instructions can be found at `OpenCOBOL Install`_.
Q. Does OpenCOBOL have any other dependencies?
----------------------------------------------
OpenCOBOL relies on a native C compiler with POSIX compatibility.
GCC being a freely available compiler collection supported by most
operating systems currently in use.
OpenCOBOL requires the following external libraries to be installed:
GNU MP (libgmp) 4.1.2 or later
libgmp is used to implement decimal arithmetic.
GNU MP is licensed under GNU Lesser General Public License.
GNU Libtool (libltdl)
libltdl is used to implement dynamic CALL statements.
GNU Libtool is licensed under GNU Lesser General Public License.
NOTE - Libtool is not required for Linux and Windows
(including MinGW and Cygwin)
The following libraries are optional:
Berkeley DB (libdb) 1.85 or later
libdb can be used to implement indexed file I/O and SORT/MERGE.
Berkeley DB is licensed under the original BSD License (1.85) or their own
open-source 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 Corporation. For more information about Oracle Berkeley DB dual
licensing go to : Oracle / Embedded / Oracle Berkeley DB
Ncurses (libncurses) 5.2 or later
libncurses can be used to implement SCREEN SECTION.
Ncurses is licensed under a BSD-style license.
Q. How does the OpenCOBOL compiler work?
----------------------------------------
OpenCOBOL is a multi-stage command line driven compiler. Command line
options control what stages are performed during processing.
1. Preprocess
#. Translate
#. Compile
#. Assemble
#. Link
#. Build
OpenCOBOL produces intermediate C source code that is then passed to a configured
C compiler and other tools. the GNU C compiler, **gcc** being a standard.
The main tool, **cobc**, by default, produces modules, linkable shared
object files.
Example
::
$ cat hello.cob
Original source code;
::
000100* HELLO.COB OpenCOBOL FAQ example
000200 IDENTIFICATION DIVISION.
000300 PROGRAM-ID. hello.
000400 PROCEDURE DIVISION.
000500 DISPLAY "Hello World!".
000600 STOP RUN.
OpenCOBOL stages;
::
$ cobc -E hello.cob
Preprocess only; produces
::
# 1 "hello.cob"
IDENTIFICATION DIVISION.
PROGRAM-ID. hello.
PROCEDURE DIVISION.
DISPLAY "Hello World!".
STOP RUN.
to standard out.
::
$ cobc -C hello.cob
Translate only; preprocesses and then translates the COBOL sources into C.
You can examine these files to get a good sense of how the OpenCOBOL
environment interacts with the native C facilities.
OpenCOBOL 1.1 produced **hello.c.h** and **hello.c**.
::
$ cobc -S hello.cob
Compile only; outputs assembly file. Produces **hello.s**.
::
$ cobc -c hello.cob
Compile and assemble, do not link. Produces **hello.o**.
::
$ cobc -m hello.cob
Build dynamically loadable module. The is the *default behaviour*.
This example produces **hello.so** or **hello.dll**.
.. Attention:: Need a little OS/X info here
::
$ cobc -x hello.cob
Build an executable program. This examples produces **hello** or
**hello.exe**.
**This is important**. *cobc* produces a shared library by default.
*To create executables*, you need to use **-x**.
::
$ ./hello
Hello World!
OpenCOBOL also supports features for multiple source, multiple language
programming, detailed in the FAQ at `Q. Does OpenCOBOL support modules?`_.
Q. What compiler options are supported?
---------------------------------------
.. Note to maintainers. Build with $ cobc --help and indent 4 spaces.
::
Usage: cobc [options] file...
Options:
--help Display this message
--version, -V Display compiler version
-v Display the programs invoked by the compiler
-x Build an executable program
-m Build a dynamically loadable module (default)
-std= Compile for a specific dialect :
cobol2002 Cobol 2002
cobol85 Cobol 85
ibm IBM Compatible
mvs MVS Compatible
bs2000 BS2000 Compatible
mf Micro Focus Compatible
default When not specified
See config/default.conf and config/\*.conf
-free Use free source format
-fixed Use fixed source format (default)
-O, -O2, -Os Enable optimization
-g Produce debugging information in the output
-debug Enable all run-time error checking
-o Place the output into
-b Combine all input files into a single
dynamically loadable module
-E Preprocess only; do not compile, assemble or link
-C Translation only; convert COBOL to C
-S Compile only; output assembly file
-c Compile and assemble, but do not link
-t Generate and place a program listing into
-I Add to copybook search path
-L Add to library search path
-l Link the library
-D Pass to the C compiler
-conf= User defined dialect configuration - See -std=
--list-reserved Display all reserved words
-save-temps Do not delete intermediate files
-MT