batch file of dreport commands and global variables
Jerry Crespi
jcrespi at alliedhr.com
Fri Mar 18 16:40:27 PDT 2016
At 04:14 PM 3/18/2016, you wrote:
>Hi,
>
> We run batch files consisting of 10 to 20 commands that begin with
>"dreport " to execute various FilePro programs (processing tables). A
>number of these programs all need the same variable whose content changes
>monthly. Is it possible to somehow declare a global variable at the
>beginning of the batch file and be able to use it in subsequent executions
>of the dreport commands?
>
>
>
> I tried declaring the variable Global and defining its content in the
>first program, and then declaring it Extern in later programs, but the later
>programs do not get the variable's value. It seems to be lost between
>dreport executions. I also tried CALLing a short program that defined the
>variable and its content (again with the Global declaration) from each of
>the programs that need it (with the Extern declaration), and that worked in
>some cases, but for programs that run against a file of about 20 million
>records, the processing would prematurely end with an out-of-memory error.
>
>
>
>Thanks,
>
>Rich
A simple way of having the variable available for all the processes
you are running is to include a variable name in the fp config
file. For example, MyGlobal
and set the MyGlobal to the value needed for that run. (MyGlobal=neededvalue)
Then in your processing use x=getenv("MyGlobal") and it will retrieve
the value into x.
You may need to write a script to change the value of MyGlobal in
fp\lib\config at the beginning of your batch file. \fp\lib\config is
a text file.
Jerry Crespi, Ph.D.
President
Allied Business Systems Inc.
V. (714) 963-5554
F. (714) 964-0061
More information about the Filepro-list
mailing list