Skip to main content

I am writing a basic program to execute programs in phantom mode. Right now, the main program executes all of the individual programs at 1 am. Will be adding in features to specify what time to start each individual program at, what frequency (daily,monthly,etc), pause the individual program . If you can think of any other features that may be helpful, please let me know. Eventually I plan on releasing the program for anyone's use. If you need something like this now, let me know.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

I am writing a basic program to execute programs in phantom mode. Right now, the main program executes all of the individual programs at 1 am. Will be adding in features to specify what time to start each individual program at, what frequency (daily,monthly,etc), pause the individual program . If you can think of any other features that may be helpful, please let me know. Eventually I plan on releasing the program for anyone's use. If you need something like this now, let me know.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

I'm not sure my previous attempt worked; so I apologise if this ends up in the thread twice...

Hi Dave,

Are you perhaps re-inventing the wheel?

Have you looked at the background command in the d3 manual?

Or use inbuilt scheduling of Windows & Linux to execute d3 commands via the d3TCL command?

Either or both may do what you need with no further work?

Best wishes,



------------------------------
David Knight
Senior Software Engineer
H3O Business Technologies Limited
------------------------------


I am writing a basic program to execute programs in phantom mode. Right now, the main program executes all of the individual programs at 1 am. Will be adding in features to specify what time to start each individual program at, what frequency (daily,monthly,etc), pause the individual program . If you can think of any other features that may be helpful, please let me know. Eventually I plan on releasing the program for anyone's use. If you need something like this now, let me know.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

Hi Dave,

for flexibility, I suggest that it reads a file which has the details in it :

  1. program to run.
  2. one off or regular occurance
  3. time to run
  4. date / day of week or month to run
  5. account (& user?) to run in 
  6. time & date last run (to avoid running multiple times in the one period)

eg1 : end of month program  ;  runs regular occurance  ;  1am  ;  1st day of month  ;  accounting account

eg2 :  backup  ;  runs regular occurance  ;  11pm ; daily Monday to Friday  ;  dm account

Essentially you will have 2 programs. The phantom and a scheduling program run by the user.

When the phantom runs the designated program, it updates item 6 to avoid multiple instances of that program.

The scheduling program lays out what's to be run and when (and can display when last run) in a user friendly manner.

I hope this helps.

Regards,

Warwick



------------------------------
Warwick Dreher
Warwick Dreher
Croydon AU
------------------------------

I am writing a basic program to execute programs in phantom mode. Right now, the main program executes all of the individual programs at 1 am. Will be adding in features to specify what time to start each individual program at, what frequency (daily,monthly,etc), pause the individual program . If you can think of any other features that may be helpful, please let me know. Eventually I plan on releasing the program for anyone's use. If you need something like this now, let me know.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

David, are you looking to have the controller run the jobs, or merely kick off other phantoms to run the jobs?



------------------------------
Kevin King
President
Precision Solutions, Inc.
Longmont CO US
------------------------------

I am writing a basic program to execute programs in phantom mode. Right now, the main program executes all of the individual programs at 1 am. Will be adding in features to specify what time to start each individual program at, what frequency (daily,monthly,etc), pause the individual program . If you can think of any other features that may be helpful, please let me know. Eventually I plan on releasing the program for anyone's use. If you need something like this now, let me know.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

On Linux I use cron for starting phantom jobs on various schedules.

FDOM.CRON (first day of month paragraph)

FDOQ.CRON (first day of quarter paragraph)

NIGHTLY.CRON etc...

These UV paragraphs phantom off individual programs / other paragraphs.



------------------------------
Lance Jahnke
UAPDI
Oracle AZ US
------------------------------


Hi Dave,

for flexibility, I suggest that it reads a file which has the details in it :

  1. program to run.
  2. one off or regular occurance
  3. time to run
  4. date / day of week or month to run
  5. account (& user?) to run in 
  6. time & date last run (to avoid running multiple times in the one period)

eg1 : end of month program  ;  runs regular occurance  ;  1am  ;  1st day of month  ;  accounting account

eg2 :  backup  ;  runs regular occurance  ;  11pm ; daily Monday to Friday  ;  dm account

