batch file of dreport commands and global variables

Nancy Palmquist nlp at vss3.com
Mon Mar 21 12:11:27 PDT 2016


Rich,

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.
>
>   
>
> Thanks,
>
> Rich
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20160318/c6962ff8/attachment.html>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
I like to suggest that you setup a filepro file to control your values 
for this report - and maybe others.  The first thing you can do in the 
batch file is to use dclerk and enter the values needed for the report.  
This gives you full editing to insure the data is acceptable.  This 
could also be done with Scan/Select Processing on the first report  with 
input popup questions and the data could be written to the control file 
when the questions have been answered and accepted as allowed.

Then all the rest of the reports can do a look up to that control file 
and get the appropriate values.

Using the CONFIG table does not allow for any editing of the data 
supplied.  I would not recommend this kind of solution, or even the 
Putenv to add a value to your environment.

By putting the data in a control file, you have a record of the answers 
supplied during the last run of the report.  I think you will find this 
a good solution for this type of setup.

I might note that Windows batch files can be difficult.  I have seen 
certain error conditions cause the batch file to abort before finishing 
all the items.  I might offer that a control file can give you a place 
to note if a report was run.  That would also give you a way to pick up 
in the middle of the list by checking and if the report was already run 
today (for example) then that report is skipped.  This might be helpful 
if these reports need to run in order each day.  You have a way to check 
if the prior report was run before the next report will run.



Nancy

-- 
Nancy Palmquist         MOS & filePro Training Available
Virtual Software Systems    Web Based Training and Consulting
PHONE: (412) 835-9417           Web site:  http://www.vss3.com



More information about the Filepro-list mailing list