Batch Job Server Features
Batch Job Server (BJS) is a batch job management environment for Windows. It manages the scheduling, queuing and execution of Windows batch files (batch jobs) submitted by users, programs or other host systems. BJS is a
64-Bit and 32-Bit Windows service. It can be installed in either Windows 2000, 2003, 2008, 2012, 2012 R1, 7, 8, XP and Vista.
Microsoft .Net technology has been used in many of the core components
of BJS v3.0. This provides a basis for enhancements and support of BJS
for future versions of Windows. No changes will be made to BJS version
2.x for Windows compatibility.
BJS V3.0 Build 757 Enhancements
1. A BootDelay parameter can now be set for the BJS service that will allow the delay of BJS job scheduling for a user specified number of seconds to insure all system services are operational. This enhancement also prevents a number of BJS service errors that previously occurred during a system reboot when system services were not fully operational.
2. Performance and reliability enhancements have been made for operation in Native-mode Active Directory environments.
3. Desktop and window station quota shortage errors (insufficient resources to complete this operation errors) are now prevented when the number of BJS users exceeds
30. This enhancement requires the purchase of the BJS Executive Object Quota (EOQ) Manager.
4. All known Day Light Savings scheduling failures have been corrected.
5. BJS service startup errors from JbSrvMn.exe have been corrected. This was primarily a problem with Vista and Windows 2008 Server.
6. A number of BJS Administrator and BJS Client connection errors when using a local username have been corrected.
7. Formatting alignment problems on the Job Detail dialog are corrected.
Minimal System Requirements
The Batch Job Server service (the server component of BJS) is a 32-Bit Windows service. It can be installed on a Windows computer. The BJS service typically requires less than 1% of CPU resources. BJS v3.0 client administrator software works with a BJS v2.1 server. For additional information on versions of Windows supported and other system requirements view
BJS System Requirements.
BJS Version 2.x and
BJS Version 3.0
version 2.x and BJS version 3.0 are not compatible with one another,
when connected between servers. You can upgrade your BJS 2.x to BJS
version 3.0 to make them compatible. Please review pricing,
for a quote.
BJS Version 2.x and Windows Compatibility
BJS version 2.x may no longer work as changes are made by Microsoft to Windows. No changes for operating system compatibility or upgrades will be made by Camellia Software to BJS version 2.x. Any operating system compatability changes will be made to BJS version 3.x.
Automated Job Submission
Batch job submission can be automated by copying a batch file to a Batch Job Server job directory. This can be done using ftp from another host system, from a program or from another batch job.
32-Bit and 64-Bit Windows Interface
Users can define, monitor and control submit, hold, release, modify, cancel and purge their batch jobs via a 32-Bit
or 64-bit Windows application (BJS Client or BJS Administrator).
32-Bit Command Line Interface
Users can monitor and control, submit, hold, release, modify, cancel and purge their batch jobs from a DOS prompt on a Windows system or from within a batch job. The BJS command line interface can also be used from a Telnet or remote command shell interface.
One Time Only Jobs
The BJC SCHED_DBJOB command now includes a ONE_TIME_ONLY parameter. This allows applications that use the BJS command line interface or the BJS API to schedule a one-time job in the BJS job database. The job is deleted from the database immediately after the job is submitted.
Complete Job Scheduling
Batch jobs can be scheduled at a specific time or on a recurring basis. The scheduling functions of Batch Job Server include all of the functionality of the Windows AT command and much more. Batch jobs can be scheduled based on a customized calendar. For instance, it is possible to schedule a batch job every day except for weekends or holidays. Or a batch job can be scheduled on the first, nth and/or last permitted processing day each week or month.
Batch jobs can also be submitted every nth minute, hour, day, etc.
Schedule A Job During System Boot
When this option is selected, the batch job is automatically scheduled when the operating system is booted.
Batch Jobs Unaffected If BJS Service Stops
Batch Job Server can be stopped and restarted without effecting queued or executing batch jobs.
Complete Interactive Help System
A complete on-line, context sensitive help system is included.
Job Submission by Local and Remote Users
Batch jobs can be submitted by local and remote users, including wide area network users, users in trusted domains and dial-up users.
Job Submission by Remote Hosts and Servers
Batch jobs can be submitted by IBM Mainframes, Unix hosts and other NT servers. Batch Job Server is designed to simplify database replication to SQL Server and other applications requiring data transfer.
Anything that works at a DOS prompt will normally work in BJS. Most of
our customers are using Microsoft SQL server (xp_sendmail) or a command
that is included with their corporate email software. Customers are
advised to use a product they are familiar with.
Wide Area Network and Dial-up Access
Access to BJS is possible over any local area network or wide area network that allows a named-pipes connection to BJS. Dial-up access to BJS is possible by using Remote Access Service. Remote Access Service is included with the Windows operating systems.
Application Programming Interface
COM Version of BJS API
A COM version of the BJS Application Program Interface (API) is provided to allow VB and other COM, ActiveX compatible development environments to access BJS. This interface greatly simplifies use of the BJS API from VB. It also provides:
1. An ECHO method that allows VB applications to output messages directly to a BJS job log while they are running.
2. A RUN method that can execute DOS commands or other VB applications. Called commands or VB applications can also output messages to the same job log and can return an exit code to the calling VB application. A SetExitCode method is provided to allow called VB applications to return an exit code, either to the calling application or to the BAT file that invokes the VB application (returned as an ERRORLEVEL value).
3. Access to objects in the BJS environment (jobs and ob classes) as conventional database recordsets using MoveNext, MoveFirst, MoveLast methods. Complete documentation and sample code for the new COM BJS API is provided in the on-line Help system for BJS Client (to install BJS Client, download and execute BJSU300.EXE).
16-Bit Development Tools
16-Bit development tools can be used for batch programs but they will not run as efficiently or as safely as 32-Bit programs. 16-Bit processes normally run in the same address space. This means that a 16-Bit process in a batch job can corrupt memory and crash all other 16-Bit processes in other batch jobs or elsewhere on the BJS server. BJSCMD.EXE (installed with BJS Administrator) can be used to start 16-Bit batch programs in their own address space (type BJSCMD /? at a DOS prompt for usage information). Having a large number of 16-Bit programs running in separate address spaces will consume a great deal of memory and system resources.
The effect of these problems is not significant unless the 16-Bit applications are long running or critical applications. In these cases, programs written using 32-Bit C or C++ or the 32-Bit GUI development tools (Visual Basic) are recommended.
COM Application Program Interface (API)
The BJS API can be used directly from a command line or within a batch job BAT file (using the BJC.EXE and SUBMTJOB.EXE commands). It is also exposed as a conventional DLL and as COM interface. A majority of the client functions that are provided by BJS Client (job creation, submission, job access and control, job termination and other BJS environment functions) are provided by the BJS API.
In addition the COM interface for BJS provides "recordset" type access to BJS objects (submitted jobs, defined jobs, job classes). It also provides Echo, Run and SetExitCode methods to allow Windows applications in a BJS batch job to 1) output job log messages, 2) run commands or applications that output job log messages and 3) return a exit code. For documentation and sample code for the BJS API, please see the "BJS Application Program Interface" topic in the BJS Client Help index. Download BJSU300.ZIP from to install BJS Client and BJS Client Help.
Writing Batch Programs and Using the BJS API
Any 64-Bit, 32-Bit or 16-Bit application that can be started in a Windows DOS window and run unattended can be used in a batch job. The BJS/INTERACTIVE job initialization command may be required for some Windows applications when used in a BJS batch job. The BJS/INTERACTIVE job initialization command allows a batch Windows application to interact with the BJS server console. This is useful to obtain operator input from the BJS server console or when testing a batch Windows application in the event that an error message box is displayed.
Batch Job Queues (BJS Job Classes)
Each batch job is assigned a job class. A BJS job class is like a job queue. Up to 124 job classes can be created on a BJS server. The parameters used to define a job class include: Number of Jobs Allowed to Run Concurrently, Permissible Processing Times (when batch jobs can be started), Initial Job Priority (both awaiting execution and during execution), constraints on memory and CPU used by a batch job, and control over the auto-purge time for a batch job.
Job Chaining and Job Dependencies
Batch Job Server allows batch job submission to be dependent on the success or failure of other batch jobs and other criteria such as the presence of files, etc. Refer to BJS FAQ for more information on implementing job chaining and job dependencies.
Automatic Restart for Failed Jobs
A batch job can be restarted when it fails due to a system crash or for some other reason. Restart parameters (when the job should be restarted and the number of restart attempts) can be specified for jobs defined in the BJS job database and for jobs submitted from remote hosts. These parameters can be modified while a job awaits execution and during execution. A batch job can also modify its own restart parameters.
Job Parameter Control for Remote Hosts
Batch jobs can self-initialize their own job parameters. This allows a remote host to control the job class, job name, time constraints, job restart parameters and many other parameters for a submitted job.
Control Over Job Priority
Administrators and Server Operators can modify the priority of batch jobs, both prior to and during execution.
Control Over CPUs Used by Batch Jobs
Individual batch jobs or an entire BJS job class can now be prevented from executing on specific processors on a multi-processor system. "Allowed CPUs" can be set using either BJS Administrator or the BJC SET_CLASS or BJC SET_PRIORITY batch commands.
Mapped Drive Letter Support
Other than Windows 2003 Server, all other versions of Windows manage drive letters as a global resource. This creates problems when using mapped drives in concurrent batch jobs that run under usernames. It is possible for one batch job to disconnect a drive letter that is in use by another batch job. Also, when a batch job fails to disconnect a drive letter it has mapped, the drive letter cannot be reused until the system is rebooted. These problems are due to limitations in Windows regarding the way it manages mapped drive letters. BJS solves these problems by managing a pool of drive letters that can be allocated to BJS batch jobs. Specific drive letters or a number of drive letters can be requested by a batch job. If the requested drive letters aren't available for a job, BJS holds the job until the drive letters are available. If the batch job fails to disconnect its drive letters, BJS will automatically disconnect the drive letters when the job terminates.
Mapped Drive Letter Support for Windows 2003 Server
New with BJS v 3.0
This feature forces jobs that use the same drive letters to be single threaded. If you are running a large number of jobs that use the same drive letters, you should consider upgrading to Windows 2003 Server. Windows 2003 Server allows each Windows service (and each BJS batch job) to have their own set of drive letters. The means that BJS V3.0 jobs using the same drive letters can run concurrently with Windows 2003.
New with BJS v 3.0
It is now possible to exclude global groups or individual usernames in the Administrators local group from being considered BJS users. This reduces the size of the user list in the Maintenance Security Function (BJS Administrator). It also prevents unnecessary domain controller accesses (or in some cases timeouts if BJS does not have access to a domain) when the BJS service is starting up.
More Information when Jobs Remain in Awaiting Execution State
New with BJS v 3.0
The Job Detail dialog in BJS Administrator and BJS Client provide a list of all the outstanding reasons an Awaiting Execution job is unable to execute. This makes it much easier to diagnose why a job will not run when there are multiple constraints that keep it from executing.
Ability to Stop All Processes for a Job
When a batch job is canceled all processes for the batch job are terminated. This is not the case with most other batch job management products for Windows.
User and Administrator Defined Job Constraints
Batch jobs can be canceled if their CPU time, elapsed time, or memory exceeds user or administrator defined constraints. Also jobs can be held until available memory is above a user specified amount or CPU% is below a user specified amount.
Power Outages and Server Failure
Jobs that are awaiting execution when the server goes down will still be in the Batch Job Server job queue when Batch Job Server is restarted. Batch jobs that are running when the server goes down are given a job status of "Unknown" when BJS is restarted.
Job Chaining and Job Dependencies
Two methods are provided with Batch Job Server to allow this to occur. The simplest method is job chaining. This is where a batch job submits one or more batch jobs when it successfully completes all (or part) of its processing. More complex job dependencies require job dependency logic. Situations requiring job dependency logic include:
1. A job being dependent on the successful completion of multiple other jobs
2. Jobs being dependent on the presence or absence of files or other system conditions
With BJS, job chaining and job dependency logic are implemented within a batch job, using BJC commands and SUBMTJOB commands. Some products provide a Windows interface to define and maintain job dependencies.
This was not done with Batch Job Server for two reasons.
1. Using a BAT file allows much greater flexibility and control of job chaining and job dependency logic. Jobs can be submitted, held, released, monitored, canceled and purged by the controlling batch job.
2. Visibility of the success or failure of job chaining and job dependency logic can be tailored to the needs of an application. The log file for the controlling batch job provides an audit trail indicating the success or failure of the job dependency logic. It includes the job numbers of any submitted jobs and any errors that are encountered by the job dependency logic. Also, the controlling batch job can use the BJC SET_JOB_STATUS command to periodically change its own job status code and thereby indicate the overall status of the group of batch jobs that it controls. This allows the progress of all dependent jobs to be easily determined by monitoring the job status code of the controlling batch job in the BJS Active Job Summary list.
A detailed explanation and examples of job chaining and job dependency logic are provided in the BJS Administrator Help system. Refer to the "job chaining and job dependencies" Help topic.
Possible Batch Job Server Applications
Any batch application can be implemented using Batch Job Server. Batch application programs may need to be written in some cases. Possible applications include:
Mainframe to server, or server to server database replication (downloading databases to SQL Server).
Batch reports, form letters and report distribution via e-mail.
Batch database update applications, for financial, accounting, inventory.
Database and server backups and other maintenance activities.
Scheduling Batch jobs at a Specified Time
BJS v 3.0 allows users to schedule recurring batch jobs both at specific times and on a recurring basis. This function contains all the capabilities of the Windows AT command, plus the ability to schedule based on a user-specified calendar of working days, for instance, first working day of month, last working day of third week. It is not necessary to have system administrator privileges to schedule batch jobs. Also included is the ability to start jobs on a recurring basis, as frequently as once per minute and only during a scheduled time frame. For example, every 5 minutes between 8:00 am to 5:00 pm.
Command Line Interface
The BJC DOS command executes Batch Job Server commands from a DOS prompt or within a batch job. BJC can be used to submit, access and control batch jobs and view and modify other BJS system parameters. The BJC command can be used in a batch job or at a DOS command prompt on a Windows computer. The BJC command can also be used via a Telnet or remote command shell interface. Camellia Software does not support these interfaces.
How Batch Jobs Are Submitted
Batch Jobs are submitted from BJS Client or BJS Administrator using the Maintain / Submit Jobs command (Job menu). This command allows batch jobs to be created, stored and maintained on a BJS server. Batch jobs can be scheduled on a one time or recurring basis. A Submit Now function is also provided to manually submit batch jobs.
Batch Job submission can also be automated using a BJS job directory. BJS job directories allow programs or other hosts (mainframes or servers) to submit batch jobs. When a program, another batch job or another host copies a batch file to a job directory, Batch Job Server retrieves the batch file and executes it. Job directories are also used by the SUBMTJOB and BJC DOS commands to submit jobs and execute other BJS commands. See the job directories Help topic in BJS Administrator for more information.
A mainframe or UNIX host can use a BJS job directory (via ftp) to submit batch jobs. A Windows computer or a BJS batch job can submit a batch job using the DOS COPY command or by using the Batch Job Server SUBMTJOB and BJC SCHED_DBJOB (DOS) commands.
Environment variables normally available to a batch file in a DOS Window are also available when executing as a batch job. Also, batch jobs can send printout to the default printer of the user that submits the batch job. This capability is not available or not practical with most Windows batch scheduling products.
Logging and monitoring features
Each Job Has its Own Job Log
A job log is provided for each batch job. This job log includes all standard and error message output, the time the batch job started and ended, the username used to run the batch job and the name of the batch file that was submitted.
A job log can be viewed before, during or after job execution.
Job Monitoring and Statistics
The primary process for a batch job and all processes started by a batch job are monitored. The total CPU and CPU % for each active thread and for the batch job as a whole can be displayed. A monthly job statistics file is maintained that contains the elapsed time, CPU time and memory usage of each batch job.
Failed Job Agent
Corrective action can be taken when a batch job fails to start or terminates abnormally.
Control Of Job Status Code
Allows a numeric job status code to be set for a batch job from within the batch job. This status code can be used to control when a batch job is restarted. It is also displayed in the job status field in the Active Job Summary list in the BJS client software. This allows a batch job to indicate a percent complete or some other meaningful value.
Color Coded Job Status
Job status can be color coded in the Active Job Summary window. This allows jobs that fail to be red, jobs awaiting to be blue, and running jobs to be green, for example. The color coding is user specified in the display options dialog. This feature allows jobs requiring operator or support staff attention to be easily identified.
This command allows a batch job to search one or more job logs for a specified text string. If the string is found (or not found) the BJS job status code for the corresponding batch job can be set to a user specified value. This command allows the job log for a single job or all jobs for a job group, username, job class, job name to be searched. IFMSG can also be used to search files (with ? and * wild cards). IFMSG returns an ERRORLEVEL value equal to the number of strings found.
STOREVAR stores an environment variable in a CMD file so that it can be restored and used in a later batch job.
Dr. Watson Detection
It is now possible for a batch job to detect if a called application has had a Dr. Watson exception and take appropriate action. This includes notification, self termination and clearing the Dr. Watson message from the BJS server console. For additional information on this feature, enter BJC HELP CANCEL_JOB at a DOS prompt.
Batch Job Output (Job Logs)
Each batch job has its own job log. Both normal (STDOUT) and error (STDERR) messages are captured in the job log for a batch job. The job log also includes other information about the job, including the time it started and ended, the owner of the batch job and the source batch file name. Batch Job Server job logs can be viewed before, during or after job execution.
Overall BJS System Constraints
Batch Job Server can be configured to control overall batch job memory utilization and the number of concurrently executing batch processes.
Batch Job Access is Restricted
A batch file's security access is restricted to that of the submitting user.
Integrated Windows Security
Access to Batch Job Server is controlled using local groups that are created on the server where the BJS service is installed.
User Access to Jobs is Restricted
Users can be granted the right to view all batch jobs in the system or only their own. The ability to control another user's batch job requires the other user's password to be entered.
"Connect As" Feature
A user can connect to Batch Job Server and submit a batch job using another user's username if the correct password for the user is entered (this can be done without having to log off). Using this feature, it is possible to simultaneously connect to and monitor multiple Batch Job Servers using different usernames.
Administrator and Server Operator Access
Only Administrators and Server Operators have control over all batch jobs. Only Administrators are allowed to configure the Batch Job Server environment.
Two 64-Bit and 32-Bit client applications, BJS Client and BJS Administrator, are provided to access and control Batch Job Server. Both are Windows applications and can be installed on a Windows 2000, 2003, 2008, 2012, 2012 R1, 7, 8, XP or Vista computer, or a Windows 95 98 workstation.
BJS Client is used by batch job users to submit, monitor and control batch jobs. It allows a user to hold, release, cancel or purge their batch jobs. In addition, users can view the batch files and job logs for their jobs. Access to another user's batch jobs is allowed if a user knows the other user's password.
BJS Administrator is used by system administrators and server operators to administer the Batch Job Server environment. It also is able to execute all of the functions provided by BJS Client. BJS Client and BJS Administrator use named pipes network access to communicate with Batch Job Server. This is the network protocol used by many Microsoft utilities to communicate with Windows computers.
Batch Job Security
Batch jobs are prevented from accessing restricted user files and other restricted areas of the server. Batch job access is based on the security privileges of the batch job owner. The batch job owner is the user that submits the batch job or, in the case of job directories, the username that is associated with the job directory.
BJS on Virtual Systems
Wherever the BJS service is installed, a license is required. For example, if there are three virtual machines on one computer and each vitual system is running its own instance of the BJS service, then a BJS license is needed for each virtual machine.
Year 2000 Compliance
Batch Job Server (BJS) v 3.0 build 563 and build 570 was designed to operate in the Year 2000 and beyond. In-depth Year 2000 testing for BJS v 3.0 has been completed. BJS currently operates with dates through December 31, 2035. The design of Batch Job Server allows this date to be extended when necessary. BJS performed all scheduling for both scheduled and recurring jobs and other date related functions without error during testing performed before, on and after the following days:
December 31, 1999
January 1, 2000
February 1, 2000
February 29, 2000 (leap year day)
March 1, 2000
December 31, 2000
January 1, 2001
The above testing will also be applied to any future versions of BJS (after v 3.0 and v 2.1). BJS V1.x, and BJS V2.0 will not be tested for year 2000 compliancy. The Statement of Compliance does not constitute a warranty or extend the terms of any existing warranty. If you have any warranty or license agreement questions, please see details in the BJS License Agreement provided in the BJS Administrator or BJS Client Help systems.
Year 2000 Certification The functions tested for Year 2000 compliance are those functions that are typically used for submission, scheduling and controlling of batch jobs and creation and maintenance of BJS calendars. The dates tested are considered the industry standard for dates that are problematic for the Year 2000. Because of the virtually unlimited number of ways batch jobs can be scheduled, it is not possible for us to verify that BJS will operate successfully under all circumstances on a specific date. This information is provided for the purpose of assisting our customers in their planning for the transition to the Year 2000. All BJS customers are strongly encouraged to include Batch Job Server in their Year 2000 compliance testing of their batch applications. Because of the number of requests received, individual requests to complete questionnaires and sign contracts regarding Year 2000 compliancy cannot be honored.
Batch Job Server End-User License Agreement
Batch Job Server copyright © 1994-2011, Camellia Software Corporation.