Process Scheduler Schedules- Run Program

When running a program in the Process Scheduler, you have two options:

  • Run Program (don't wait): you can either start the program and proceed immediately to the next step in the schedule. You use this if the steps are independent and can run simultaneously.

  • Run Program (wait): you can start the program and wait for it to finish before moving on to the next step in the schedule. You use this if the steps need to be executed in sequence.

Note: If there's only one step in the schedule, both options function similarly.

Passing Parameters to the program

When you use Run Program or Run Program (wait)  you can pass in parameters in the Command line that can be used by the Program.

     –d %ORGID%
     -u %USER%
     -p %PASSWORD%

At the time of running, Process Scheduler will pass in the company, user id and password as specified in ”company” on the row, and as entered in the ”Companies” screen.  

Log files

You can use Process Scheduler to email the log file from the program

For Run Program (wait) only

     -l %LOGFILE%

With the logfile, Process Scheduler will create the file and pass in the name to the external program.  If the external program writes something back into that file, then Process Scheduler will read this back and include what is in the file in the e-mail if the step is configured to send an email.

The first line of the LOG file in the format LASTSTAT | NERRORS | LASTLOG (fields separated by a | pipe character) is used to flag the step as success/failure.

If the LASTSTAT field is OK then the step is considered successful. The NERRORS field is displayed in the "Number of errors" field and the LASTLOG field is displayed in the Last log field on the Schedule step.

If the program does not write a LASTSTAT | NERRORS | LASTLOG to the log file, then the program return value is used instead. 0 means success, non-zero means failed.