Sponsored Content
Full Discussion: Install cobol compiler
Operating Systems Linux Red Hat Install cobol compiler Post 302484521 by drl on Friday 31st of December 2010 05:11:27 PM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
ENVIRONMENT.D(5)						   environment.d						  ENVIRONMENT.D(5)

NAME
environment.d - Definition of user session environment SYNOPSIS
~/.config/environment.d/*.conf /etc/environment.d/*.conf /run/environment.d/*.conf /usr/lib/environment.d/*.conf /etc/environment DESCRIPTION
The environment.d directories contain a list of "global" environment variable assignments for the user environment. systemd-environment-d- generator(8) parses them and updates the environment exported by the systemd user instance to the services it starts. It is recommended to use numerical prefixes for file names to simplify ordering. For backwards compatibility, a symlink to /etc/environment is installed, so this file is also parsed. CONFIGURATION DIRECTORIES AND PRECEDENCE
Configuration files are read from directories in /etc/, /run/, and /lib/, in order of precedence. Each configuration file in these configuration directories shall be named in the style of filename.conf. Files in /etc/ override files with the same name in /run/ and /lib/. Files in /run/ override files with the same name in /lib/. Packages should install their configuration files in /lib/. Files in /etc/ are reserved for the local administrator, who may use this logic to override the configuration files installed by vendor packages. All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name will take precedence. It is recommended to prefix all filenames with a two-digit number and a dash, to simplify the ordering of the files. If the administrator wants to disable a configuration file supplied by the vendor, the recommended way is to place a symlink to /dev/null in the configuration directory in /etc/, with the same filename as the vendor configuration file. If the vendor configuration file is included in the initrd image, the image has to be regenerated. CONFIGURATION FORMAT
The configuration files contain a list of "KEY=VALUE" environment variable assignments, separated by newlines. The right hand side of these assignments may reference previously defined environment variables, using the "${OTHER_KEY}" and "$OTHER_KEY" format. It is also possible to use "${FOO:-DEFAULT_VALUE}" to expand in the same way as "${FOO}" unless the expansion would be empty, in which case it expands to DEFAULT_VALUE, and use "${FOO:+ALTERNATE_VALUE}" to expand to ALTERNATE_VALUE as long as "${FOO}" would have expanded to a non-empty value. No other elements of shell syntax are supported. Each KEY must be a valid variable name. Empty lines and lines beginning with the comment character "#" are ignored. Example Example 1. Setup environment to allow access to a program installed in /opt/foo /etc/environment.d/60-foo.conf: FOO_DEBUG=force-software-gl,log-verbose PATH=/opt/foo/bin:$PATH LD_LIBRARY_PATH=/opt/foo/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} XDG_DATA_DIRS=/opt/foo/share:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/} SEE ALSO
systemd(1), systemd-environment-d-generator(8), systemd.environment-generator(7) systemd 237 ENVIRONMENT.D(5)
All times are GMT -4. The time now is 02:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy