Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining fields in Relativity 1

Status
Not open for further replies.

hammy

Programmer
Sep 6, 2001
73
GB
Hi,

I am using Relativity 3.24 and have been asked to merge 2 fields together to show just one field to the end user, e.g.

03 DATA-ITEM PIC X(16).
03 DATA-ITEMR REDEFINES DATA-ITEM.
05 FIELD1 PIX X(10).
05 FILLER PIX X(2).
05 FIELD2 PIX X(4).

What I need to make available is one field that is FIELD1 + FIELD2 concatenated.

Any idea if this is possible?

Thanks,

Hammy.
 
Hi Hammy,

I have no idea what Relativity 3.24 is, but am I missing something? The trivial answer is, amongst many other ways ..

Code:
[blue]1   New-Data-Item.
  3 Field1 Pic x(10).
  3 Field2 Pic x(4).

    :
    :

    Move corr Data-ItemR to New-Data-Item[/blue]

The real answer, I guess, depends on what you're really trying to do.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Tony,

Short description.
Relativity is a product from Liant that allows access to COBOL files (RM and MF) through ODBC.

It is a very complex (and expensive) product and I am sure Tom Morrison will be able to give you a better explanation of it, but on the short it allows you to create a "table definition" based on your COBOL files FD's.
It allows for example to create a "table" based on a particular record type (very useful), or to create a table row for each OCCURS of a field.
Loads of other things are possible.


Hammy,

For your particular problem I do not know for sure if you can, as I don't have Relativity installed on my notebook (yet).
As far as I remember yes you can, but I won't be able to tell you how until later.




Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Thanks, Frederico,

Guess the Cobol answer isn't really the one wanted then [wink]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Hammy,

You would do this in the same manner as you would in any database, with the create view SQL statement. In short, the create view statement may be used to create a thing that looks like a table to the users, but which 'prepackages' the SQL so the user doesn't have to think too much...

You may see the syntax of the create view statement in Relativity's DBMS help file (look for the create view topic). If you need additional information about the SQL syntax, the help file contains a syntax summary. In this particular case, create two columns in the base table (as defined in Relativity Designer), then using the ODBC tool of your choice, execute a create view statement that has as one of its columns the expression CONCAT(field1, field2) as CombinedColumnName.

HTH!

Tom Morrison
 
Tony,

Frederico has kindly opened the door, so I will walk through... [bigsmile]

You may find more information about Relativity at
Relativity provides a fully-compliant ODBC datasource (also available in JDBC flavor) for access to COBOL data. Relativity is most effective, of course, when used with a set of indexed files, but may also be used with relative files and even sequential files.

Question for Frederico: Isn't the price of Relativity reasonable when compared to Oracle?

Tom Morrison
 
Cheers Tom,

That is exactly what I was looking for, was not even aware I could user Create View with the Realtivity Catalogues.

Thanks again,

Hammy.
 
Hammy,

Yes, it is an obscure feature in Relativity, probably due to the fact that the documentation necessarily emphasizes the Designer and DBA components leaving exploration of the SQL features as an exercise for the user.

Tom Morrison
 
Thanks Tom,

It amuses me to see PC-based Cobol systems described as Legacy, but I suppose time marches on. [smile]

It looks like it could be a powerful tool in (or even instead of) a migration exercise.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Tony,

Yes, it is a very useful tool. We have even had customers design new systems around Relativity as an inexpensive database system (in terms of deployment cost, at least).

WRT legacy there are many, many Unix-hosted systems that have roots in the minicomputer era. These are served quite nicely by the (thin) client-server version of Relativity, getting the data access to the desktop in a way that is usable by most modern spreadsheets, word processing and decision support tools -- no migration, data warehouse, etc. required.

Tom Morrison
 
Tom,

One can only compare relativity to Oracle if you are looking for the same functionality.

If you are only looking to have access to your COBOL files using Cristal Reports or Microsoft Office products, this for reporting purposes, then it is expensive, as most other fileformats vendors allow a free ODBC driver to access their fileformats.

As many of the users of COBOL applications are small companies, spending a amount of money on a ODBC driver that is sometimes greater than what the application they use costs is indeed expensive.

If we are speaking of a 2/5 users then it is a lot if money for small business.

Apart from this it is a great product, and it has load of potencial.




Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top