Selection date question

Lerebours, Jose Jose.Lerebours at EagleGL.com
Fri Feb 18 14:21:20 PST 2005


Don Coleman posted:

> 
> I have a series of reports (3) different menu selections 
> which function 
> as follows:
> 
> DPRODIR -K to remove previous selection criteria
> *CLERK to add 19 different selction criteria (2 date fields 
> and 17 YESNO 
> fields)
> *REPORT to post data from an archive file to a temporary posting file
> *REPORT to post data from a working file to the same 
> temporary posting file
> *REPORT to print the data with data combined from the archive and 
> working files
> 
> The archive and working files have identical maps.  Their only 
> difference is the archive file contains orders processed previously.  
> The working file contains only open orders and those orders 
> processed on 
> a given day are archived each night.  The data posting and reports 
> function as designed.  However, since I am processing from multiple 
> files I had to post the date range fields to a control file and could 
> not simply use -R to pass the parameter.
> Originally, only one person was running these reports.  Now however, 
> more than one person is running them and I am concerned that 
> before one 
> process is completed another person will start another process with 
> different selection criteria (-V table).  Hence the second person 
> running the report could affect the results of person #1 
> running their 
> report depending on where in the process person #1 was.  Does anyone 
> have any suggestions for isolating the record being used for 
> one person 
> only short of something like this:
> 
> Menu selection #1 posts to record #1 in control file
> Menu selection #2 posts to record #2 in control file
> ...
> This method would not work well for two people running the 
> same report 
> at the same time.  I would appreciate any better ideas.  
> Thanks and have 
> a good weekend.
> 

Boy, you are busy!

Well, I would venture to suggest that this can be easily
solved if you TAG your records with a "stamp" that will
make them unique from user to user, or even from time
the operation was started.

This is what I would do with minimun change to what
you have:

1.  Combine your 3 options into one.  No need for three
    menu options

2.  Create a STAMP made up of user ID, Date and Time or
    anything that will make a unique key
 

      STAMP="`logname` `date +%Y%m%d%H%M%S"

3.  Run your report/clerk passing "$STAMP" using 
    filePro standard arguments (-r -ry ...)

4.  Modify programs to use @p? to match passed parameter
    with recorded STAMP and select/print only matching
    records.

The program responsible for collecting the date range
will use the STAMP to identify the selection criteria.

Once you print the record, you can remove the record or
set a `cron` to erase temporary files each night.

Of course, you need to change your maps to add a field
where the STAMP will be kept.

You will need to modify your selection process on the 
final report (the printing report process) to select
records based on the STAMP.

Hope this helps!


Jose Lerebours




More information about the Filepro-list mailing list