Essentially you will have 2 programs. The phantom and a scheduling program run by the user.

When the phantom runs the designated program, it updates item 6 to avoid multiple instances of that program.

The scheduling program lays out what's to be run and when (and can display when last run) in a user friendly manner.

I hope this helps.

Regards,

Warwick



------------------------------
Warwick Dreher
Warwick Dreher
Croydon AU
------------------------------

I can only encourage the "control file" approach. Perhaps (maybe) also add any parameters the program (to run) may require.

Stefano



------------------------------
Stefano Gallotta
Managing Member
Simply Red Open Systems
Milnerton ZA
------------------------------

David, are you looking to have the controller run the jobs, or merely kick off other phantoms to run the jobs?



------------------------------
Kevin King
President
Precision Solutions, Inc.
Longmont CO US
------------------------------

In some cases, the controller would run the jobs, could also have a phantom run the job. For my initial testing, I am having the controller run all of the jobs.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

On Linux I use cron for starting phantom jobs on various schedules.

FDOM.CRON (first day of month paragraph)

FDOQ.CRON (first day of quarter paragraph)

NIGHTLY.CRON etc...

These UV paragraphs phantom off individual programs / other paragraphs.



------------------------------
Lance Jahnke
UAPDI
Oracle AZ US
------------------------------

Trying to make something simple for the end user to use. The customer that I am working with has data exports that they run frequently. Basic programs generate these exports. I created a Unidata file called PHANTOM.JOBS. PHANTOM.JOBS records are the program ids to be run. 

SORT PHANTOM.JOBS
PHANTOM.JOBS     
            
             
TEST1            
TEST2            
etc



------------------------------
David Rivera
Self Registered
FORT LAUDERDALE FL US
------------------------------

In some cases, the controller would run the jobs, could also have a phantom run the job. For my initial testing, I am having the controller run all of the jobs.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

If the controller is responsible for only starting the jobs (as other phantoms) you don't have to worry about the possibility of another job running and occupying the attention of the controller when another scheduled time arrives for a different job.  Just a thought.

I agree with the other ideas about putting the job information in a file of some sort that the controller can process.



------------------------------
Kevin King
President
Precision Solutions, Inc.
Longmont CO US
------------------------------

I am writing a basic program to execute programs in phantom mode. Right now, the main program executes all of the individual programs at 1 am. Will be adding in features to specify what time to start each individual program at, what frequency (daily,monthly,etc), pause the individual program . If you can think of any other features that may be helpful, please let me know. Eventually I plan on releasing the program for anyone's use. If you need something like this now, let me know.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

I have written a program like this previously.  My master scheduler program ran as a phantom and woke up every minute to kick off separate phantoms for each scheduled task.  The Master Scheduler used a master control record to indicate the following:

  1. Is the Master Scheduler Active.
  2. The port the Master Scheduler was running on (as a phantom).
  3. Date last run.
  4. Time last run.

This master program pulled the list of scheduled programs from a file.  The records in this file had fields related to that task.

  1. Enabled flag
  2. Single Run or regular schedule
  3. Account
  4. Program to run
  5. Cron structured time to run
  6. Port task is running on as a phantom
  7. Phantom ID for the running task
  8. Last Run Date
  9. Last Run Time
  10. Next Run Date
  11. Next Run Time
  12. Output of the task
  13. Status message for the task like (failed, success, etc)

The reason I had a Next Run Date and Time is because when the task ran, I calculated the next date and time from a Cron program I created.  Storing the result meant I did not need to recalculate the Cron to see if it should be run or not.

Every time the Master Scheduler woke up, I checked the master control record to see if I should self-terminate if the Active flag was set to zero.  I had a separate utility which set that flag, kicked off the phantom, checked if it was still running in the background and other administrative tasks.



------------------------------
Joseph von Arx
Software Developer
Data Management Associates Inc DMA
Cincinnati OH US
------------------------------

I am writing a basic program to execute programs in phantom mode. Right now, the main program executes all of the individual programs at 1 am. Will be adding in features to specify what time to start each individual program at, what frequency (daily,monthly,etc), pause the individual program . If you can think of any other features that may be helpful, please let me know. Eventually I plan on releasing the program for anyone's use. If you need something like this now, let me know.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

