Page 1 of 1

mathematical functions in Eazytrieve

PostPosted: Wed Oct 05, 2011 10:03 pm
by rmateos
Hi all!

I would like to use logarithm and exponential functions in EasyTrieve.

Does anybody know how to do it? Which utility should I use?

I can't compile in the mainframe so I can just use JCL and EasyTrieve.

Help me! Thanks in advance!

Re: mathematical functions in Eazytrieve

PostPosted: Wed Oct 05, 2011 10:36 pm
by BillyBoyo
On the face of it you may be out of luck then. Easytrieve has no mathmatical functions built in.

Perhaps you could calculate your log tables? Or, I guess "out there" somewhere on the internet there must be log tables ready-made, which you could put into a file and access those.

Alternatively, are you able to create a "CSV" file (data with delimiters) and download it to a PC and stick it into a spreadsheet? Then you'll have all the mathematic functions you want.

If you can be more exact about what you are trying to do (if none of the above helps) then maybe we can come up with something else.

Re: mathematical functions in Eazytrieve

PostPosted: Thu Oct 06, 2011 2:10 pm
by rmateos
Hi!

I have already done it using the Taylor's theorem, but I wanted to know if there is an easy way because my code is quite long and difficult to understand.

There is no possibility to download the table because everything has to be done in the mainframe.

I would like to use an exponencial function --> a^b

I appreciate any answer.

Thanks for replying to me!

Re: mathematical functions in Eazytrieve

PostPosted: Thu Oct 06, 2011 3:26 pm
by BillyBoyo
Assuming that neither a nor b are constant:

You could call a Cobol/other language program to do the calculation - against this, the limits to access that you have stated;
You could calculate "in a loop", with, if a non-integer b, a final adjustment - against this, potential for introducing differences simply through calculation method vs function in some other language (you would have had an element of this anyway, probably);
You could us a file of logarithm data - against this, you say "everything has to be done on the mainframe", but in it's favour, you can do it on the mainframe if you are allowed to create a file in the target environment;
You can put your log data in an instream table;
You can put your log data as DD * data (not requiring an actual file to exist);

You can output your data to a CSV - against this, you say "everything has to be done on the mainframe", if you can explicitly confirm that you are unable to download data from the mainframe to a PC then we can forget this one.

One of the "bolded" options seems most likely since if "everything has to be done on the mainframe" and other options are precluded, then this seems a reasonable way.

Are you familiar with an Easytrieve TABLE file? The other possibility is with OCCURS.

The normal two-dimensional format of a printed log-table better fits the OCCURS, but we have computers, so turning two-dimensions into one is not beyond the possible.


Also you need to be able to get a table someone on the mainframe so you can get it in your program. If you can do that, it probably can be done with "logs" and some not over-complex coding.

Re: mathematical functions in Eazytrieve

PostPosted: Thu Oct 06, 2011 8:53 pm
by dick scherrer
Hello,

I can't compile in the mainframe so I can just use JCL and EasyTrieve.
Seems odd that you can write Easytrieve, but cannot write cobol. . .

In any case, maybe you can work with someone who CAN compile and implement something callable that will provide the functionality you want. Once implemented, you could call it from your Easytrieve code.

Re: mathematical functions in Eazytrieve

PostPosted: Mon Oct 10, 2011 4:08 pm
by rmateos
Hi all,

I'm working on it. Someone told me that there is a language called REXX, which allows using an exponential function.

If I couldn’t do it with REXX, I would try with the possibilities that Billy wrote.

Thanks for everything!

Re: mathematical functions in Eazytrieve

PostPosted: Mon Oct 10, 2011 10:18 pm
by dick scherrer
Hello,

Well, there is a very powerful language called REXX - but it has nothing to do with Easytrieve. . .