Here’s the deal: I have to interface with a COBOL application using Micro Focus (www.microfocus.com) Relativity Data Client to interact with the data. Yes, you heard it right – COBOL.
Most of you must not know, but here’s a quick definition of what Relativity does by Micro Focus:
Relativity provides access to data contained within files managed by COBOL applications that via ODBC interface presents data to a program in the form of tables to access the COBOL data in a proficient way.
(source: http://www.microfocus.com/downloads/relativity-152334.aspx)
I like the way they do business, their documentation is up to scratch and all the files supplied are great!
But… I’m not very lucky, so it happens that our server – of course – is 64-bit and Relativity DOES NOT PRODUCE 64-BIT Relativity Data Client for Linux.
Bingo! Here I find myself again “googling” around to see what I could do to get it to work.
I got some help from Google and from Micro Focus, here’s how to install Relativity Data Client on a Ubuntu 64-Bits (I promise you this is all you will need to do!)
Even though I assume you have already suffered for at least 2 days before finding this article, I will assume you haven’t done anything yet. So I will take you from the bottom up.
0 – Installing ODBC 32-bits on your Ubuntu 64-bits
Here’s what I’ve done:
> sudo aptitude install ia32-libs
> sudo apt-get install g++-multilib
> mkdir ~/src
> cd ~/src
> wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.0.tar.gz
> tar -xzvf unixODBC-2.3.0.tar.gz
> cd unixODBC-2.3.0/
> CFLAGS=-m32 LDFLAGS=-m32 CXXFLAGS=-m32 ./configure
> make
> sudo make install
That has installed the 32-bit unixodbc libraries into /usr/local/lib, you can confirm that by running the following:
> file /usr/local/lib/libodbcinst.so.1.0.0
should say
/usr/local/lib/libodbcinst.so.1.0.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
This response tells you that you now have a 32-bit installation of the UnixODBC library. You can now carry on!
1 – Get all the files you received from Micro Focus and upload that to the server you want to install the data client on.
The file structure should look something like that:
This is the main structure that you should receive from them. Most of those files we won’t use – you know how they work…
Inside the folder dclient, we must have a folder called 070. Each folder is destined to a different OS distro. And even though 070 isn’t the one for Linux 64-bits, we will make use of that to get us going.
They have a very nice documentation that describes the step by step of getting the driver installed (if you haven’t received it, give me a shout and I can supply it to you).
Now, here’s one important information: the TERM used during your install must be ansi! So, on your xShell or putty, input the following:
> TERM=ansi ; export TERM
Now, your term must be defined to ansi – by default, your TERM should be vanilla.
This step is done!
2 – Remember the files you received from Micro Focus and uploaded on to your server, go to that folder.
You will see a shell scrip called install.sh
COMMENT:
According to the Micro Focus documentation, it’s suggested to created a folder called RelStage to host all the files that are created with the installation – but because you have the option to remove all the files once installation is completed, I didn’t bother with that. So I went there straight and input the following on xShell:
> sh install.sh
That got the installation going.
3 – The installation script ask about the source files for the installation, put the following:
dclient/
That should get you doing.
4 – A bunch of questions gets asked. You just need to hit enter and be happy with all the default values. You can also input – when asked – your server name and the default port used for the connection. That will save you time later on.
5 – The installation should be completed! If you get an error saying that two files couldn’t be found, that means that you don’t have the ODBC 32bits installed. Go back to step 0 and do it all again. Sorry mate!
Now, all is installed. So in theory you all ready to go. Not for me. My connection wasn’t working.
Here’s what I did:
6 - Confirmed the driver was installed, mine wasn’t
> /usr/local/liant/bin/reldriveradmin —list-drivers
The driver wasn’t there – so…
7 – Install the driver (if your driver is installed – you can skip this step – you are a very lucky man)
> /usr/local/liant/bin/reldriveradmin —install-driver “Relativity Client” —directory /usr/local/liant/lib/
That should install the driver
8 – Added a server – initially my didn’t work:
I checked if the server was installed properly. If it’s not, below is the line to have it added.
> /usr/local/liant/bin/relclientadmin –-add-server ServerName
By the way, to check if the server is right, you can do the following:
> /usr/local/liant/bin/relclientadmin —list-server
9 – Added a data source:
/usr/local/liant/bin/relclientadmin —add-data-source ‘yourdatasource’—server-data-source-name ‘yourdatasource’
This should get your data source added! J Things are getting cool now.
In order to verify whether what you did is correct, run the following:
> /usr/local/liant/bin/relclientadmin —show-data-source yourdatasource
If you got an error – it could be due to the default server being messed up, if so – try adding the parameter “—server-name” like the sample below:
/usr/local/liant/bin/relclientadmin —add-data-source ‘yourdatasource’ —server-name 127.0.0.1.1583 —server-data-source-name ‘yourdatasource’
10 – Give it a big smile, you are nearly done!
That’s awesome that the number 10 is the cool one. This item, we will only really rest and feel good about ourselves.
11 – Test our connection
To test the connection, the best fastest/best/easiest way to do it is via isql.
Do the following:
> isq –v DSN user password
That will log you in. Now you can run your SQL statements!
I hope you have enjoyed this solution – I’m exactly like you, a developer trying to understand why people build things so differently from each other.
Thanks!