My suggestion is that each job has a wrapper that you kick off.  This wrappers only function is to email you that the job is starting, and if possible on which pid if it can, and then also record that information in some JOBS file.  This will help you greatly when debugging if the jobs are working or have stopped for some reason



------------------------------
Will Johnson
Systems Analyst
Rocket Forum Shared Account
------------------------------

My suggestion is that each job has a wrapper that you kick off.  This wrappers only function is to email you that the job is starting, and if possible on which pid if it can, and then also record that information in some JOBS file.  This will help you greatly when debugging if the jobs are working or have stopped for some reason



------------------------------
Will Johnson
Systems Analyst
Rocket Forum Shared Account
------------------------------
Yes, this is a good suggestion.

On Fri, Jul 26, 2024, 9:56 AM Will Johnson via Rocket Forum <
Mail@forum.rocketsoftware.com> wrote:

> My suggestion is that each job has a wrapper that you kick off. This
> wrappers only function is to email you that the job is starting, and if...
> -posted to the "General Discussion & Announcements" forum
> Invite your colleagues to join the Rocket Forum and grow our expert
> network.
> ------------------------------
> [image: Rocket Software]
> General Discussion & Announcements
>
> Post New Message Online
>
> Invite your colleagues to join the Rocket Forum and grow our expert
> network. Share this link.
> Re: Phantom Job Scheduler
>
> Reply to Group Online
> Reply
> to Group
>
> [image: Will Johnson]
>
> Jul 26, 2024 9:55 AM
> Will Johnson
>
>
> My suggestion is that each job has a wrapper that you kick off. This
> wrappers only function is to email you that the job is starting, and if
> possible on which pid if it can, and then also record that information in
> some JOBS file. This will help you greatly when debugging if the jobs are
> working or have stopped for some reason
>
>
> ------------------------------
> Will Johnson
> Systems Analyst
> Rocket Forum Shared Account
> ------------------------------
> *Reply to Group Online
> *
> *View Thread
> *
> *Forward
> *
> *Post New Message Online
> *
>
>

Hi Dave,

for flexibility, I suggest that it reads a file which has the details in it :

  1. program to run.
  2. one off or regular occurance
  3. time to run
  4. date / day of week or month to run
  5. account (& user?) to run in 
  6. time & date last run (to avoid running multiple times in the one period)

eg1 : end of month program  ;  runs regular occurance  ;  1am  ;  1st day of month  ;  accounting account

eg2 :  backup  ;  runs regular occurance  ;  11pm ; daily Monday to Friday  ;  dm account

Essentially you will have 2 programs. The phantom and a scheduling program run by the user.

When the phantom runs the designated program, it updates item 6 to avoid multiple instances of that program.

The scheduling program lays out what's to be run and when (and can display when last run) in a user friendly manner.

I hope this helps.

Regards,

Warwick



------------------------------
Warwick Dreher
Warwick Dreher
Croydon AU
------------------------------

I love this approach because it allows you to construct a utility that will not require coding to remove or add new programs for the Phantom / Cron Job to run.  One thing I always remind myself is to make sure that the program will never prompt for input, which in unix/linux, will kill the phantom job. It's more work on the front end, but worth it for future ease of maintenance.  



------------------------------
Mark Sapp
Senior Software Developer
Rocket Internal - All Brands
------------------------------

I am writing a basic program to execute programs in phantom mode. Right now, the main program executes all of the individual programs at 1 am. Will be adding in features to specify what time to start each individual program at, what frequency (daily,monthly,etc), pause the individual program . If you can think of any other features that may be helpful, please let me know. Eventually I plan on releasing the program for anyone's use. If you need something like this now, let me know.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

We have a similar scheduler running 24x7 to schedule various tasks as you've suggested. Reading the scheduled task list/parameters certainly is the way to go as others have suggested. You may or may not wish to include options such as a 'run as a phantom' switch and possibly a 'run on a business day' switch in addition to the other suggestions.

