create computations on the fly
0 pts.
0
Q:
create computations on the fly
We are primarily a COBOL shop. We have some COBOL ILE and some RPG. I have a need to replicate a function on the I-series that is currently done in Excel. This function allows them to create formulas on the fly to arrive at pricing information. I can work through issues with interactive maintenance of the formulas. Has anyone ever built COMPUTE or arithmetic statements on the fly inside of a program? Is so can you provide some insight on how you implmented?

Appreciate any information. Thanks!
ASKED: Oct 31 2006  12:47 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
0 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Cobol is compiled, so you're not going to get much on the fly. One way to do this is to parse through your input and execute it directly. That works every time, but is time-consuming to write. A second way is a have a collection of stored methods, with names or numbers, and execute the one specified. The down-side here is that you will be adding to the program from time to time, and ad hoc queries won't be handled.
---
Sheldon Linker (sol@linker.com)
Linker Systems, Inc. (www.linkersystems.com)
800-315-1174 (+1-949-552-1904)
Last Answered: Oct 31 2006  1:33 PM GMT by SheldonLinker   0 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

BeerMaker   0 pts.  |   Oct 31 2006  1:52PM GMT

yes, we have done something similar that may be helpful. Its basically a compiler and scripting language that creates machine code you can call at runtime. The users can generate script modules the would be compiled and linked in to other programs. Since it generates machine code its extremely fast for high volume transactions.

If you’d like to talk about licensing this technlogy or getting some assistance send me a private message.

 

walter47   120 pts.  |   Oct 31 2006  4:03PM GMT

I’m sure you are using CL to execute this application. I’ve done similar by passing parameters to the executing
program.

 

bigaub   0 pts.  |   Oct 31 2006  6:28PM GMT

Use dynamic SQL. This allows you to do calculations on the run.

 

bigaub   0 pts.  |   Oct 31 2006  6:28PM GMT

Use dynamic SQL. This allows you to do calculations on the run.

 

whanzens   0 pts.  |   Nov 1 2006  9:18AM GMT

I once (in 1990) wrote a program to calculate the value of an arithmatic statement. This program is written in RPG III and has 3 parameters, the statement (255A), the result (30,9) and an error code (2A). The statement can consist of the following signs, +, -, /, *, ^, (, ), SQR() for square root with numbers everywhere in it.
If you’re interested, send me a private message.

 

BeerMaker   0 pts.  |   Nov 1 2006  11:34AM GMT

our solution uses a proprietary scripting language and compiler to generate machine code. Assembly modules dynamically load these functions from the Loadlib based on VSAM table entries then the calculations are loaded and executed. The script language provids access to fields in our system and results are passed back in return values to be processed by cobol programs in a batch process.

This is part of a proprietary system that has been running nightly at several customers for about 8+ years.

If you can use Dynamic SQL or a stored proc it would be a good option. We were limited to mainframe and VSAM, but needed a scripting/parsing solution that changes based on customer input.

If you have a front end that is a Windows EXE there are add-ons that can use VB and you can run VB on the fly in your front end.

 
0