batch file of dreport commands and global variables
Richard Veith
Richard.Veith at SMRresearch.com
Mon Mar 21 07:52:49 PDT 2016
Thanks to all who responded. I am going to try Jerry Crespi's suggestion
first as it seemed the most suitable for us (only one person will be
changing the config file).
Thanks again,
Rich
-----Original Message-----
From: Richard Kreiss [mailto:rkreiss at verizon.net]
Sent: Sunday, March 20, 2016 10:47 PM
To: 'Kenneth Brody' <kenbrody at spamcop.net>; 'Richard Veith'
<Richard.Veith at SMRresearch.com>
Subject: RE: batch file of dreport commands and global variables
> -----Original Message-----
> From: Filepro-list [mailto:filepro-list-
> bounces+rkreiss=verizon.net at lists.celestial.com] On Behalf Of Kenneth
Brody
> via Filepro-list
> Sent: Sunday, March 20, 2016 12:48 PM
> To: Richard Veith <Richard.Veith at SMRresearch.com>; filepro-
> list at lists.celestial.com
> Subject: Re: batch file of dreport commands and global variables
>
> On 3/18/2016 5:12 PM, Richard Veith via Filepro-list 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.
>
> Variables only hang around as long as filePro is running. Once
> filePro
exits, all
> variables are gone.
>
> Is this variable being set by the first processing that runs? If
> that's
the case, I
> would suggest using PUTENV to set an environment variable, SYSTEM to
> the other programs, and GETENV to read that variable.
>
> (Just like filePro variables, environment variables "go away" once the
program
> exits, so you can't set it in the first dreport, exit, and expect it
> to
still be set.)
>
> --
> Kenneth Brody
One could write out the variable to a small file or to a single filepro
record and have the output processes read either the file or the filepro
record to get the variable.
I have built this type of access into one of my applications with tight
controls on what people on the system can and cannot do.
Richard Kreiss
More information about the Filepro-list
mailing list