Maybe also have some way of cleanly stopping it and having it remain stopped may also be desirable with the use of a separate scheduler control.

Cheers



------------------------------
Peter Cheney
Software Superstar
Firstmac
Brisbane Qld Australia
------------------------------

I am writing a basic program to execute programs in phantom mode. Right now, the main program executes all of the individual programs at 1 am. Will be adding in features to specify what time to start each individual program at, what frequency (daily,monthly,etc), pause the individual program . If you can think of any other features that may be helpful, please let me know. Eventually I plan on releasing the program for anyone's use. If you need something like this now, let me know.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

When invoking the UniVerse shell from the OS with the intent to run a program as a phantom use the nohup command.
For example:
nohup `cat /.uvhome`/bin/uvsh "PHANTOM EOM.REPORT" > /dev/null 2>&1 &


Otherwise, any evaluations of the @TTY variable performed in VOC "LOGIN" meant to bypass menus and/or prompts might not work.



------------------------------
Brian Phillips
Programmer/DB Analyst
Hitech Systems Inc
Los Angeles CA US
------------------------------

I have written a program like this previously.  My master scheduler program ran as a phantom and woke up every minute to kick off separate phantoms for each scheduled task.  The Master Scheduler used a master control record to indicate the following:

  1. Is the Master Scheduler Active.
  2. The port the Master Scheduler was running on (as a phantom).
  3. Date last run.
  4. Time last run.

This master program pulled the list of scheduled programs from a file.  The records in this file had fields related to that task.

  1. Enabled flag
  2. Single Run or regular schedule
  3. Account
  4. Program to run
  5. Cron structured time to run
  6. Port task is running on as a phantom
  7. Phantom ID for the running task
  8. Last Run Date
  9. Last Run Time
  10. Next Run Date
  11. Next Run Time
  12. Output of the task
  13. Status message for the task like (failed, success, etc)

The reason I had a Next Run Date and Time is because when the task ran, I calculated the next date and time from a Cron program I created.  Storing the result meant I did not need to recalculate the Cron to see if it should be run or not.

Every time the Master Scheduler woke up, I checked the master control record to see if I should self-terminate if the Active flag was set to zero.  I had a separate utility which set that flag, kicked off the phantom, checked if it was still running in the background and other administrative tasks.



------------------------------
Joseph von Arx
Software Developer
Data Management Associates Inc DMA
Cincinnati OH US
------------------------------

I too wrote a process like this where the users could add their own jobs with whatever parameters applied for the job.  Because there may be dates within the parameters for repeat jobs (eg; from 5/1 to 5/31), the scheduler had to look for any dates and change them for the next run depending on the repeat cycle (eg; a monthly run from 6/1 to 6/30).



------------------------------
DAVID LAMOREE
Rocket Forum Shared Account
------------------------------

In some cases, the controller would run the jobs, could also have a phantom run the job. For my initial testing, I am having the controller run all of the jobs.



------------------------------
Dave Schwartz
Self Registered
FORT LAUDERDALE FL US
------------------------------

I agree with David Knight, above.

How is this different from D3's built-in BACKGROUND command?



------------------------------
Martin Shields
Senior Technical Consultant
Meier Business Systems PTY LTD
Carnegie VIC AU
------------------------------

We have a similar scheduler running 24x7 to schedule various tasks as you've suggested. Reading the scheduled task list/parameters certainly is the way to go as others have suggested. You may or may not wish to include options such as a 'run as a phantom' switch and possibly a 'run on a business day' switch in addition to the other suggestions.

Maybe also have some way of cleanly stopping it and having it remain stopped may also be desirable with the use of a separate scheduler control.

Cheers



------------------------------
Peter Cheney
Software Superstar
Firstmac
Brisbane Qld Australia
------------------------------

This sounds like a very interesting shared project for a utility that anyone could find valuable.

We are on the jBASE side but everything you mention could be common across all products.

Other topics we have worked with include dependencies, execution trees, error traps and restarts, and event triggers.

Could we talk the group into a non-green front end? 

Lamont



------------------------------
Lamont Lockwood
Integration Expert
Dallas, Texas
l2@integrationexpert.com
------------------------------