Passing parameters - expert req'd

jwilliams

New Member
Hi Peggers,

May I enlist the help of an expert for the following:

I have a program which contains a NEW SHARED TEMP-TABLE. The program then runs another via. "mbpro". How can I get parameters through to the program being run (req_testrun.p) without having to make entries in the .pf ?

In the example below, I have defined the SHARED TEMP-TABLE in req_testrun.p but this does not work. Can anyone help me ?

-------------------------------------------------------------------
DEFINE NEW SHARED TEMP-TABLE tt........

IF request.command = "RUN" THEN
DO:
vbatch =
"mbpro -pf " + TRIM(vpf) +
" -p req_testrun.p >> " +
vscriptpath + "request.log 2>&1.

UNIX SILENT VALUE(vbatch).
PAUSE 10.
END.
-------------------------------------------------------------------

Many thanks in advance,

(exasperated) John.
 
These "mbpro" runs (there are several in the program) are run from a program which is run as a background process and I need to retrieve the information between "mbpro" runs.
 
Again, still not entirely sure what it is you are wanting to do and especially the why of it (the why might help people come up with different ideas or suggestions). But I will have a crack at answering your question anyway:

The new shared and shared temp-table only work together in the same session and not between two Progress sessions. The temp-tables are created in the memory area (or the temporary storage on disc) of the session. This means you will not be able to pass temp-tables along between two Progress sessions - if you could it would mean the two sessions would be playing with eachother's memory and that is definately not a good idea.

If you have not too much data in the temp-table you could create a little (unique) ASCII file and pass the file name along between the two mbpro sessions with a startup parameter eg: -param "FileName=<filename>"

Your code would then look something like this:
Code:
"mbpro -pf " + TRIM(vpf) +
" -param ~"FileName=<filename>~" -p req_testrun.p >> " +
vscriptpath + "request.log 2>&1."
In the above <filename> is the name of the temporary ASCII file you stored the information in. When the second mbpro run is done it can delete the ASCII file if it is no longer required.

If the amount of data you need to pass along is larger, I think the only thing you can do is to store it in a database table and work out a way for the second Progress session to find it (probably with the parameter used in the example above to tell the second session what the identifier of the data is).

All of the above is of course only as a "workaround" if you are absolutely certain you cannot do the processing within the one single mbpro session by using normal RUN statements (in which case your shared temp-table would work). This should also be a lot more effecient....

HTH
 
Hi Paul,

Thanks very much for your replies. They are very much appreciated. You have understood the problem correctly and your ideas for solutions are also the same as my colleagues and myself came up with. It may be that we end up "re-engineering" a bit as the amount of data we need to retrieve could be significant. The problem we have is the way this particular system is built. We want to avoid "stacking" requests as much as possible, hence the mbpros. It works very well, but is not very adaptable to change, but change we must.

Thanks again and kind regards,

John.
 
Another idea would be to pass parameters via a DB table (one that you can create in your custom DB). Then all you'd need to do is create a nID in your calling program, pass it to your batch process (via the -param), and then retrieve the parameters in your batch program.

This way, you only require a single parameter being passed ... and that will never change.
 
Back
Top