Background processing of records 
Author Message
 Background processing of records

I want a background process to step through records of one file about once a
second, and change the status of a field in another file if certain
conditions are met.  I am assuming I need to use the timer() command.  I
have been reading the manual and it shows a window type of procedure but I
really don't want a window.  Does anyone have some code examples?

background procedure

   code

      next(file_a)
      fla:



Sat, 28 Dec 2002 03:00:00 GMT  
 Background processing of records
Check out the IDLE() command

I use the following
IDLE(CheckForShutDown,900)

This is in an embed high-up in the FRAME of my applications.  The 900 makes it
fire off every 15 minutes.  It is calling a procedure CHECKFORSHUTDOWN which
examines a file to see if a field is now 1 (meaning that hte software needs to
shutdown so I can pull maintenance).

Just replace CHECKFORSHUTDOWN with whatever procedure you want to automatically
start an adjust the 900 to be less to make it happen more often.

        Tim

Quote:

> I want a background process to step through records of one file about once a
> second, and change the status of a field in another file if certain
> conditions are met.  I am assuming I need to use the timer() command.  I
> have been reading the manual and it shows a window type of procedure but I
> really don't want a window.  Does anyone have some code examples?

> background procedure

>    code

>       next(file_a)
>       fla:

--
Tim Phillips
Vermont Agency of Natural Resources
Department of Environmental Conservation


Sat, 28 Dec 2002 03:00:00 GMT  
 Background processing of records
Quote:

> I want a background process to step through records of one file about once a
> second, and change the status of a field in another file if certain
> conditions are met.  I am assuming I need to use the timer() command.  I
> have been reading the manual and it shows a window type of procedure but I
> really don't want a window.  Does anyone have some code examples?

I often use a window to get a timer but just hide the window. The timer still
functions.  Unless there are very few records or they fit all into memory your
going to have an awfull lot of disk activity.  Are you sure this is a good
design?
----------
Jim Kane  - TeamTopSpeed
Productive Software Solutions
Can't Find that Message?
Get Organized, Get ForKeeps!
www.fkeeps.com


Sat, 28 Dec 2002 03:00:00 GMT  
 Background processing of records
It says in the Language reference that you can set the timer to trigger up
to every minute (6000 hundreths of a sec, 6553 max).  So if we process a
single record once a minute, the user wouldn't even know it was going on.

The problem is that the parent file records need to be selected on inserting
child records, where child records of parent records are not currently
active.  Child records are active for a fixed period of time(ie:1 week).

It is the classic programming problem of the cart before the horse.

files:

    Parent-  cam:camper
    Child-     ouc:outing

init routine:

    set(outing,process_key)  ! select only active records

background task:

    next(outing,process_key)  ! next active record

       if
           ouc:date=today()
       then
          cam:cam_id=ouc:cam_id
          set(camper,cam_id_key,cam:cam_id)
          cam:status=true
          put(camper)
       .

  return

Can I have a background process without using a window to create it?

Don Golding


Quote:

> > I want a background process to step through records of one file about
once a
> > second, and change the status of a field in another file if certain
> > conditions are met.  I am assuming I need to use the timer() command.  I
> > have been reading the manual and it shows a window type of procedure but
I
> > really don't want a window.  Does anyone have some code examples?

> I often use a window to get a timer but just hide the window. The timer
still
> functions.  Unless there are very few records or they fit all into memory
your
> going to have an awfull lot of disk activity.  Are you sure this is a good
> design?
> ----------
> Jim Kane  - TeamTopSpeed
> Productive Software Solutions
> Can't Find that Message?
> Get Organized, Get ForKeeps!
> www.fkeeps.com



Sun, 29 Dec 2002 03:00:00 GMT  
 Background processing of records
It says in the Language reference that you can set the timer to trigger up
to every minute (6000 hundreths of a sec, 6553 max).  So if we process a
single record once a minute, the user wouldn't even know it was going on.

The problem is that the parent file records need to be selected on inserting
child records, where child records of parent records are not currently
active.  Child records are active for a fixed period of time(ie:1 week).

It is the classic programming problem of the cart before the horse.

files:

    Parent-  cam:camper
    Child-     ouc:outing

init routine:

    set(outing,process_key)  ! select only active records

background task:

    next(outing,process_key)  ! next active record

       if
           ouc:date=today()
       then
          cam:cam_id=ouc:cam_id
          set(camper,cam_id_key,cam:cam_id)
          cam:status=true
          put(camper)
       .

  return

Can I have a background process without using a window to create it?

Don Golding>



Sun, 29 Dec 2002 03:00:00 GMT  
 Background processing of records
Quote:

> It says in the Language reference that you can set the timer to trigger up
> to every minute (6000 hundreths of a sec, 6553 max).  So if we process a
> single record once a minute, the user wouldn't even know it was going on.

You said once a second in your original post.

Quote:
> The problem is that the parent file records need to be selected on inserting
> child records, where child records of parent records are not currently
> active.  Child records are active for a fixed period of time(ie:1 week).

I would put the task on its own thread and be sure the files involved are
threaded. Other wise other usage of the file will move the file pointer.

To have a CW timer you must have a window. You can hide the window if you dont
want to see it. I dont see any advantage to avoiding a window.  If you must
use the api settimer() but it's a lot more work and no gain.

Jim Kane  - TeamTopSpeed
Productive Software Solutions
Can't Find that Message?
Get Organized, Get ForKeeps!
www.fkeeps.com



Sun, 29 Dec 2002 03:00:00 GMT  
 Background processing of records
I have it working but I have to call the procedure as the Splash Screen of
the Main Menu.  Is there a good embed point for this in the Main Menu embed
points?  My customer wants to use the splash screen for something else...

Thanks,
Don Golding
Angelus Research Corp.
http://www.angelusresearch.com



Tue, 31 Dec 2002 03:00:00 GMT  
 Background processing of records
Quote:

> I have it working but I have to call the procedure as the Splash Screen of
> the Main Menu.  Is there a good embed point for this in the Main Menu embed
> points?  My customer wants to use the splash screen for something else...

Like I said, create a window, hide it, and use it just for a timer. Open it
when ever you need to run the process close it after.
----------------
Jim Kane  - TeamTopSpeed
Productive Software Solutions
Can't Find that Message?
Get Organized, Get ForKeeps!
www.fkeeps.com


Tue, 31 Dec 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. How to get rid of the NO RECORDS TO PROCESS message on a process

2. VAST and MQ: Background process consumes all responses

3. Background process

4. Background processes

5. Background Process hoarding cycles

6. How to make Clarion process executing in background?

7. Background Processing

8. Background processing.

9. I need a background task to process a file once a day

10. -- Starting a Background Process

11. Useing AcuCobol programs in batch (background) processing.

12. Newbie: Background processing with a GUI?

 

 
Powered by phpBB® Forum Software