Hi all, I downloaded the cobol file onto my Mac and I don't know what to do with it. I have already installed HomeBrew via the terminal .
How do I install the GnuCobol? I downloaded the file gnucobol-3.2.tar.xz and it's in my download directory.
How do I install this? Do I need to do it via terminal ?
I dont realy know how to use dthe commands in terminal.
Thank you good people.
Steve
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you run on Mac with HomeBrew and don't want to change GnuCOBOL itself or use another ORGANIZATION INDEXED handler than BDB, then the most reasonable way to install GnuCOBOL is to just run brew install gnu-cobol in a terminal and you're done (it was updated to 3.2 some weeks ago and was adjusted to contain every feature last week).
If you ever want to try GnuCOBOL 4 (runs quite stable but has no stable API, so updating that may result in the need to recompile all COBOL sources), then you can also brew install --HEAD gnu-cobol[works and passes all internal and NIST85 tests, just as 3.2 does (which does have other internal tests, of course)].
After both options you can then use cobc from everywhere; you can also do brew install --cask vscodium and execute the compiler from there (and have a nice editing when installing the right extensions, but that's a different topic handled in other discussion threads already).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I get this
stevelaba@Steves-iMac ~ % cobc -v
cobc (GnuCOBOL) 3.2.0
Built Aug 25 2023 15:20:58 Packaged Jul 28 2023 17:02:56 UTC
C version "Apple LLVM 14.0.3 (clang-1403.0.22.14.1)"
loading standard configuration file 'default.conf'
cobc: error: no input files
stevelaba@Steves-iMac ~ % cobc -i
cobc (GnuCOBOL) 3.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
Built Aug 25 2023 15:20:58
Packaged Jul 28 2023 17:02:56 UTC
C version "Apple LLVM 14.0.3 (clang-1403.0.22.14.1)"
build information
build environment : x86_64-apple-darwin22.4.0
CC : clang
C version : "Apple LLVM 14.0.3 (clang-1403.0.22.14.1)"
CPPFLAGS : -I/usr/local/Cellar/gmp/6.2.1_1/include
CFLAGS : -O2 -pipe
LD : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
LDFLAGS :
Now you just need to do some programming in Cobol and submit the program
source to cobc
Make sure you download the manual Programming Guide.from the sourceforge
website so you can print it out or just read the .pdf file.
There is also a Sample Programs manual as well and look at the Contrib
area where there is more programs written in Cobo for you to examine and
compile & run.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, so how do I start the new program? Is there an editing part to GnuCobol? Is there a manual on how to get started with GnuCobol? I can follow the documentation on the syntax for Cobol but where do i create the program code and then compile that file?
Thanks
Steve
Last edit: Steve 2023-08-31
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2023-08-31
Hi again. I'm looking for a quick start on what editor to use and then saving the Cobol progra and then compiling it. I can see that VI is avalable in Terminal on my Mac.
Is that information in the guides yu are mentioning.
Sorry but I have not used the Terminal on my Mac before and its a bit criptic to me.
I used to be a Cobol programer back in the 80's and 90's.
I just trying to brush up on the Cobol.
Thank you for being so helpful.
Steve
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Steve - please sign up to an account on SF - It will save you having to
wait for your posts to be moderated.
It is free.
On 31/08/2023 17:53, noreply@sourceforge.net wrote:
Hi again. I'm looking for a quick start on what editor to use and then
saving the Cobol progra and then compiling it. I can see that VI is
avalable in Terminal on my Mac.
Is that information in the guides yu are mentioning.
You can use ANY text editor available on your Mac and you can use the
IDE available via the SF site - there are two and one has had
development discontinued but still works but not sure it is available
for the mac.
I tend to use kate under Linux which may well be available on Mac but
the Mac does have other gui based one's that can handle Cobol and its
syntax.
For these they are ALL Gui based so no terminal used but that is used to
compile programs if not using a Gui IDE but that said I find it quicker
to use a terminal windows as I can build a quick bash (or other) script
to compile more than one source file at a time.
Another option here is to create a makefile for use with the development
program make. Your choice.
I do have a Mac Pro (2008) but do not use it day to day or even month
to month - must get around to selling it as was only bought for doing
some minor testing and to see what OSX was about compared to Linux..
Sorry but I have not used the Terminal on my Mac before and its a bit
criptic to me.
I used to be a Cobol programer back in the 80's and 90's.
I just trying to brush up on the Cobol.
Thank you for being so helpful.
Steve
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As noted, if you want an extended editor for several programming languages, you can brew install vscodium (there are a bunch of tutorials online how to use VSCodium/vscode).
When you install a COBOL extension, you get nice highlighting and, depending on the extension, some features.
It may be useful if you additional install the gnucobol.debug extension, its default is to compile with "cobc" itself when you use the run/debug command... and it allows debugging COBOL, too.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Steve, welcome to GnuCOBOL. I do not have a Macintosh so I do not know much about this. I looked a site on the www and to me it appears Ultra Edit would be the easiest to learn. Here.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Note: this output is the reason for [feature-requests:#443] (mostly done, need to add testcases and commit after the other changes already done after 3.2)
You obviously have helloworld compiled both with and without -x.
To run the "main" executable: ./helloworld.
To run the module, which is also CALLable: cobcrun helloworld1 (will load the program from helloworld.dylib)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
welcome. I think your program had some invalid end-of-line or carriage-return issues.
Keep on writting and compiling. !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2023-09-01
That worked Mickey. You people on this site are unbelievably helpful
When I compile my program it seems to be looking for and end of line or something.
I put in 2 more display statements and this is what I get.
This is likely related to your editor. This warning says that some tools will not be able to process that last line, correctly because the end of line marker is missing.
Just go to its end and press ENTER, then that warning goes away.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all, I downloaded the cobol file onto my Mac and I don't know what to do with it. I have already installed HomeBrew via the terminal .
How do I install the GnuCobol? I downloaded the file gnucobol-3.2.tar.xz and it's in my download directory.
How do I install this? Do I need to do it via terminal ?
I dont realy know how to use dthe commands in terminal.
Thank you good people.
Steve
If you run on Mac with HomeBrew and don't want to change GnuCOBOL itself or use another ORGANIZATION INDEXED handler than BDB, then the most reasonable way to install GnuCOBOL is to just run
brew install gnu-cobol
in a terminal and you're done (it was updated to 3.2 some weeks ago and was adjusted to contain every feature last week).If you ever want to try GnuCOBOL 4 (runs quite stable but has no stable API, so updating that may result in the need to recompile all COBOL sources), then you can also
brew install --HEAD gnu-cobol
[works and passes all internal and NIST85 tests, just as 3.2 does (which does have other internal tests, of course)].After both options you can then use
cobc
from everywhere; you can also dobrew install --cask vscodium
and execute the compiler from there (and have a nice editing when installing the right extensions, but that's a different topic handled in other discussion threads already).Great look like it installed but when I type cobc it is looking for a n input file.
stevelaba@Steves-iMac ~ % brew install gnu-cobol
==> Downloading https://formulae.brew.sh/api/formula.jws.json
################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
################################################################### 100.0%
==> Fetching dependencies for gnu-cobol: ca-certificates, openssl@3, berkeley-db, gmp and json-c
==> Fetching ca-certificates
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2023-
################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/blobs/sha256:a3
################################################################### 100.0%
==> Fetching openssl@3
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.1.2-1
################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:2bea791e
################################################################### 100.0%
==> Fetching berkeley-db
==> Downloading https://ghcr.io/v2/homebrew/core/berkeley-db/manifests/18.1.40_2
################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/berkeley-db/blobs/sha256:a6b047
################################################################### 100.0%
==> Fetching gmp
==> Downloading https://ghcr.io/v2/homebrew/core/gmp/manifests/6.2.1_1
################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gmp/blobs/sha256:4c6488dfd53b82
################################################################### 100.0%
==> Fetching json-c
==> Downloading https://ghcr.io/v2/homebrew/core/json-c/manifests/0.17
################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/json-c/blobs/sha256:6964da23ee0
################################################################### 100.0%
==> Fetching gnu-cobol
==> Downloading https://ghcr.io/v2/homebrew/core/gnu-cobol/manifests/3.2-1
################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/gnu-cobol/blobs/sha256:b284db83
################################################################### 100.0%
==> Installing dependencies for gnu-cobol: ca-certificates, openssl@3, berkeley-db, gmp and json-c
==> Installing gnu-cobol dependency: ca-certificates
==> Pouring ca-certificates--2023-08-22.ventura.bottle.tar.gz
==> Regenerating CA certificate bundle from keychain, this may take a while...
🍺 /usr/local/Cellar/ca-certificates/2023-08-22: 3 files, 221.6KB
==> Installing gnu-cobol dependency: openssl@3
==> Pouring openssl@3--3.1.2.ventura.bottle.1.tar.gz
🍺 /usr/local/Cellar/openssl@3/3.1.2: 6,495 files, 30.0MB
==> Installing gnu-cobol dependency: berkeley-db
==> Pouring berkeley-db--18.1.40_2.ventura.bottle.tar.gz
🍺 /usr/local/Cellar/berkeley-db/18.1.40_2: 44 files, 5.9MB
==> Installing gnu-cobol dependency: gmp
==> Pouring gmp--6.2.1_1.ventura.bottle.tar.gz
🍺 /usr/local/Cellar/gmp/6.2.1_1: 21 files, 3.3MB
==> Installing gnu-cobol dependency: json-c
==> Pouring json-c--0.17.ventura.bottle.tar.gz
🍺 /usr/local/Cellar/json-c/0.17: 33 files, 335.6KB
==> Installing gnu-cobol
==> Pouring gnu-cobol--3.2.ventura.bottle.1.tar.gz
🍺 /usr/local/Cellar/gnu-cobol/3.2: 74 files, 3MB
==> Running
brew cleanup gnu-cobol
...Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see
man brew
).stevelaba@Steves-iMac ~ % cobc
cobc: error: no input files
stevelaba@Steves-iMac ~ % cobc
cobc: error: no input files
stevelaba@Steves-iMac ~ %
It appears you have installed GC.
To test lightly try :
cobc -v or (or both)
cobc -i
On 30/08/2023 21:14, Steve wrote:
I get this
stevelaba@Steves-iMac ~ % cobc -v
cobc (GnuCOBOL) 3.2.0
Built Aug 25 2023 15:20:58 Packaged Jul 28 2023 17:02:56 UTC
C version "Apple LLVM 14.0.3 (clang-1403.0.22.14.1)"
loading standard configuration file 'default.conf'
cobc: error: no input files
stevelaba@Steves-iMac ~ % cobc -i
cobc (GnuCOBOL) 3.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward Hart
Built Aug 25 2023 15:20:58
Packaged Jul 28 2023 17:02:56 UTC
C version "Apple LLVM 14.0.3 (clang-1403.0.22.14.1)"
build information
build environment : x86_64-apple-darwin22.4.0
CC : clang
C version : "Apple LLVM 14.0.3 (clang-1403.0.22.14.1)"
CPPFLAGS : -I/usr/local/Cellar/gmp/6.2.1_1/include
CFLAGS : -O2 -pipe
LD : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
LDFLAGS :
GnuCOBOL information
COB_CC : clang
COB_CFLAGS : -pipe -I/usr/local/Cellar/gmp/6.2.1_1/include
-I/usr/local/Cellar/gnu-cobol/3.2/include
-Wno-unused -fsigned-char -Wno-pointer-sign
-Qunused-arguments
-Wno-deprecated-non-prototype
COB_DEBUG_FLAGS : -ggdb3 -fasynchronous-unwind-tables
COB_LDFLAGS :
COB_LIBS : -L/usr/local/Cellar/gnu-cobol/3.2/lib -lcob
COB_CONFIG_DIR : /usr/local/Cellar/gnu-cobol/3.2/share/gnucobol/config
COB_COPY_DIR : /usr/local/Cellar/gnu-cobol/3.2/share/gnucobol/copy
COB_MSG_FORMAT : GCC
COB_OBJECT_EXT : o
COB_MODULE_EXT : dylib
COB_EXE_EXT :
64bit-mode : yes
BINARY-C-LONG : 8 bytes
endianness : little-endian
native EBCDIC : no
extended screen I/O : ncurses
variable file format : 0
sequential file handler : built-in
indexed file handler : BDB
mathematical library : GMP
XML library : libxml2
JSON library : json-c
stevelaba@Steves-iMac ~ %
The compiler is fully installed.
Now you just need to do some programming in Cobol and submit the program
source to cobc
Make sure you download the manual Programming Guide.from the sourceforge
website so you can print it out or just read the .pdf file.
There is also a Sample Programs manual as well and look at the Contrib
area where there is more programs written in Cobo for you to examine and
compile & run.
Hi, so how do I start the new program? Is there an editing part to GnuCobol? Is there a manual on how to get started with GnuCobol? I can follow the documentation on the syntax for Cobol but where do i create the program code and then compile that file?
Thanks
Steve
Last edit: Steve 2023-08-31
On 31/08/2023 00:34, Steve wrote:
Get and read the Gnucobol Programmers Guide and you can get it via :
https://gnucobol.sourceforge.io/guides.html
select the first three for Letter and the next three for A4 format
These manuals are NOT ideal for learning Cobol so I suggest you get a
book on it or download one of the many videos on learning.
Another thing you can do assuming you have programming experience is to
look at some of the programs in stored in the Contrib area at :
https://sourceforge.net/p/gnucobol/contrib/HEAD/tree/trunk/tools/
Look at flightlog which as the name suggests is a Flight log book
program to record all flights for all aircrew.
If you want a full blown set of programs for a commercial application
take a look at
https://sourceforge.net/projects/acas/
grab the ACAS-Nightly.rar
Hi again. I'm looking for a quick start on what editor to use and then saving the Cobol progra and then compiling it. I can see that VI is avalable in Terminal on my Mac.
Is that information in the guides yu are mentioning.
Sorry but I have not used the Terminal on my Mac before and its a bit criptic to me.
I used to be a Cobol programer back in the 80's and 90's.
I just trying to brush up on the Cobol.
Thank you for being so helpful.
Steve
Steve - please sign up to an account on SF - It will save you having to
wait for your posts to be moderated.
It is free.
On 31/08/2023 17:53, noreply@sourceforge.net wrote:
I tend to use kate under Linux which may well be available on Mac but
the Mac does have other gui based one's that can handle Cobol and its
syntax.
For these they are ALL Gui based so no terminal used but that is used to
compile programs if not using a Gui IDE but that said I find it quicker
to use a terminal windows as I can build a quick bash (or other) script
to compile more than one source file at a time.
Another option here is to create a makefile for use with the development
program make. Your choice.
I do have a Mac Pro (2008) but do not use it day to day or even month
to month - must get around to selling it as was only bought for doing
some minor testing and to see what OSX was about compared to Linux..
As noted, if you want an extended editor for several programming languages, you can
brew install vscodium
(there are a bunch of tutorials online how to use VSCodium/vscode).When you install a COBOL extension, you get nice highlighting and, depending on the extension, some features.
It may be useful if you additional install the gnucobol.debug extension, its default is to compile with "cobc" itself when you use the run/debug command... and it allows debugging COBOL, too.
Ok this is getting a bit complicated for what I want to do.
What is IDE available via the SF site. Is this an editor?
Hi Steve, welcome to GnuCOBOL. I do not have a Macintosh so I do not know much about this. I looked a site on the www and to me it appears Ultra Edit would be the easiest to learn.
Here.
Well I compiled a test program and I got lots of errors.
Looks like the code is not lined up or something. does anyone notice what I'm doing wrong?
Last edit: Simon Sobisch 2023-09-01
Download the attached file to your cobol directory where your current helloworld is at.
Then compile with: cobc -x helloworld1.cbl
Note: this output is the reason for [feature-requests:#443] (mostly done, need to add testcases and commit after the other changes already done after 3.2)
Related
Wish List:
#443Just to make that clear: you likely have compiled the original program once, but then above you have compiled the binary
cobc helloworld
vs.cobc helloworld.cbl
As noted in the mentioned feature request this will be checked in the next version, resulting in
Hi Mickey, I just did that and this is what I get
There was no output from the compiler but it created the file helloworld1
Last edit: Simon Sobisch 2023-09-01
now to run the program just compiled, just type in:
helloworld1
OR maybe:.helloworld1
OR maybe:
./helloworld1
Last edit: Simon Sobisch 2023-09-01
You obviously have helloworld compiled both with and without
-x
.To run the "main" executable:
./helloworld
.To run the module, which is also
CALL
able:cobcrun helloworld1
(will load the program from helloworld.dylib)That worked Mickey. You people on this site are unbelievably helpful
welcome. I think your program had some invalid end-of-line or carriage-return issues.
Keep on writting and compiling. !
That worked Mickey. You people on this site are unbelievably helpful
When I compile my program it seems to be looking for and end of line or something.
I put in 2 more display statements and this is what I get.
The program does work so could this be because of the editor I used to create the code in?
Last edit: Simon Sobisch 2023-09-01
I think so. can you copy the one I gave you and do some edits on it, add some lines and then try to compile?
Do you have a windows box?
This is likely related to your editor. This warning says that some tools will not be able to process that last line, correctly because the end of line marker is missing.
Just go to its end and press ENTER, then that warning goes away.