Install cobol compiler

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Install cobol compiler
# 1  
Old 12-31-2010
Install cobol compiler

Hi

I dont have a cobol compiler in my redhhat linux box, and so I want to install it. When i try the below command

Code:
sudo apt-get install open-cobol

it tells "apt-get : command not found". I tried to find apt-get under my root, could not find it anywhere.

Should we install apt-get also? If so, how?
# 2  
Old 12-31-2010
RHEL has yum instead of apt-get.

Code:
yum install open-cobol

# 3  
Old 12-31-2010
Hi Verdepollo
When I tried it, yum is also not there in my system. It tells command not found for yum as well.

When I did a find for the yum command under root, it found one under /etc/log.d/scripts/services. Is this the one? Looks like a small perl script. When i ran it it is just waiting for some user input?

Please advice.
# 4  
Old 12-31-2010
Yeah, now I see it's not RHEL but Red Hat Linux (which version?).

If you have a RHN subscription you can download rpm-get (apt-get) from their website.

Or you can get open-cobol source files and build it yourself (you will also need libltdl and libgmp) - OpenCOBOL - InstallGuide
# 5  
Old 12-31-2010
Hi.

If you can change Linux distributions, see post #7 cobol compiler for suse

However, as verdepollo writes, open-cobol can be compiled and installed. To test this, I installed it on CentOS and tested it with:
Code:
#!/usr/bin/env bash

# @(#) s1	Demonstrate COBOL compile and execute.

# Section 1, setup, pre-solution.
# Infrastructure details, environment, commands for forum posts. 
# Uncomment export command to test script as external user.
# export PATH="/usr/local/bin:/usr/bin:/bin"
set +o nounset
pe() { for i;do printf "%s" "$i";done; printf "\n"; }
pl() { pe;pe "-----" ;pe "$*"; }
C=$HOME/bin/context && [ -f $C ] && . $C specimen cobc
set -o nounset
pe

# FILE=${1-data1}
FILE=${1-hello,world.cobol}

# Section 2, display input file.
# Display sample of data file, with head & tail as a last resort.
pe " || start [ first:middle:last ]"
specimen $FILE \
|| { pe "(head/tail)"; head -n 5 $FILE; pe " ||"; tail -n 5 $FILE; }
pe " || end"

# Section 3, solution.
pl " Results:"
set +o nounset
if [ -n "$LD_LIBRARY_PATH" ]
then
  export LD_LIBRARY_PATH="$LD_LIBRARY_PATH /usr/local/lib"
else
  export LD_LIBRARY_PATH="/usr/local/lib"
fi
pe " (debug cobol install: COBOL is $(whereis cobc))"
pe " (debug cobol install: LD_LIBRARY_PATH is :$LD_LIBRARY_PATH:)"

cobc -x -free hello,world.cobol
./hello,world

exit 0

producing:
Code:
$ ./s1

Environment: LC_ALL = C, LANG = en_US.UTF-8
(Versions displayed with local utility "version")
OS, ker|rel, machine: Linux, 2.6.18-194.26.1.el5, i686
Distribution        : CentOS release 5.5 (Final)
GNU bash 3.2.25
specimen (local) 1.17
cobc (OpenCOBOL) 1.0.0

 || start [ first:middle:last ]
Whole: 5:0:5 of 6 lines in file "hello,world.cobol"
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
PROCEDURE DIVISION.
MAIN.
   DISPLAY 'Hello, world from open-cobol.'.
   STOP RUN.
 || end

-----
 Results:
 (debug cobol install: COBOL is cobc: /usr/local/bin/cobc)
 (debug cobol install: LD_LIBRARY_PATH is :/usr/local/lib:)
Hello, world from open-cobol.

The CentOS 5.5 is the free version of RHEL 5.5.

The install went smoothly, they provided more than 150 tests -- all passed.

There is another COBOL at SourceForge, TinyCOBOL. It appears to be more recently modified, but I could not get it installed (I only tried briefly).

Good luck ... cheers, drl
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

How should I install 'make' compiler ?

I need too install GDB in order to debug a program. I need to install GDB through the UNIX command 'make install'. I downloaded a full directory of hundreds of files allowing to get a gdb executable but need a compilation before ... The problem is UNIX can't find 'make' command. I work under... (5 Replies)
Discussion started by: shub22
5 Replies

2. Programming

cobol compiler for suse

hi could you please suggest me any cobol compiler for suse linux. any help would me much appreciated .. -- thanks rakesh kumar (7 Replies)
Discussion started by: rakeshkumar
7 Replies

3. AIX

install two different compiler version

Hi all. I have a simple question. There's a way to install under AIX system (5.3) two different compiler version, i.e. ibm xlf fortran 11 and 12? Seems that smitty doesn't allows user to change the default installation path; it only allows you to save the replaced files of the superseded... (1 Reply)
Discussion started by: poldo000
1 Replies

4. Shell Programming and Scripting

cobol help....compiler key and its usage....

i am having mfcobol old version... which was supplied by my friends....with a compiler key (h/w) having 24 pin male on one side and 24 pin female on the other side....with lable LOPOEK XXXXXXXXXX MICRO FOCUS........ AM USING NORMAL COMMANDS USING .CBL, .OBJ, .LIB FILES TO GET COBOL EXE FILE....... (0 Replies)
Discussion started by: KANNI786
0 Replies

5. Shell Programming and Scripting

Calling script from RM cobol and returning value to cobol

Is there a way you can return a value from a script that is called from a rm cobol program... 01 WS-COMD-LINE-PGM X(39) value sh ./getUserId.sh 12345" 01 WS-RETURN-SYS-CODE PIC 9(8). CALL "SYSTEM" USING WS-COMD-LINE-PGM GIVING WS-RETURN-SYS-CODE. ... (1 Reply)
Discussion started by: pavanmp
1 Replies

6. UNIX for Dummies Questions & Answers

install C compiler without make

Hi all, I dont have much knowledge about linux, but want to learn. I have installed Plop linux(PLoP - Home) on USB Flashdrive. I want to install gcc compiler to it. The installation of C compiler ask for make command, which is not found in the distribution. When I tried to install gnu make,... (4 Replies)
Discussion started by: johnsmithgr8
4 Replies

7. AIX

How to install gcc compiler on AIX?

I want to install gcc compiler on aix box. $uname -a AIX GTMIT 3 5 000000000000 Can any one help me installing gcc compiler(step by step)either by smit or rpm commands ? What is boot straping ? Its urgent .. Thanks in advance (2 Replies)
Discussion started by: kittu1979
2 Replies

8. Programming

cobol crn programme run on express cobol as .gnt

can i run .crn programme in express cobol which support to .gnt programme .... Plz tell me solution (2 Replies)
Discussion started by: bibi
2 Replies

9. Solaris

Can`t install gcc compiler

Hi, Installed the gcc compiler off the Solaris 9 Companion CD a while back , but needed to delete it due to disk space issues. Now that I have sorted out our root disk space I can`t reinstall the compiler. If I select all the packages off the Development/Languages menu , the install list... (3 Replies)
Discussion started by: markdr011
3 Replies

10. Red Hat

Need Help Finding C Compiler on install CDs

I have to install C compiler on Redhat 9. I was told that its on the install CDs however, I cannot find it. Would appreciate any help on this issue. (1 Reply)
Discussion started by: StorageGuy
1 Replies
Login or Register to Ask a Question