Professional Documents
Culture Documents
User's Guide
Version 6.1
October 2011
DPDS3-PE-200051C-UPDATED
Copyright
Copyright 1994-2011 Intergraph Corporation. All Rights Reserved.
Including software, file formats, and audiovisual displays; may be used pursuant to applicable software license agreement;
contains confidential and proprietary information of Intergraph and/or third parties which is protected by copyright law, trade
secret law, and international treaty, and may not be provided or otherwise made available without proper authorization from
Intergraph Corporation.
Terms of Use
Use of this software product is subject to the End User License Agreement ("EULA") delivered with this software product unless
the licensee has a valid signed license for this software product with Intergraph Corporation. If the licensee has a valid si gned
license for this software product with Intergraph Corporation, the valid signed license shall take precedence and govern the use
of this software product. Subject to the terms contained within the applicable license agreement, Intergraph Corporation gives
licensee permission to print a reasonable number of copies of the documentation as defined in the applicable license agreement
and delivered with the software product for licensee's internal, non-commercial use. The documentation may not be printed for
resale or redistribution.
Trademarks
Intergraph, the Intergraph logo, PDS, SmartPlant, FrameWorks, I-Convert, I-Export, I-Sketch, SmartMarine, IntelliShip, INtools,
ISOGEN, MARIAN, SmartSketch, SPOOLGEN, SupportManager, and SupportModeler are trademarks or registered trademarks
of Intergraph Corporation or its subsidiaries in the United States and other countries. Microsoft and Windows are registered
trademarks of Microsoft Corporation. Oracle, JD Edwards, PeopleSoft, and Retek are registered trademarks of Oracle
Corporation and/or its affiliates. MicroStation is a registered trademark of Bentley Systems Inc, all rights reserved. Other brands
and product names are trademarks of their respective owners.
Contents
What's New in Batch Services............................................................................................................... 9
Batch Services Overview..................................................................................................................... 11
Getting Started ..................................................................................................................................... 13
Accessing Other Nodes ................................................................................................................... 13
Account Mapping Overview ............................................................................................................. 14
Batch Client API Set ........................................................................................................................ 14
Batch Service Privileges .................................................................................................................. 14
Batch Service Security ..................................................................................................................... 15
Batch User Interfaces ...................................................................................................................... 15
File Staging ..................................................................................................................................... 15
File Staging Example................................................................................................................. 16
Named Jobs .................................................................................................................................... 17
Naming Restrictions......................................................................................................................... 18
Working with Batch Services .............................................................................................................. 19
Working with Queues....................................................................................................................... 21
Connecting to a Queue.............................................................................................................. 21
Creating a Queue ...................................................................................................................... 21
Deleting a Queue ...................................................................................................................... 22
Displaying Queue Status ........................................................................................................... 22
Enabling/Disabling a Queue ...................................................................................................... 23
Handling Queue Security ........................................................................................................... 24
Modifying Queue Parameters .................................................................................................... 25
Starting/Stopping a Queue......................................................................................................... 26
Stopping all Running Jobs ......................................................................................................... 27
Working with Batch Queues ............................................................................................................. 27
Adding and Deleting Batch Queue Shell Lists ............................................................................ 27
Setting the Default Shell ............................................................................................................ 28
Working with Pipe Queues ............................................................................................................... 29
Adding and Deleting Pipe Queue Destinations ........................................................................... 29
Setting the Default Queue ......................................................................................................... 30
Working with Batch Jobs.................................................................................................................. 31
Deleting a Batch Job ................................................................................................................. 31
Deleting/Aborting all Jobs in a Queue ........................................................................................ 32
File Staging: Staging Files In ..................................................................................................... 32
File Staging: Staging Files Out................................................................................................... 33
Getting job status information .................................................................................................... 33
Handling Batch Job Output Files................................................................................................ 34
Modifying a Batch Job after Submission .................................................................................... 36
Moving a Batch Job ................................................................................................................... 37
Pausing/Holding a Batch Job ..................................................................................................... 37
Releasing a Batch Job............................................................................................................... 38
Restarting a Batch Job .............................................................................................................. 38
Saving and Restoring Named Batch Jobs .................................................................................. 39
Submitting a Batch Job.............................................................................................................. 40
Contents
Using Recurring Jobs ................................................................................................................ 40
Working with Batch Servers ............................................................................................................. 41
Accessing a Remote Server ...................................................................................................... 42
Configuring the Batch Server ..................................................................................................... 42
Granting Jobs Access to the Desktop ........................................................................................ 43
Removing the Batch Service ...................................................................................................... 43
Setting Batch Server Logging Level (Debug Level) .................................................................... 44
Setting Server Managers and Operators .................................................................................... 44
Configuring SMTP Mail .............................................................................................................. 45
Shutting Down the Batch Server ................................................................................................ 47
Starting the Batch Server ........................................................................................................... 47
Using a Default Mail Address..................................................................................................... 47
Working with Account Mapping ........................................................................................................ 48
Mapping to Other Computers..................................................................................................... 48
Working with Batch Manager Display ............................................................................................... 49
Displaying Batch Manager Help ................................................................................................. 49
Managing the Batch Manager Display........................................................................................ 50
Batch Manager Interface...................................................................................................................... 51
Overview ......................................................................................................................................... 51
Batch Manager Interface .................................................................................................................. 52
Toolbar ...................................................................................................................................... 52
Job Menu .................................................................................................................................. 52
Queue Menu ............................................................................................................................. 52
Server Menu.............................................................................................................................. 52
View Menu ................................................................................................................................ 52
Help Menu................................................................................................................................. 53
Server View ............................................................................................................................... 53
Queue View............................................................................................................................... 53
Status Bar ................................................................................................................................. 54
Input Methods.................................................................................................................................. 54
Job Menu ........................................................................................................................................ 55
Exit command (Job Menu) ......................................................................................................... 55
Properties command (Job Menu) ............................................................................................... 55
Delete command (Job Menu)..................................................................................................... 59
Operator Hold and Release commands (Job Menu)................................................................... 59
User Hold and Release commands (Job Menu) ......................................................................... 60
Run Now (Job Menu)................................................................................................................. 60
Move command (Job Menu) ...................................................................................................... 60
Submit command (Job Menu) .................................................................................................... 60
Queue Menu.................................................................................................................................... 64
Connect to command (Queue Menu) ......................................................................................... 65
Create command (Queue Menu) ............................................................................................... 65
Delete command (Queue Menu) ................................................................................................ 68
Properties command (Queue Menu) .......................................................................................... 68
Start command (Queue Menu)................................................................................................... 71
Stop command (Queue Menu) ................................................................................................... 71
Enable command (Queue Menu) ............................................................................................... 71
Disable command (Queue Menu) .............................................................................................. 71
Abort command (Queue Menu).................................................................................................. 72
Purge command (Queue Menu)................................................................................................. 72
Server Menu .................................................................................................................................... 72
Connect To Command (Server Menu) ....................................................................................... 72
Contents
Account Mapping Command (Server Menu) .............................................................................. 73
Properties Command (Server Menu) ......................................................................................... 74
View Menu....................................................................................................................................... 75
Toolbar command (View Menu) ................................................................................................. 75
Status Bar command (View Menu)............................................................................................. 75
Refresh command (View Menu)................................................................................................. 76
Help Menu ....................................................................................................................................... 76
Contents command (Help Menu) ............................................................................................... 76
Context Sensitive Help Button ................................................................................................... 76
Using Help command (Help Menu) ............................................................................................ 76
About Batch command (Help Menu) .......................................................................................... 76
Script Browser ................................................................................................................................. 76
Script Examples............................................................................................................................... 77
Batch Client API ................................................................................................................................... 79
API Description ................................................................................................................................ 79
Batch Client API interface ................................................................................................................ 80
Batch API Structures ....................................................................................................................... 81
BATCH_QUEUE_INFO_1 ......................................................................................................... 81
BATCH_QUEUE_INFO_2 ......................................................................................................... 82
BATCH_JOB_INFO_1 ............................................................................................................... 85
BATCH_JOB_INFO_2 ............................................................................................................... 86
BATCH_RECURRENCE_INFO ................................................................................................. 90
BATCH_SERVER_INFO ........................................................................................................... 92
Batch API Function Calls ................................................................................................................. 93
BatchAbortJob........................................................................................................................... 94
BatchAbortQueue ...................................................................................................................... 95
BatchCreateQueue.................................................................................................................... 96
BatchDeleteJob ......................................................................................................................... 98
BatchDeleteQueue .................................................................................................................... 99
Example Program ...................................................................................................................... 99
BatchDisableQueue................................................................................................................. 100
BatchEnableQueue ................................................................................................................. 101
BatchEnumerateJobs .............................................................................................................. 102
BatchEnumerateQueues ......................................................................................................... 103
BatchGetJobInfo...................................................................................................................... 104
BatchGetQueueInfo ................................................................................................................. 105
BatchGetServerInfo ................................................................................................................. 107
BatchJobHold .......................................................................................................................... 108
BatchJobRelease .................................................................................................................... 109
BatchMoveJob ........................................................................................................................ 110
BatchPurgeQueue ................................................................................................................... 112
BatchServerShutdown ............................................................................................................. 113
BatchSetJobInfo ...................................................................................................................... 114
BatchSetQueueInfo ................................................................................................................. 116
BatchSetServerInfo ................................................................................................................. 119
BatchStartQueue..................................................................................................................... 121
BatchStopQueue ..................................................................................................................... 122
QueueBatchJob....................................................................................................................... 123
API Error Codes ............................................................................................................................ 127
Batch Specific Error Conditions ............................................................................................... 127
Win32 Error Codes .................................................................................................................. 129
Required Calling Privileges ...................................................................................................... 129
Contents
Command Line Interface ................................................................................................................... 131
Name Syntax ................................................................................................................................. 131
Queue ..................................................................................................................................... 131
Dest-name .............................................................................................................................. 132
Group ...................................................................................................................................... 132
Server ..................................................................................................................................... 132
User ........................................................................................................................................ 132
Shell-name .............................................................................................................................. 132
Runlimit ................................................................................................................................... 133
Job-id ...................................................................................................................................... 133
Priority-value ........................................................................................................................... 133
Nice-value ............................................................................................................................... 133
Debug Level ............................................................................................................................ 133
Shell-path ................................................................................................................................ 134
date-time parameter ................................................................................................................ 134
Submitting Jobs ............................................................................................................................. 135
qsub: An Overview .................................................................................................................. 135
qsub Interface ......................................................................................................................... 135
Deleting or Aborting Batch Jobs ..................................................................................................... 138
qdel: An Overview ................................................................................................................... 138
qdel Interface .......................................................................................................................... 138
Obtaining Job and Queue Status ................................................................................................... 139
qstat: An Overview .................................................................................................................. 139
qstat Interface ......................................................................................................................... 139
Managing Batch Services .............................................................................................................. 140
qmgr: An Overview .................................................................................................................. 140
qmgr Interface ......................................................................................................................... 140
setpasswd.exe Utility ......................................................................................................................... 151
Troubleshooting................................................................................................................................. 153
Customer Support.......................................................................................................................... 153
Telephone Support .................................................................................................................. 154
Web Site ................................................................................................................................. 154
Intergraph Directory ................................................................................................................. 154
Basics of Batch Services ............................................................................................................... 154
Understanding batch queues and pipe queues ........................................................................ 154
Understanding queue states and job states ............................................................................. 154
Job Status Notification ................................................................................................................... 155
Receiving mail notification ....................................................................................................... 155
Obtaining information about failures ......................................................................................... 155
File Staging ................................................................................................................................... 155
Sending and Receiving Files ................................................................................................... 155
Security ......................................................................................................................................... 156
Submitting jobs to remote nodes.............................................................................................. 156
Resource Usage ............................................................................................................................ 156
Controlling queue usage .......................................................................................................... 156
Aborting running jobs............................................................................................................... 156
Frequently Asked Questions .......................................................................................................... 157
Setting up a shell ..................................................................................................................... 157
Power failures ......................................................................................................................... 157
SMTP mail .............................................................................................................................. 157
Contents
Glossary ............................................................................................................................................. 159
Index ................................................................................................................................................... 165
Contents
You must install Version 06.00.00.08 or later on ALL computers prior to changing
or setting a user password. If you attempt to set the password remotely from a computer
running an earlier version of Batch Services, you will corrupt your registry. If this happens,
you will have to remove and reset all your Batch Services passwords on all computers.
Intergraph Batch Services now supports long file names, spaces in folder paths, and
Internationalization. (P1 PB:87374)
If you plan to use Intergraph Batch Services with Plant Design System (PDS), do not
install Intergraph Batch Services to a folder path that contains spaces, such as c:\Program
Files\Batch. While Intergraph Batch Services does support spaces in folder paths, PDS
does not.
After a job has been submitted and before its execution starts, you can modify recurring job
frequency controls. For more information, see Job Properties Dialog Box (on page 55). (P1
PB:113275)
A new Jobs > Run Now command is available to immediately run recurring scheduled jobs.
For more information, see Run Now (Job Menu) (on page 60). (P1 PB:95620)
Answers to several common questions regarding SMTP email have been added to the
Troubleshooting section. For more information, see SMTP Mail (on page 157). (P4
PB:114128)
10
SECTION 1
11
12
SECTION 2
Getting Started
After the batch system is installed and running, you should create a batch queue on the local
system using the instructions provided in this help document. After the queue is created,
configured, enabled and started, batch jobs can be submitted using either the Batch Manager
Interface (on page 51) or the qsub (see "qsub: An Overview" on page 135) command line utility.
In order to perform work with the batch system, the user (or application) submits a Batch Job.
Users can also specify how often the job should be run, the environment of the job, its priority,
starting time, description, where the output should be placed, auxiliary files, and many other job
attributes. When a job is successfully submitted, it is assigned a unique job-id. The job-id can be
used to reference the job. No two jobs will have the same job-id.
In This Section
Accessing Other Nodes .............................................................. 13
Account Mapping Overview......................................................... 14
Batch Client API Set ................................................................... 14
Batch Service Privileges ............................................................. 14
Batch Service Security ................................................................ 15
Batch User Interfaces ................................................................. 15
File Staging ................................................................................ 15
Named Jobs ............................................................................... 17
Naming Restrictions .................................................................... 18
13
Getting Started
14
Getting Started
File Staging
File staging is the movement of files to or from the execution computer before and after the job
runs. There are two types of staging: staging in, and staging out.
Staging in means copying a file before a batch job is run to the system where the job will
execute.
Staging out means copying a file after a batch job is run from the system on which the job
executed.
If a destination filename is not specified, the source filename and the destination filename are
assumed to be the same. Incomplete pathnames for local source filenames are expanded using
the current working directory (if submitted from a Windows client). Pathnames for Windows must
be specified with backslashes (\).
File Staging Example (on page 16)
15
Getting Started
Inbound Staging
The first entry batch1.ppt=\\remote\c:\pviews\demo1.ppt is an example of a file, demo1.ppt,
being sent from the directory c:\pviews on remote computer \\remote and sent to the execution
computer. batch1.ppt will be the name of the file on the execution computer.
In the second entry pptview.exe=\\local\c:\powerpnt\pptview.exe, the file pptview.exe is being
moved from the computer \\local to the directory where the batch job will execute.
16
Getting Started
Outbound Staging
In the first entry in the Stage Out Files listbox, \\local\c:\logs\finish.log=finish.log, the file
finish.log will be moved to the directory c:\logs on the execution computer, \\local, after the batch
job has been processed.
In the second entry, \\remote\c:\logs\finish.log=finish.log, the file finish.log will be moved to the
directory c:\logs on computer \\remote after the batch job has been processed.
In the third entry, c:\mylogs\finish.log=finish.log, the file finish.log will be moved to directory
c:\mylogs on the local computer after the batch job has been processed. This example shows
another method of staging local files after processing.
Named Jobs
Named jobs are batch jobs that have been saved to a file. They have a default extension of
NJOB (for "named job"). For example, the job myjob will be saved as MYJOB.NJOB.
See Saving and restoring named batch jobs (on page 39) for more information on named jobs.
17
Getting Started
Naming Restrictions
A set of valid characters has been chosen for queue names and shell names. The character set
consists of all alphanumeric (both upper and lower case) and punctuation characters, with the
following exceptions:
1. The punctuation characters @ \ ( ) = and , are invalid. These characters already have
special meaning for the qmgr interface.
2. The punctuation characters - and / are invalid for the first character of a queue or shell
name. In most cases, the command line utilities expect these characters to signal the start
of an option.
18
SECTION 3
Queues
Connecting to a queue (on page 21)
Creating a queue (on page 21)
Deleting a queue (on page 22)
Displaying queue status (on page 22)
Enabling/Disabling a queue (on page 23)
Handling queue security (on page 24)
Modifying queue parameters (on page 25)
Starting/Stopping a queue (on page 26)
Stopping all running jobs (on page 27)
Batch Queues
Adding and deleting batch queue shell lists (on page 27)
Setting the default shell (on page 28)
Pipe Queues
Adding and deleting pipe queue destinations (on page 29)
Setting the default queue (on page 30)
Batch Jobs
Deleting a batch job (on page 31)
Deleting/aborting all jobs in a queue (on page 32)
File staging: staging files in (on page 32)
File staging: staging files out (on page 33)
Getting job status information (on page 33)
Handling batch job output files (on page 34)
Modifying a batch job after submission (on page 36)
Moving a batch job (on page 37)
Pausing/holding a batch job (on page 37)
Releasing a batch job (on page 38)
Restarting a batch job (on page 38)
Saving and restoring named batch jobs (on page 39)
19
Batch Servers
Accessing a remote server (on page 42)
Configuring the batch server (on page 42)
Granting jobs access to the desktop (on page 43)
Removing the batch service (on page 43)
Setting batch server logging level (debug level) (on page 44)
Setting server managers and operators (on page 44)
Configuring SMTP mail (on page 45)
Shutting down the batch server (on page 47)
Starting the batch server (on page 47)
Using a default mail address (on page 47)
Account Mapping
If you do not understand how accounts are mapped, refer to Account Mapping Overview
(on page 14) before using the mapping procedures. For more information, you will also need to
review Mapping to Other Computers (on page 48).
In This Section
Working with Queues .................................................................. 21
Working with Batch Queues ........................................................ 27
Working with Pipe Queues .......................................................... 29
Working with Batch Jobs ............................................................. 31
Working with Batch Servers ........................................................ 41
Working with Account Mapping ................................................... 48
Working with Batch Manager Display .......................................... 49
20
Connecting to a Queue
Connecting to a queue allows you to view all the jobs within a queue. Before you can display or
modify a remote queue in the Batch Manager user interface, you must connect to it. No
privileges are required to connect to a queue.
To connect to a queue:
1. Select Queue > Connect to.
The Connect to Queue (on page 65) dialog box displays.
2. Key in the queue (on page 131) to which you want to connect. You may also select from a
drop-down list of the most recently selected queues.
3. Click OK.
You can also connect to a queue by double-clicking on it from within a server view (on
page 53).
Creating a Queue
Only users with manager privileges on the server where the queue is being created are allowed
to create queues.
21
Deleting a Queue
A batch or pipe queue cannot be deleted if the queue is started or if there are jobs in the queue.
Only users with manager privileges on the server where the queue is located are allowed to
remove queues.
on the toolbar.
5. Disable the queue using Queue > Disable, or by clicking Disable Queue
toolbar.
6. Delete the queue using Queue > Delete, or by click Delete Queue
on the
on the toolbar.
Start qmgr.
Stop the queue using the stop queue (on page 149) command.
Abort all running jobs in the queue using the abort queue (on page 141) command.
Delete all jobs in the queue using the purge queue (on page 145) command.
Disable the queue using the disable queue (on page 144) command.
Delete the queue using the delete queue (on page 143) command.
22
Enabling/Disabling a Queue
These commands control the inflow state of the queue. The inflow state is either enabled or
disabled. An enabled queue will accept new jobs that are submitted or transferred to it; a
disabled queue will not.
You must have at least operator privileges on the server where the queue resides in order to
enable or disable a queue.
or Disable Queue
on the toolbar.
23
24
Adds/removes groups from the access list for the queue. For more
information, see Add groups (on page 141) or Delete groups (on
page 143).
add/delete users
Adds/removes users from the access list for the queue. For more
information, see Add users (see "Delete users" on page 144) or
Delete users (on page 144).
Sets or removes the priority used to schedule jobs that do not specify
a priority at submission. For more information, see Set default batch
request priority (on page 146) or Set no default batch request queue
(on page 147).
25
set nice_value_limit
Sets the limit for specifying the priority of the job when it is run. For
more information, see Set nice_value_limit (on page 147).
set no access
Removes access to the queue from all users. For more information,
see Set no_access (on page 147).
Sets the maximum total file sizes used by a request. This value is not
used under Windows. For more information, see Set per_process
permfile_limit (on page 147).
set priority
set runlimit
Limits the number of jobs that are allowed to run in the queue
simultaneously. The default runlimit is 1. For more information, see
Set runlimit (on page 148).
Removes any shells from the named queue's list and replaces them
with the specified list of shells. For more information, see Set
shell_name (on page 148).
Resets the queue to allow all users to access it. For more
information, see Set unrestricted_access (on page 148).
Starting/Stopping a Queue
These commands control the outflow state of the queue. The outflow state is either started or
stopped. A stopped queue will not run the jobs it contains. A queue must be started in order to
run jobs.
You must have at least operator privileges on the server where the queue resides in order to
start or stop a queue.
or Stop Queue
on the
26
27
28
29
30
31
32
33
stderr
Outbound
Staging
34
-eo
-ko
Location
-jy
-N
Name
-o
-r
Name
-ro
Spooling options
-eo
-e
Name
-jy
-ke
Location
-N
Name
-r
Name
-re
Spooling options
-so
Reoccurrence
-M
-mu
-me
-mb
-ma
-mn
Send no mail
-O desc
Flag (F)
value Hex
Hourly frequency
01
01 to 99(hours)
00
00
Daily frequency
02
01 to 31 (days)
00
00
00
Weekly frequency
04
01 to 05 (week)
00
00
Specific Monthly
frequency
28
00
00 to 12 (month)
00 to 1f (day of month 1 to
31 decimal)
00
Determined Monthly
frequency
48
01 to 05 (ordinal)
00
00 to 7f (days)
00
Specific Yearly
frequency
30
00
00
00 to 1f (day of month 1 to
31 decimal)
00 to 12 (month of
year)
Determined Yearly
frequency
50
01 to 05 (ordinal)
00
00 to 12 (month of
year)
Examples:
qsub -q \\gene\myqueue -O f01i01m00w3ey00
"c:\users\default\myscript.bat<tab>/help"
will cause the script file "myscript.bat" to execute every hour starting at the current time on
Monday through Friday. The "<tab>" represents the tab character, and is used to separate
arguments from the script name.
Using the Batch API:
1. Edit the BATCH_JOB_INFO_2 (on page 86) structure:
Element
Affects
Specifies
stdout
Pathname to stdout.
stderr
stderr
Pathname to stderr.
flags (BATCH_JOB_FLAG_<value>):
stdout
KEEP_STDERR
35
Affects
Specifies
stderr
NOSPOOL_STDOUT
stdout
stderr
stderr/stdout
outfiles array
Outbound
Staging
mailaddress
Notification
36
on the toolbar.
37
on the
38
39
40
41
42
6.
7.
8.
9.
10.
The Intergraph Batch Server service must be stopped and restarted for the change to take
effect.
Select the General tab.
Click Stop.
Click Start to restart Batch Services.
Click OK to close the properties window.
Exit the Services window.
43
44
Note that the selected privilege applies to all users or groups being added; you cannot add
an operator and a manager at the same time.
You can remove selected users or groups from the authorization list by selecting them and
choosing Remove.
45
SMTPhost
Type:
REG_SZ
String:
Stop and restart the Intergraph Batch Server for this change to take effect. The SMTPhost
computer will send any SMTP mail from the batch service.
Administrator privileges are required to configure the SMTPhost in the system registry.
46
47
To use a default mail address for a single job from the command line:
Key in set MAIL=address at the command prompt before submitting the job with the qsub
command, where address is the address you want to use.
To use a default mail address with the Batch Manager GUI, or for all jobs at the command
line:
1.
2.
3.
4.
5.
48
49
To select a view:
Selecting a view activates the view. Click anywhere on the view you want to select. The title bar
changes to indicate the view is now active.
To arrange views:
To overlap each view so that the title is visible, choose Cascade from the Window menu.
To overlap and resize each view, choose Tile from the Window menu.
To arrange icons:
When a view is minimized, it displays as an icon. To move icons, you can drag and drop them
with the mouse. To arrange icons automatically, select Arrange Icons from the Window menu.
50
SECTION 4
Overview
Batch Manager provides an object-oriented interface for viewing and managing job flow. Batch
Manager allows you to create batch or pipe queues, and to connect to remote queues.
Connection to remote servers allows you to manage other Windows batch servers on the
network.
The Batch Manager interface provides a two objects, or views, for managing batch services:
Server View (on page 53)
Queue View (on page 53)
51
Toolbar
Provides button access to certain commands available in the Job and Queue menus.
Job Menu
Contains commands for the submission and management of jobs in local and remote queues. In
addition, you can modify job characteristics such as job hold/release. The job menu is active
when a queue within a server view is selected, or a queue view is active. A subset of the
commands in the job menu is also available from the toolbar.
Queue Menu
Provides those operations related to creating, connecting to, deleting, and controlling job inflow
and outflow from batch and pipe queues. A subset of these commands is also available from the
toolbar.
Server Menu
Provides those operations related to connecting to a batch server and modifying properties of a
server. When you connect to a batch server, the queues configured on that computer are
displayed in a separate server window.
View Menu
Toggles the display of the toolbar and status bar, and allows you to manually refresh the active
Queue View or Server View.
52
Help Menu
Allows you to access the Batch Manager online help file that is delivered with the Batch Services
product. You can also obtain help on using Windows help, or display information about the
Batch Manager version.
Server View
The server view displays information about the server. When the server view is active, you can
configure the queues on the server. This includes creating, deleting, and managing the queues
on a Windows server. The server view shows the queues on that server. To connect a server,
click Server > Connect to. To display a queue, double-click on a queue line in a server view.
Batch Manager displays a list of the jobs contained within that queue.
The server view displays the following information:
Server
Queue
Type
Priority
Inflow
Outflow
Job Count
You can sort the queues based on columns. By default, sorting is based on Queue.
ENTER
ALT+ENTER
DELETE
INSERT
Displays the Job Submit dialog, provided the selected queue can
accept jobs.
ALT+INSERT
CTRL+ENTER
Queue View
The queue window, or view, displays information about the jobs contained in the specified
queue(s). A queue view represents a batch or pipe queue. The queue view displays the
following information:
53
Queue
Job ID
Status
Priority
User
Job Name
Start Time
The start time of a job, or the next occurrence time of a recurring job.
You can sort the jobs based on columns. By default, sorting is based on Start Time.
You can create new queues with the Queue > Create command, or you can connect to remote
existing queues using the Queue > Connect to command. Double clicking on a queue in a
server view also displays a queue view.
After a queue is created or a connection to a remote queue is established, users with manager
privileges may change attributes of the selected queue. The queue window displays any jobs
that are presently in that queue.
ALT+INSERT
CTRL+ENTER
ENTER
ALT+ ENTER
DELETE
INSERT
Displays the Submit Job dialog, provided the selected queue can
accept jobs.
Status Bar
Displays information about the server or queue view. For the server view, the status bar displays
the server name. For the queue view, the status bar indicates relevant queue status, including
queue name, queue type, queue description, and inflow and outflow states.
Input Methods
Batch Manager accepts input from the mouse, keyboard, and menus. Other methods of input
are available, such as mouse-selectable toolbar buttons and keyboard accessible hotkeys (for
54
Job Menu
If a job is selected and you have appropriate privileges, the job menu is active and allows
various operations to be performed on the selected job. Only the owner of the job, an operator,
or a manager may modify job parameters.
Submit - Displays a Job Submit (on page 60) dialog in order to submit a job. The tab has
reasonable defaults so you can minimally select the script name and submit the job.
The queue defaults to the currently selected queue. You can use the Default Queue check box
to select the default queue for the local server.
Delete - Deletes the currently selected job. If the job is running, Batch Manager provides the
option of restarting the job. Job restart is dependent on whether the restartable flag is set in the
job or not. If the job is not running, the job deletion is confirmed.
Properties - Displays the Job Properties Dialog Box (on page 55) dialog allowing viewing and
modification of job information. Job properties cannot be modified once a job has begun
execution.
User Hold / Release Operator Hold / Release - Controls the setting and releasing of the hold
flag on a job. Only operators and managers can set or release operator holds. Job owners can
set and release user holds.
Run Now - Runs the selected job immediately.
Move - Displays the Move Job Dialog Box (on page 60) requesting the queue to which the job
should be moved. Only the job owner, an operator, or a manager may perform this operation.
Exit - Exits Batch Manager.
55
Topics
Job Properties: General .............................................................. 56
Job Properties: Scheduling ......................................................... 56
Job Properties: Notification ......................................................... 57
Job Properties: Resources .......................................................... 57
Job Properties: File Staging ........................................................ 58
Job Properties: Advanced ........................................................... 59
Job Properties: Output ................................................................ 59
56
57
58
59
Job Submit
The Job Submit dialog is similar to the Job Properties dialog box but provides the following
commands:
OK - Submits the job.
Cancel - Cancels the job submission.
Apply - Causes any changes made to values on the tabs to take effects immediately.
60
Topics
Job Submit: General ................................................................... 61
Job Submit: Scheduling .............................................................. 61
Job Submit: Notification .............................................................. 62
Job Submit: Resources ............................................................... 62
Job Submit: File Staging ............................................................. 63
Job Submit: Advanced ................................................................ 63
Job Submit: Output ..................................................................... 63
61
62
63
Queue Menu
This menu allows you to connect to, create, delete, and change parameters of selected queues.
Connect to - Connects to a queue. Selecting this entry displays the Connect to Queue (on page
65) dialog box, allowing you to specify a queue. You may also select from a drop-down list of the
most recently selected queues.
Create - Creates batch and pipe queues. Selecting this entry displays the Create Queue (on
page 65) dialog box. Manager privileges are required to create queues.
Delete - Deletes the currently selected queue. Batch Manager requests confirmation before
deleting any queues. A batch or pipe queue cannot be deleted if the queue is started or if there
are jobs in the queue. Manager privileges are required to remove queues.
Properties - Displays information about or modifies an existing queue. Batch Manager displays
the Queue Properties Dialog Box (on page 68), allowing you to modify various queue
parameters. Manager privileges are required to modify queue parameters.
Enable - Enables a queue. This command controls whether jobs may be submitted to the
selected queue. This command is also available from the toolbar. The state of the selected
queue controls whether or not this command is selectable. Operator or manager privileges are
required to use this command.
Disable - Disables a queue. This command is also available from the toolbar. The state of the
selected queue controls whether or not this command is selectable. Operator or manager
privileges are required to use this command.
Start - Starts a queue. This command is also available from the toolbar. The state of the
selected queue controls whether or not this command is selectable. Operator or manager
privileges are required to use this command.
Stop - Stops a queue. This command is also available from the toolbar. The state of the
selected queue controls whether or not this command is selectable. Operator or manager
privileges are required to use this command.
Abort - Stops any running jobs in the queue. Batch Manager prompts you whether or not you
want to attempt to restart the job. Whether or not a job is restarted is dependent on whether the
"restartable" flag is set for the job.
Purge - Removes any jobs in the queue that are neither running nor being transferred to
another queue. Operator or manager privileges are required to use this command.
64
Connect to Queue
Select Connect to from the Queue menu to create a connection to a remote queue. Operations
on the selected queue (on page 131) are only allowed if you have the required privilege on that
computer. You can key in a remote queue by using the syntax \\server\queuename, or you can
select a queue that you have recently connected to from the drop down list.
Press ENTER or select OK to complete the dialog box. Select Cancel or press ESC to dismiss
the dialog without making a connection.
Create Queue
Select Queue > Create to create a new batch or pipe queue. Batch Manager displays a dialog
that allows you to configure various aspects of the queue.
The Create Queue dialog displays a Queue Type box that displays the type of the
queue, either Batch or Pipe. The two are mutually exclusive. If a batch queue is being created,
the Destinations tab is unavailable for selection. If a pipe queue is being created, the Shells
tab is unavailable for selection.
Tabs
General - Specifies general information about the queue. For more information, see Create
Queue: General (on page 66).
Scheduling - Configures how jobs are scheduled within the queue. For more information, see
Create Queue: Scheduling (on page 66).
Job Defaults - Specifies job defaults. For more information, see Create Queue: Job Defaults
(on page 67).
Security - Configures queue security parameters. For more information, see Create Queue:
Security (on page 67).
Shells - Configures the shells for batch queues. This tab is only available for batch queues. For
more information, see Create Queue: Shells (on page 67).
Destinations - Specifies the destination list for pipe queues. This tab is only available for pipe
queues. For more information, see Create Queue: Destinations (on page 68).
The following defaults are set when a queue is created:
Queue Parameter
Default Setting
Queue Type:
Batch
65
Disabled
Outflow:
Stopped
Queue Priority:
32
Run Limit:
Scheduling Priority:
Execution Priority:
Normal
66
67
Topics
Queue Properties: General ......................................................... 69
Queue Properties: Scheduling .................................................... 69
Queue Properties: Job Defaults .................................................. 69
Queue Properties: Security ......................................................... 70
Queue Properties: Shells ............................................................ 70
Queue Properties: Destinations................................................... 71
68
69
70
71
Server Menu
The Server menu provides the following options:
Connect to - Provides access to a remote batch server for management of those resources.
This command displays the Connect to Server Dialog (on page 72), which requires you to
specify the name of a remote Windows host.
Operations on the selected remote server are only allowed if you have privileges on the remote
computer to do so.
Properties - Displays information about the server in the form of tabs that display general
information and allow you to specify security information. This command displays the Server
Properties Dialog Box (on page 74), which contains the following tabs:
General - Displays information about the server, including the server name and the default
batch queue.
Security - Allows you to specify security information for the selected server.
Account Mapping - Displays the Account Mapping Dialog (on page 73) dialog box, which
specifies information about the account name and password to use when running jobs.
When a server is selected, the status bar displays the server name.
72
73
74
View Menu
The View menu toggles display of the tool and status bars.
Toolbar - Toggles display of the toolbar, which provides mouse access to commands provided
in the Queue and Job menus.
Status Bar - Toggles display of the status bar. The status bar displays information about the
queue or server view, such as inflow/outflow states, queue name, and the server name.
Refresh - Refreshes the active Queue View or Server View.
75
Help Menu
The help menu allows you to display a comprehensive index of information contained in the
Batch Services help system, display the main contents page of the help system, and display
information about the current version of Batch Services.
Contents - Displays the introductory page of the help system. You can also select the Contents
button from the help system.
Using Help - Displays brief instructions for using the help system.
About Batch Manager - Displays the current version of Batch Services.
Script Browser
Selects an existing script for submission. Select or type the name of the script you want to
submit in the File Name box. This box lists scripts with the filename extension selected in the
List Files of Type box. By default, the Script Browser lists the executable extensions (.EXE,
.BAT, .COM, .PIF). The All Files (*.*) option lists all files in the current directory.
Drives - Select the drive that contains the script you want to submit.
Directories - Select the directory that contains the script.
Network - Opens the Connect Network Drive dialog box so you connect to a network drive. For
more information, select Help in the dialog box.
76
Script Examples
A batch job reads a script and performs the instructions in it, using the appropriate shell (the
program that runs the instructions in the script). Scripts can take many forms, including .bat files
and Perl scripts. A script can also be an executable program (.EXE file) if the queue has no
default shell or if the default shell is set to CMD.EXE.
The following example is a .bat script that backs up a directory on the batch server to a shared
drive that has been locally mounted from a remote system. To use the script, ensure that a
batch queue has been created, enabled, and started, and that the queue's default shell is the
cmd.exe program.
REM This script will do the following:
REM
REM
1. Mount the shared drive \\machine\share
REM
2. Copy all files in c:\users\default to the shared drive.
REM
3. Unmount the shared drive.
REM
net use p: \\machine\share
copy c:\users\default\*.* p:
net use /delete p:
The following example is a .bat script that prints all PostScript files in the c:\temp directory on
the batch server to a printer on a remote Windows system. To use the script, ensure that a
batch queue has been created, enabled, and started; that the queue's default shell is the
cmd.exe program; and that the server system has access to the printer on the remote Windows
system.
REM This script will do the following:
REM
REM
1. Associate a remote printer on a Windows system
REM
(\\machine\printer) with a local printer port.
REM
2. Copy files in c:\temp that end in .ps to the local printer
REM
port.
REM
3. Remove the printer association.
REM
net use lpt1: \\machine\printer
cd c:\temp
for %%I in (*.ps) do copy %%I lpt1:
net use /delete lpt1:
77
78
SECTION 5
In This Section
API Description ........................................................................... 79
Batch Client API interface ........................................................... 80
Batch API Structures................................................................... 81
Batch API Function Calls ............................................................ 93
API Error Codes.......................................................................... 127
API Description
The Batch Client API provides an application-level interface for performing batch-oriented tasks.
All communications with the batch server are done through the Batch Client API. The API
handles the details of communicating with the batch server and returning data to the calling
applications.
Use the following steps to use the Batch Client API:
1. Programs should include the header file Batchapi.h, located in the batchapi sub-directory of
the batch product directory.
2. Applications that use Batch API functions should link with the batchapi.lib library in the same
directory.
3. At run time, the DLLs in the batch product bin directory should be in the applications' path.
79
At this time, only the NTBAT.DLL batch provider that communicates with Windows batch servers
is available.
Argument Syntax
If the syntax of the argument does not conform to the syntax expected by any of the batch
providers, the value ERROR_INVALID_PARAMETER is returned to the caller, and the operation
is not performed. If a batch provider is selected but cannot perform the given API function, the
value BATCH_ERROR_NOT_SUPPORTED is returned. Otherwise, the batch provider
performs the operation and provides a return value.
80
Parameter
Local Syntax
Remote Syntax
server
NULL or empty
\\host
queue
queue
\\host\queue
job-id
seqno.host
\\host\job-id
user
user
host\user, domain\user
group
group
host\group, domain\group
file
filename
\\host\filename
BATCH_QUEUE_INFO_1
Description
The BATCH_QUEUE_INFO_1 structure is a short form of the queue information suitable for
quick status update or for changing common queue attributes.
Structure
struct _batchQinfo1
{
LPTSTR qname
DWORD qtype
DWORD state
/* INFLOW | OUTFLOW */
DWORD qpri
/* intraqueue priority */
DWORD jobcount
LPTSTR description
LPBYTE reserved
} BATCH_QUEUE_INFO_1, *PBATCH_QUEUE_INFO_1;
Parameters
LPTSTR qname
DWORD qtype
DWORD state
81
DWORD jobcount
LPTSTR description
LPBYTE reserved
BATCH_QUEUE_INFO_2
Description
The BATCH_QUEUE_INFO_2 structure completely describes a queue and all of its attributes.
Structure
struct _batchQinfo2
{
LPTSTR qname
DWORD qtype
DWORD state
/* INFLOW | OUTFLOW */
DWORD qpri
/* intraqueue priority */
long defaultpri
DWORD runprilimit
DWORD runlimit
DWORD sizelimit
DWORD jobcount
LPTSTR description
PSECURITY_DESCRIPTOR
pSD
FILETIME system
FILETIME user
DWORD processor_affinity
/* multiprocessor flags */
LPBYTE reserved
union v
{
82
LPTSTR defaultshell
};
struct pipe
{
LPTSTR *dest_list
};
}
} BATCH_QUEUE_INFO_2, *PBATCH_QUEUE_INFO_2;
Parameters
LPTSTR qname
DWORD qtype
DWORD state
DWORD qpri
long defaultpri
DWORD runprilimit
83
DWORD sizelimit
The maximum total file size allowed for a batch job. This
limit is not enforced, but may be used in later versions.
DWORD jobcount
LPTSTR description
PSECURITY_DESCRIPTOR
pSD
FILETIME system
FILETIME user
DWORD processor_affinity
LPBYTE reserved
union v
v.batch
LPTSTR *shell_list
LPTSTR defaultshell The name of the default command interpreter for batch
shell scripts.
v.pipe
LPTSTR *dest_list
84
BATCH_JOB_INFO_1
Description
The BATCH_JOB_INFO_1 structure contains the most common job attributes needed for a
quick status check.
Structure
struct _batchjobinfo1
{
LPTSTR jobid;
LPTSTR owner;
LPTSTR name;
long priority;
DWORD size;
DWORD state;
LPBYTE reserved;
} BATCH_JOB_INFO_1, *PBATCH_JOB_INFO_1;
Parameters
LPTSTR jobid
LPTSTR owner
LPTSTR name
long priority
DWORD size
DWORD state
BATCH_JOB_STATE_QUEUED
BATCH_JOB_STATE_RUNNING
BATCH_JOB_STATE_HELD
BATCH_JOB_STATE_WAITING
85
BATCH_JOB_INFO_2
The BATCH_JOB_INFO_2 structure contains all of the information about a batch job and its
attributes.
Structure
struct_batchjobinfo2
{
86
LPTSTR jobid
LPTSTR owner
LPTSTR name
long priority
DWORD runpriority
DWORD restartable
FILETIME starttime
DWORD size
DWORD state
LPTSTR qname
DWORD holds
LPTSTR script
LPTSTR reserved2
LPTSTR Stderr
LPTSTR Stdout
FILETIME system
FILETIME user
LPTSTR shell
char **envp
/* execution environment */
LPTSTR logmsg
LPTSTR account
/* accounting label */
/* files to stage in */
LPTSTR *outfiles
DWORD origin
LPTSTR *mailaddress
DWORD flags
DWORD filesizelimit
LPTSTR owner
LPTSTR name
long priority
DWORD runpriority
The system execution priority for the job. This must be less
than or equal to the runprilimit of the queue. The following
priorities are valid:
IDLE_PRIORITY_CLASS
NORMAL_PRIORITY_CLASS
HIGH_PRIORITY_CLASS
REALTIME_PRIORITY_CLASS
A REALTIME process preempts all other processes,
including the operating system. Intergraph recommends
that you avoid using the REALTIME priority.
DWORD restartable
FILETIME starttime
DWORD size
DWORD state
87
BATCH_JOB_STATE_RUNNING
BATCH_JOB_STATE_HELD
BATCH_JOB_STATE_WAITING
BATCH_JOB_STATE_EXITING
88
LPTSTR qname
DWORD holds
LPTSTR script
LPTSTR reserved2
LPTSTR Stderr
The path name of the file that will contain the standard
error output of the job. If this value is NULL, then a default
stderr path name will be used (jobname.e).
LPTSTR Stdout
FILETIME system
FILETIME user
LPTSTR shell
char **envp
LPTSTR logmsg
LPTSTR account
LPTSTR infiles
A list of files that the batch job returns to the user after
execution. This is also called "staging files out." The format
of this list is source_file=dest_file, where source_file is the
name of the file on the execution computer, and dest_file is
the name and location of the output file. For more
information, see file staging (on page 15).
DWORD origin
A value determining where the job came from, and thus the
transport mechanism to use when returning files to a
remote client. The following values are possible:
BATCH_JOB_ORIGIN_LOCAL
BATCH_JOB_ORIGIN_NT
LPTSTR *mailaddress
DWORD flags
89
BATCH_RECURRENCE_INFO
The BATCH_RECURRENCE_INFO structure contains scheduling information for recurring
jobs (on page 162). It is only used within the BATCH_JOB_INFO_2 structure and is
ignored unless one of the recurring jobs flags is set in the flags field of the
BATCH_JOB_INFO_2 structure. The interpretation of its contents depends on which
recurring job flags are set in the flags field.
Two types of monthly and yearly recurring jobs are available. When using the API to
schedule monthly or yearly recurring jobs, you must specify which type of monthly or yearly
job you are scheduling by using either the BATCH_JOB_FLAG_SPECIFIC_TYPE or the
BATCH_JOB_FLAG_DETERMINED_TYPE along with the monthly or yearly frequency type
in the flags field of the BATCH_JOB_INFO_2 structure.
The first type of monthly or yearly job is called specific since the user specifies a specific
execution date for it. An example of a specific monthly job is a job that is scheduled to run
on the 15th day of every 2 months. An example of a specific yearly job is a job that is
scheduled to run on July 30 of each year.
The second type of monthly or yearly job is called determined since its actual execution date
is not specified but instead is determined from the scheduling information that is supplied.
An example of a determined monthly job is a job that is scheduled to run on the last
Tuesday of every 2 months. An example of a determined yearly job is a job that is
scheduled to run on the third Wednesday of July of each year.
Structure
typedef union _recurrenceInfo
{
struct union
{
BYTE interval;
BYTE month_interval;
90
/* BATCH_JOB_FLAG_SPECIFIC_MONTHLY_FREQUENCY:
month interval, or
BATCH_JOB_FLAG_DETERMINED_MONTHLY_FREQUENCY:
month interval. */
/* BATCH_JOB_FLAG_WEEKLY_FREQUENCY:
day of the week mask,
BATCH_JOB_FLAG_DETERMINED_MONTHLY_FREQUENCY:
day of the week mask,
BATCH_JOB_FLAG_DETERMINED_YEARLY_FREQUENCY:
day of the week mask,
BATCH_JOB_FLAG_SPECIFIC_MONTHLY_FREQUENCY:
day of the month, or
BATCH_JOB_FLAG_SPECIFIC_YEARLY_FREQUENCY:
day of the month. */
A byte containing the hourly interval for hourly jobs, the daily
interval for daily jobs, or the weekly interval for weekly jobs. The
valid interval values are 1 to 99. For monthly and
yearly-determined jobs, this byte contains a number from 1 to 5
representing an ordinal (first, second, third, fourth, or last) that
indicates which day, weekday, or weekend day is being chosen.
For example a 1 would mean the first such day, and a 5 would
mean the last such day.
BYTE month_interval
BYTE day_information
BYTE month_of_year
91
BATCH_SERVER_INFO
The BATCH_SERVER_INFO structure contains attributes for the server and overall batch
environment.
Structure
struct _batchservinfo
{
DWORD state
PSECURITY_DESCRIPTOR pSD
LPTSTR defaultqueue
DWORD debuglevel
LPTSTR reserved 2
LPBYTE reserved
} BATCH_SERVER_INFO, *PBATCH_SERVER_INFO;
Parameters
DWORD state
92
LPBYTE reserved 2
LPBYTE reserved
93
BatchAbortJob
Description
Aborts the execution of a running job. The caller must either own the job, or have operator
privileges on the server on which the job is running.
Syntax
DWORD BatchAbortJob(LPCTSTR jobid, DWORD restart, LPCTSTR reserved);
Parameters
LPCTSTR jobid
DWORD restart
LPCTSTR reserved
Return Values
BATCH_ERROR_JOB_NOT_RUNNIN
G
BATCH_ERROR_NO_SUCH_JOB
BATCH_ERROR_BAD_JOB_NAME
BATCH_ERROR_OWNER_OR_OPER
ATOR_ACCESS_DENIED
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPCTSTR FirstArg;
LPCTSTR LastArg = NULL;
TCHAR * pJobId;
DWORD
ReturnVal = 9999;
DWORD
Restart = 0;
DWORD
SigNo = NULL;
cout << " STARTING OF BATCHABORTJOB API " << endl;
pJobId = new TCHAR [ MAX_LENGTH ];
if (pJobId==NULL){
cout << "Unable to allocate the Memory.\n Exiting the program"<<endl;
exit(0);
}
cout << " Enter the job-id of the job to Abort ";
cin >> pJobId;
FirstArg = (const TCHAR *)pJobId;
ReturnVal = BatchAbortJob ( FirstArg , Restart , SigNo , LastArg );
switch ( ReturnVal)
{
case BATCH_ERROR_JOB_NOT_RUNNING:
cout << " The job is not running. Use BatchDeleteJob to cancel a job that is not running : " << FirstArg
<< endl;
break;
case BATCH_ERROR_NO_SUCH_JOB:
cout << " The system could not find the named job : " << FirstArg << endl;
break;
case BATCH_ERROR_BAD_JOB_NAME:
cout << " The jobid was null or the syntax was incorrect : " << FirstArg << endl;
break;
case BATCH_ERROR_OWNER_OR_OPERATOR_ACCESS_DENIED:
cout << " The caller neither owns the job nor has operator privileges. : " << FirstArg << endl;
94
BatchAbortQueue
Description
Aborts all running jobs in the named queue. The caller must have operator privileges on the
server.
Syntax
DWORD BatchAbortQueue(LPCTSTR queuename, DWORD restart);
Parameters
LPCTSTR queuename
DWORD restart
Return Values
BATCH_ERROR_NO_SUCH_QUEUE
BATCH_ERROR_BAD_QUEUE_NAME
BATCH_ERROR_OPERATOR_
ACCESS_DENIED
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
char * pTemp = NULL;
LPCTSTR QueName;
DWORD ReturnVal = 0;
DWORD Status = 0;
cout << "STARTING THE EXECUTION OF BATCHABORTQUEUE API "<< endl;
pTemp = new char[ MAX_LENGTH];
if (pTemp == NULL){
cout << " Unable to allocate the memory.\n Exiting the program "<<endl;
exit(0);
}
cout << " Enter the name of the QUEUE to Abort"<< endl;
cin >> pTemp;
QueName = (const char *)pTemp;
cout << " Enter the status whether to restart or not"
<< " 0
for DELETION
1 for Restarting "<< endl;
cin >> Status;
ReturnVal = BatchAbortQueue( QueName,Status);
switch(ReturnVal)
{
case BATCH_ERROR_NO_SUCH_QUEUE
:
cout << " The queue does not exist. " << endl;
break;
case BATCH_ERROR_BAD_QUEUE_NAME
:
cout << " The syntax of the queue name was not valid. " << endl;
break;
case BATCH_ERROR_OPERATOR_ACCESS_DENIED
:
cout << " The user does not have operator privileges. " << endl;
break;
default:
cout << "SUCCESSFUL COMPLETION OF ABORTING THE QUEUE "<< endl;
}
95
BatchCreateQueue
Description
Creates a batch queue on a batch server. The caller must have management privileges on the
server. The queue is described by the BATCH_QUEUE_INFO_2 (on page 82) structure.
Default values for this structure have been defined, see BatchCreateQueue Default
BATCH_QUEUE_INFO_2 Values (on page 97).
Syntax
DWORD BatchCreateQueue(LPCTSTR queue, BATCH_QUEUE_INFO_2 qinfo);
Parameters
LPCTSTR queue
BATCH_QUEUE_INFO_2 qinfo
Return Values
BATCH_ERROR_ALREADY_EXISTS
BATCH_ERROR_BAD_QUEUE_NAME
BATCH_ERROR_BAD_QUEUE_TYPE
BATCH_ERROR_MANAGER_
ACCESS_DENIED
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPCTSTR QueName;
DWORD TempVar=NULL;
DWORD ReturnVal=NULL;
char * pTempName;
BATCH_QUEUE_INFO_2 NewQue;
cout << " STARTED EXECUTION OF BATCHCREATEQUEUE API"<< endl;
pTempName = new char[ MAX_LENGTH];
if ( pTempName ==NULL ){
cout << "Unable to allocate the memory."<<endl;
exit(0);
}
cout << " Enter the Queue Name to be created ";
cin
>> pTempName;
QueName = (const char *)pTempName;
cout << " Enter the Queue Type 1 PIPE QUEUE 2 for BATCH QUEUE ";
cin >> TempVar;
if (TempVar == 1)
NewQue.qtype = BATCH_QUEUE_TYPE_PIPE;
else
if (TempVar == 2)
NewQue.qtype = BATCH_QUEUE_TYPE_BATCH;
else
NewQue.qtype = 3;
cout << " Enter the priority type ";
cin >> TempVar;
NewQue.qpri = TempVar;
cout << " Enter the Max Running Jobs Limit ";
cin >> TempVar;
NewQue.runlimit = TempVar;
NewQue.pSD = NULL;
if ( NewQue.qtype == 2){
NewQue.defaultpri = 31;
NewQue.sizelimit = 1000000;
}
else
if (NewQue.qtype == 1) {
NewQue.defaultpri = 0;
NewQue.sizelimit = 0;
96
qtype
state
qpri
defaultpri
runprilimit
runlimit
The default run limit is 1. Intergraph PDS does not support a run
limit greater than 1.
sizelimit
jobcount
description
pSD
system
user
processor_affinity
The default is 0.
v.batch.shell_list
v.batch.defaultshell
v.pipe.dest_list
reserved
97
BatchDeleteJob
Description
Deletes the named batch job on the named server. The caller must own the job, or have
operator privileges on the server.
Structure
DWORD BatchDeleteJob(LPCTSTR jobid, LPCTSTR reserved);
Parameters
LPCTSTR jobid
LPCTSTR reserved
Return Values
BATCH_ERROR_JOB_IS_RUNNING
BATCH_ERROR_NO_SUCH_JOB
BATCH_ERROR_BAD_JOB_NAME
BATCH_ERROR_OWNER_OR_OPE
RATOR_ACCESS_DENIED
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPCTSTR JobId=NULL;
LPCTSTR Reserved=NULL;
char *
pJobId;
DWORD
ReturnVal=0;
cout << "TESTING THE BATCHDELETEJOB API"<<endl;
pJobId = new char [ MAX_LENGTH ];
if (pJobId == NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
exit(0);
}
cout << "Enter the job-id of the job
cin >> pJobId;
JobId = (const char *)pJobId;
to delete";
ReturnVal = BatchDeleteJob(JobId,Reserved);
switch (ReturnVal)
{
case BATCH_ERROR_NO_SUCH_JOB :
cout << " The Job does not exist : " << JobId <<endl;
break;
case BATCH_ERROR_JOB_IS_RUNNING
:
cout << " The Job Is In Running Mode : " << JobId <<endl;
break;
case BATCH_ERROR_BAD_JOB_NAME :
cout << " The First argument syntax is wrong or it is NULL : " << JobId <<endl;
break;
case BATCH_ERROR_OWNER_OR_OPERATOR_ACCESS_DENIED :
cout << " The Job is Not Owned by the Current User : " << JobId << endl;
break;
default :
cout << "THE JOB HAS BEEN SUCCESSFULLY DELETED" <<endl;
break;
}
cout<<"FINISHED TESTING THE BATCHDELETEJOB API"<<endl;
delete [] pJobId;
}
98
BatchDeleteQueue
Description
Deletes the named queue. The queue must be empty, and disabled before it can be deleted.
The caller must have management privileges on the server.
Syntax
DWORD BatchDeleteQueue(LPCTSTR queuename);
Parameter
LPCTSTR queuename
Return Values
BATCH_ERROR_NO_SUCH_QUEUE
BATCH_ERROR_QUEUE_IS_ACTIVE
BATCH_ERROR_QUEUE_NOT_EMPTY
BATCH_ERROR_BAD_QUEUE_NAME
BATCH_ERROR_MANAGER_
ACCESS_DENIED
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPCTSTR QueName=NULL;
DWORD
ReturnVal=0;
char *
pTempName;
cout << "STARTED THE EXECUTION OF BATCHDELETEQUEUE API " << endl;
pTempName = new char [MAX_LENGTH];
if(pTempName == NULL){
cout << " Unable to allocate the memory." << endl;
exit(0);
}
cout << " Enter the Queue Name to be Deleted ";
cin >> pTempName;
QueName = (const char *)pTempName;
ReturnVal = BatchDeleteQueue( QueName );
switch(ReturnVal)
{
case BATCH_ERROR_NO_SUCH_QUEUE
:
cout << " The queue does not exist. " << endl;
break;
case BATCH_ERROR_QUEUE_IS_ACTIVE :
cout << " The queue is still enabled. " << endl;
break;
case BATCH_ERROR_QUEUE_NOT_EMPTY
:
cout << " There are still jobs in the queue. " << endl;
break;
case BATCH_ERROR_BAD_QUEUE_NAME
:
cout << " The syntax of the queue name was not valid. " << endl;
break;
case BATCH_ERROR_MANAGER_ACCESS_DENIED
:
cout << " The user does not have manager privileges. " << endl;
break;
default:
cout << "SUCCESSFUL DELETION OF THE QUEUE "<< endl;
}
cout << "FINISHED THE EXECUTION OF BATCHDELETEQUEUE API " << endl;
delete [] pTempName;
}
99
BatchDisableQueue
Description
Sets the inflow state of the named queue to "DISABLED". The caller must have operator
privileges on the server.
Syntax
DWORD BatchDisableQueue(LPCTSTR queuename);
Parameter
LPCTSTR queuename
Return Values
BATCH_ERROR_NO_SUCH_QUEUE
BATCH_ERROR_BAD_QUEUE_NAME
BATCH_ERROR_OPERATOR_
ACCESS_DENIED
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPCTSTR QueName=NULL;
DWORD
ReturnVal=0;
char * pTempName;
cout << " STARTING THE EXECUTION OF BATCHDISABLEQUEUE API " << endl;
pTempName = new char [MAX_LENGTH];
if (pTempName == NULL){
cout << "Unable to allocate the memory." << endl;
exit(0);
}
cout << " Enter the Queue Name to be Deleted ";
cin >> pTempName;
QueName = (const char *)pTempName;
ReturnVal = BatchDisableQueue(QueName );
switch(ReturnVal)
{
case BATCH_ERROR_NO_SUCH_QUEUE
:
cout << " The queue does not exist. " << endl;
break;
case BATCH_ERROR_BAD_QUEUE_NAME :
cout << " The syntax of the queue name was not valid. " << endl;
break;
case BATCH_ERROR_OPERATOR_ACCESS_DENIED
:
cout << " The user does not have operator privileges. " << endl;
break;
default:
cout << " SUCCESSFUL COMPLETION OF DISABLING THE QUEUE "<< endl;
}
cout << " COMPLETED THE EXECUTION OF BATCHDISABLEQUEUE API " << endl;
delete [] pTempName;
}
100
BatchEnableQueue
Description
Sets the inflow state of the named queue to "ENABLED". The caller must have operator
privileges on the server.
Syntax
DWORD BatchEnableQueue(LPCTSTR queuename);
Parameters
LPCTSTR queuename
Return Values
BATCH_ERROR_NO_SUCH_QUEUE
BATCH_ERROR_BAD_QUEUE_NAME
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
char * pTemp;
LPCTSTR QueName=NULL;
DWORD
ReturnVal=0;
cout << "STARTED EXECUTION OF THE BATCHENABLEQUEUE API " << endl;
pTemp = new char [MAX_LENGTH];
if(pTemp == NULL){
cout << "unable to allocate the memory." << endl;
exit(0);
}
cout << "Enter the QUEUE TO ENABLE "<< endl;
cin >> pTemp;
QueName = (const char *) pTemp;
ReturnVal= BatchEnableQueue(QueName);
switch( ReturnVal)
{
case BATCH_ERROR_NO_SUCH_QUEUE
:
cout << " The queue does not exist. " << endl;
break;
case BATCH_ERROR_BAD_QUEUE_NAME
:
cout << " The syntax of the queue name was not valid. " << endl;
break;
case BATCH_ERROR_OPERATOR_ACCESS_DENIED
:
cout << " The user does not have operator privileges. " << endl;
break;
default:
cout << " SUCCESSFUL COMPLETION OF ENABLEQUEUE " << endl;
}
cout << "COMPLETED EXECUTION OF THE BATCHENABLEQUEUE API " << endl;
delete [] pTemp;
}
101
BatchEnumerateJobs
Description
Enumerates all of the jobs associated with a given queue or server.
Syntax
DWORD BatchEnumerateJobs (LPCTSTR queue, DWORD level, LPBYTE jobbuf, DWORD
cbsize, LPDWORD cbneeded, LPDWORD jobcount);
Parameters
LPCTSTR queue
DWORD level
LPBYTE jobbuf
DWORD cbsize
LPDWORD cbneeded
LPDWORD jobcount
Return Values
BATCH_ERROR_NO_SUCH_QUEUE
ERROR_INVALID_LEVEL
BATCH_ERROR_BAD_QUEUE_NAME
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPBYTE Jobid;
LPCTSTR QueName=NULL;
char * pTemp=NULL;
DWORD
ReturnVal;
DWORD
Jobcount;
DWORD
Level;
DWORD
Need;
DWORD
CbSize;
cout << endl << "STARTING THE EXECUTION OF
CbSize = BATCH_JOB_ID_SIZE + 4;
102
BatchEnumerateQueues
Description
Returns information about all of the queues on a server.
Syntax
DWORD BatchEnumerateQueues(LPCTSTR server, DWORD level, LPBYTE qbuff, DWORD
cbsize, LPDWORD cbneeded, LPDWORD qcount);
Parameters
LPCTSTR server
DWORD level
LPBYTE qbuff
DWORD cbsize
LPDWORD cbneeded
LPDWORD qcount
Return Values
BATCH_ERROR_BAD_SERVER_NAME
ERROR_INVALID_LEVEL
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
103
pTemp;
QBuff;
ServName;
Level;
CbSize;
ReturnVal;
Need;
Qcount;
BatchGetJobInfo
Description
Returns information about a particular job.
Structure
DWORD BatchGetJobInfo(LPCTSTR jobid, DWORD level, LPBYTE buff, DWORD cbsize,
LPDWORD cbneeded);
Parameters
LPCTSTR jobid
DWORD level
LPBYTE buff
DWORD cbsize
LPDWORD cbneeded
Return Values
104
ERROR_INVALID_LEVEL
BATCH_ERROR_BAD_JOB_NAME
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPCTSTR JobId=NULL;
LPBYTE Buff;
char * pTemp=NULL;
DWORD
ReturnVal=0;
DWORD
Level;
DWORD
Need;
DWORD
CbSize;
cout << " STARTING THE EXECUTION OF BATCHGETJOBINFO API " << endl;
CbSize= BATCH_JOB_ID_SIZE + 4;
pTemp = new char[MAX_LENGTH];
if (pTemp ==NULL){
cout << "unable to allocate the memory.\n Exiting"<<endl;
exit(0);
}
cout << " Enter the Job id for which to get the info ";
cin >> pTemp;
JobId = (const char *)pTemp;
cout << " Enter the Level of Extraction ( 1 or 2) ";
cin >> Level;
ReturnVal = BatchGetJobInfo ( JobId , Level , NULL , 0 , &Need);
Buff = (LPBYTE)LocalAlloc(0,Need);
if (Buff ==NULL){
cout << "unable to allocate the memory.\n Exiting"<<endl;
delete [] pTemp;
exit(0);
}
CbSize= Need;
ReturnVal = BatchGetJobInfo ( JobId , Level , Buff , CbSize , &Need);
switch(ReturnVal)
{
case BATCH_ERROR_NO_SUCH_JOB
:
cout << "The system could not find the named job. : " << endl;
break;
case ERROR_INVALID_LEVEL
:
cout << "The level parameter is not 1 or 2. " << endl;
break;
case BATCH_ERROR_BAD_JOB_NAME :
cout << "The jobid was null or the syntax was incorrect." << endl;
break;
default :
cout << "SUCCESSFUL IN GETTING THE JOB INFO"<< endl;
}
cout << " FINISHED THE EXECUTION OF BATCHGETJOBINFO API " << endl;
delete [] pTemp;
LocalFree(Buff);
}
BatchGetQueueInfo
Description
Gets information about the named queue.
Syntax
DWORD BatchGetQueueInfo(LPCTSTR queue, DWORD level, LPBYTE qbuff, DWORD cbsize,
LPDWORD cbneeded);
Parameters
LPCTSTR queue
DWORD level
105
DWORD cbsize
LPDWORD cbneeded
Return Values
BATCH_ERROR_NO_SUCH_QUEUE
ERROR_INVALID_LEVEL
BATCH_ERROR_BAD_QUEUE_NAME
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
char*
pTemp;
LPCTSTR QueName;
LPBYTE QBuff;
DWORD
ReturnVal;
DWORD
Level;
DWORD
CbSize;
DWORD
Need;
cout << " STARTING THE EXECUTION OF BATCHGETQUEUEINFO API "<< endl;
pTemp = new char[MAX_LENGTH];
if (pTemp == NULL){
cout << "unable to allocate the memory.\n Exiting"<<endl;
exit(0);
}
cout << " Please enter the name of the Queue ";
cin >> pTemp;
QueName = (const char *) pTemp;
cout << " Enter the Level of Enumeration required ";
cin >> Level;
ReturnVal = BatchGetQueueInfo( QueName, Level, NULL, 0, &Need);
QBuff = (LPBYTE) LocalAlloc (0,Need);
if (QBuff == NULL){
cout << "unable to allocate the memory.\n Exiting"<<endl;
delete [] pTemp;
exit(0);
}
CbSize = Need;
ReturnVal = BatchGetQueueInfo( QueName, Level, QBuff, CbSize, &Need);
switch(ReturnVal)
{
case BATCH_ERROR_NO_SUCH_QUEUE :
cout << " The system could not find the named queue. "<< endl;
break;
case ERROR_INVALID_LEVEL
:
cout << " The level parameter is not 1 or 2. " << endl;
break;
case BATCH_ERROR_BAD_QUEUE_NAME
:
cout << " The syntax of the queue name was not valid. " << endl;
break;
default:
cout << "SUCCESSFUL COMPLETION OF GETQUEUEINFO "<< endl;
}
cout << " COMPLETED THE EXECUTION OF BATCHGETQUEUEINFO API "<< endl;
delete [] pTemp;
LocalFree(QBuff);
}
106
BatchGetServerInfo
Description
Returns information about the batch service on the named server.
Syntax
DWORD BatchGetServerInfo(LPCTSTR server, LPBYTE servinfobuf, DWORD cbsize,
LPDWORD cbneeded);
Parameters
LPCTSTR server
LPBYTE servinfobuf
DWORD cbsize
LPDWORD cbneeded
Return Values
BATCH_ERROR_BAD_SERVER_NAME
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPCTSTR ServName;
LPBYTE ServInfoBuff;
DWORD CbSize,Need,ReturnVal;
char * pTempName;
cout << "STARTING THE EXECUTION OF BATCHGETSERVERINFO API "<< endl;
pTempName = new char [MAX_LENGTH];
if (pTempName ==NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
exit(0);
}
cout << " Enter the Name of the server for which info is required ";
cin >> pTempName;
ServName = (const char*)pTempName;
ReturnVal = BatchGetServerInfo(ServName , NULL , 0 ,&Need);
ServInfoBuff = (LPBYTE)LocalAlloc(0,Need);
if (ServInfoBuff ==NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
delete [] pTempName;
exit(0);
}
CbSize = Need;
ReturnVal = BatchGetServerInfo(ServName, ServInfoBuff,CbSize,&Need);
switch (ReturnVal)
{
case BATCH_ERROR_BAD_SERVER_NAME
:
cout << " The syntax of the server name was invalid. " << endl;
break;
default:
cout << "SUCCESSFUL COMPLETION OF GETTING SERVER INFORMATION "<< endl;
}
cout << "COMPLETED THE EXECUTION OF BATCHGETSERVERINFO API "<< endl;
delete [] pTempName;
LocalFree(ServInfoBuff);
}
107
BatchJobHold
Description
Puts a hold on a batch job, preventing it from being executed until the hold is released. To apply
a BATCH_USER_HOLD to the job, the caller must own the job. To apply a
BATCH_MGR_HOLD, the caller must have operator privileges.
Syntax
DWORD BatchJobHold(LPCTSTR jobid, DWORD holdtype);
Parameters
LPCTSTR jobid
DWORD holdtype
Return Values
BATCH_ERROR_NO_SUCH_JOB
BATCH_ERROR_BAD_JOB_NAME
BATCH_ERROR_OWNER_ACCESS_DENIED
BATCH_ERROR_JOB_IS_RUNNING
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
char * pTemp;
LPCTSTR JobId;
DWORD HoldType,ReturnVal;
cout << " STARTING THE EXECUTION OF BATCHJOBHOLD API "<< endl;
pTemp = new char[MAX_LENGTH];
if (pTemp == NULL){
cout << "unable to allocate the memory.\n Exiting"<<endl;
exit(0);
}
cout << " Enter the Job id for which to get the info ";
cin >> pTemp;
JobId = (const char *)pTemp;
cout << "Enter the Job Hold type wanted"
<< " 0 for BATCH_USER_HOLD 1 for BATCH_MGR_HOLD, 2 for both " << endl;
cin >> HoldType;
switch (HoldType)
{
case 0 :
// the hold type required is only Userhold
ReturnVal=BatchJobHold( JobId, BATCH_USER_HOLD);
break;
case 1:
// the hold type required is only ManagerHold
ReturnVal=BatchJobHold( JobId, BATCH_MGR_HOLD);
break;
case 2:
// the hold type required is both Userhold and MangerHold
ReturnVal=BatchJobHold( JobId, BATCH_USER_HOLD | BATCH_MGR_HOLD);
break;
108
BatchJobRelease
Description
Removes a user or manager hold on a job, freeing it for execution. To remove a
BATCH_USER_HOLD from the job, the caller must own the job. To remove a
BATCH_MGR_HOLD, the caller must have operator privileges.
Syntax
DWORD BatchJobRelease(LPCTSTR jobid, DWORD holdtype);
Parameters
LPCTSTR jobid
DWORD holdtype
Return Values
BATCH_ERROR_NO_SUCH_JOB
BATCH_ERROR_BAD_JOB_NAME
BATCH_ERROR_OWNER_OR_
OPERATOR_ACCESS_DENIED
BATCH_ERROR_INVALID_HOLD
BATCH_ERROR_JOB_IS_RUNNING
Example Program
#include < iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPCTSTR JobId;
char * pTemp;
DWORD
HoldType;
DWORD
ReturnVal;
cout << " STARTED EXECUTION OF BATCHJOBRELEASE API" << endl;
pTemp = new char[MAX_LENGTH];
if (pTemp == NULL){
109
BatchMoveJob
Description
Moves a batch job from one queue to another on the same server. The caller must own the job,
or have operator privileges. The caller must have submit access to the destination queue.
Syntax
DWORD BatchMoveJob(LPCTSTR jobid, LPCTSTR toqueue);
Parameters
LPCTSTR jobid
LPCTSTR toqueue
Specifies the queue to which the job will move. The queue must
exist on the same server as the job. A job cannot be moved
between servers. The value of toqueue must be a simple text string
and not the full remote queue specification.
Return Values
110
BATCH_ERROR_NO_SUCH_JOB
BATCH_ERROR_BAD_JOB_NAME
BATCH_ERROR_QUEUE_ACCESS_DENIED
BATCH_ERROR_QUEUE_NOT_ENABLED
111
BatchPurgeQueue
Description
Removes all jobs from the named queue that are not in the RUNNING or TRANSITING state.
The caller must have operator privileges on the server.
Syntax
DWORD BatchPurgeQueue(LPCTSTR queuename);
Parameter
LPCTSTR queuename
Return Values
BATCH_ERROR_NO_SUCH_QUEUE
BATCH_ERROR_BAD_QUEUE_NAME
BATCH_ERROR_OPERATOR_ACCESS_DENIED
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
char * pTemp;
LPCTSTR QueName;
DWORD
ReturnVal;
cout << " STARTING THE EXECUTION OF BATCHPURGEQUEUE API " << endl;
pTemp = new char [MAX_LENGTH];
if (pTemp == NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
exit(0);
}
cout << " Enter the Queue to Purge ";
cin >> pTemp;
QueName = (const char *)pTemp;
ReturnVal = BatchPurgeQueue(QueName);
switch(ReturnVal)
{
case BATCH_ERROR_NO_SUCH_QUEUE
:
cout << " The queue does not exist. " << endl;
break;
case BATCH_ERROR_BAD_QUEUE_NAME
:
cout << " The syntax of the queue name was not valid. " << endl;
break;
case BATCH_ERROR_OPERATOR_ACCESS_DENIED
:
cout << " The user does not have operator privileges. " << endl;
break;
default:
cout << "SUCCESSFUL COMPLETION OF PURGING THE QUEUE "<< endl;
}
cout << " COMPLETED THE EXECUTION OF BATCHPURGEQUEUE API " << endl;
delete [] pTemp;
}
112
BatchServerShutdown
Description
Shuts down the batch service on the named server. The caller must have operator privileges on
the server.
Syntax
DWORD BatchServerShutdown(LPCTSTR server, DWORD graceperiod);
Parameters
LPCTSTR server
DWORD graceperiod
Return Values
ERROR_SUCCESS
BATCH_ERROR_BAD_SERVER_NAME
113
BatchSetJobInfo
Description
Sets or modifies various job attributes. You can modify the following job properties:
Level
Properties
1. priority
2. name
2
1. priority
2. name
3. runpriority
4. restartable
5. job recurrence information
The other job attributes are ignored, and are not set. If a job attribute is missing or is not valid,
then it is not set, and the function returns success. The caller must own the job or have operator
privileges to use this function.
Syntax
DWORD BatchSetJobInfo(LPCTSTR jobid, DWORD level, LPBYTE jobinfo);
Parameters
LPCTSTR jobid
DWORD level
LPBYTE jobinfo
Points to a buffer containing the job info structure. Note that some job
attributes cannot be set with this call.
Return Values
BATCH_ERROR_JOB_IS_RUNNING
BATCH_ERROR_NO_SUCH_JOB
ERROR_INVALID_LEVEL
BATCH_ERROR_BAD_JOB_NAME
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPBYTE Buff;
long
Priority;
LPCTSTR JobId;
114
cout << " Enter the priority to set for the job " ;
cin >> Priority;
cout << " Enter the Runpriority to set for the job ";
cin >> RunPriority;
cout << " Enter whether to restart the job " ;
cin >> Restartable;
cout << " Enter the name to set for the job ";
cin >> pTempName;
pName = pTempName;
m_ReturnVal = BatchGetJobInfo ( JobId , Level , NULL , 0 , &Need);
Buff = (LPBYTE)LocalAlloc(0,Need);
if (Buff == NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
delete [] pTemp; delete []pTempName;
exit(0);
}
CbSize= Need;
m_ReturnVal = BatchGetJobInfo ( JobId , Level , Buff , CbSize , &Need);
if (Level==2)
{
BATCH_JOB_INFO_2 * Jinfo;
Jinfo = (BATCH_JOB_INFO_2 *)Buff;
Jinfo->priority = Priority;
Jinfo->runpriority = RunPriority;
Jinfo->restartable = Restartable;
Jinfo->name = pName;
m_ReturnVal = BatchSetJobInfo (JobId , Level, (LPBYTE)Jinfo);
}
else
if (Level == 1)
{
BATCH_JOB_INFO_1 * Jinfo;
Jinfo = (BATCH_JOB_INFO_1 *)Buff;
Jinfo->priority = Priority;
Jinfo->name = pName;
m_ReturnVal = BatchSetJobInfo (JobId , Level, (LPBYTE)Jinfo);
}
switch (m_ReturnVal)
{
case BATCH_ERROR_JOB_IS_RUNNING
:
cout << " You cannot modify job attributes while the job is running." << endl;
break;
case BATCH_ERROR_NO_SUCH_JOB
:
cout << " The system could not find the named job." << endl;
break;
case ERROR_INVALID_LEVEL :
cout << " The value of the level parameter is not 1 or 2." << endl;
break;
case BATCH_ERROR_BAD_JOB_NAME
:
cout << " The jobid was null or the syntax was incorrect. " << endl;
break;
case BATCH_ERROR_OWNER_OR_OPERATOR_ACCESS_DENIED
:
cout << " The caller neither owns the job nor has operator privileges. " << endl;
break;
115
BatchSetQueueInfo
Description
Sets attributes of the named queue. The caller must have management privileges. The following
attributes of the queue can be set:
1. qpri
2. defaultpri
3. runprilimit
4. runlimit
5. sizelimit
6. description
7. pSD (security descriptor)
8. processor_affinity
9. v.batch.shell_list
10. v.batch.defaultshell
11. v.pipe.dest_list
Syntax
DWORD BatchSetQueueInfo(LPCTSTR queue, DWORD level, LPBYTE queueinfo);
Parameters
LPCTSTR queue
DWORD level
LPBYTE queueinfo
Return Values
BATCH_ERROR_NO_SUCH_QUEUE
ERROR_INVALID_LEVEL
BATCH_ERROR_BAD_QUEUE_NAME
116
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPCTSTR QueName;
long
DefPri;
LPBYTE QBuff;
char * pTemp;
char * pTempDesc;
char * pTempShell;
LPTSTR Desc;
LPTSTR * ShellList;
LPTSTR * DestList;
DWORD
ReturnVal;
DWORD
Level;
DWORD
CbSize;
DWORD
Need;
DWORD
Number;
DWORD
QuePri;
DWORD
RunPriLim;
DWORD
RunLim;
DWORD
SizLim;
DWORD
ProcAffin;
cout << " STARTING THE EXECUTION OF BATCHSETQUEUEINFO API "<< endl;
cout << endl << " You can set only the following attributes "<<endl
<< " quepriority defaultpriority runprioritylimit runlimit "<<endl
<< " sizelimit
description
pSD(security descriptor) "<<endl
<< " processor_affinity v.batch.shell_list
v.batch.defaultshell "<<endl
<< " v.pipe.dest_list " << endl;
pTemp = new char[MAX_LENGTH];
if (pTemp ==NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
exit(0);
}
pTempShell = new char[MAX_LENGTH];
if (pTempShell == NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
delete [] pTemp;
exit(0);
}
pTempDesc = new char[MAX_LENGTH];
if (pTempDesc == NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
delete [] pTemp;
delete [] pTempShell;
exit(0);
}
cout << " Please enter the name of the Queue ";
cin >> pTemp;
QueName = (const char *) pTemp;
cout << " Enter the Level of Enumeration required ";
cin >> Level;
cout << " Enter the Description value ";
cin >> pTempDesc;
Desc = (char *)pTempDesc;
cout << " Enter the QueuPriority value ";
cin >> QuePri;
if (Level == 2)
{
cout << " Enter the DefaultPriority value ";
cin >> DefPri;
cout << " Enter the RunPriorityLimit value ";
cin >> RunPriLim;
cout << " Enter the RunLimit value ";
cin >> RunLim;
cout << " Enter the sizeLimit value ";
cin >> SizLim;
cout << " Enter the ProcessorAffinity value ";
cin
>> ProcAffin;
}
ReturnVal = BatchGetQueueInfo( QueName, Level, NULL, 0, &Need);
QBuff = (LPBYTE) LocalAlloc (0,Need);
if (QBuff == NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
delete [] pTemp;
delete [] pTempShell;
delete [] pTempDesc;
exit(0);
}
CbSize = Need;
117
118
BatchSetServerInfo
Description
Sets attributes for the batch service on the named server. Invalid or missing values are ignored.
The caller must have management access to the server. The following attributes can be set:
1. debuglevel
2. defaultqueue
3. pSD
Syntax
DWORD BatchSetServerInfo(LPCTSTR server, BATCH_SERVER_INFO servinfo);
Parameters
LPCTSTR server
BATCH_SERVER_INFO servinfo
Return Values
BATCH_ERROR_BAD_SERVER_NAME
119
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
LPTSTR
DefQue;
LPCTSTR ServName;
LPBYTE
ServBuff;
char *
pTempName;
char *
pTempQue;
DWORD
ReturnVal;
DWORD
CbSize;
DWORD
Need;
DWORD
DebugLevel;
BATCH_SERVER_INFO * ServInfo;
cout << "STARTED EXECUTION OF BATCHGETSERVERINFO API" << endl;
cout << " The Caller Must have Manager privileges and can set any of "<< endl
<< " the following attributes only. debuglevel defaultqueue pSD "<< endl;
pTempName = new char [ MAX_LENGTH];
if (pTempName == NULL) {
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
exit(0);
}
pTempQue = new char[MAX_LENGTH];
if ( pTempQue == NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
delete [] pTempName;
exit(0);
}
cout << " Enter the name of the server for which to set the info ";
cin >> pTempName;
ServName = (const char *)pTempName;
ReturnVal = BatchGetServerInfo(ServName, NULL,0,&Need);
ServBuff = (LPBYTE) LocalAlloc(0,Need);
if (ServBuff == NULL) {
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
delete [] pTempName; delete [] pTempQue;
exit(0);
}
CbSize = Need;
ReturnVal = BatchGetServerInfo(ServName,ServBuff,CbSize,&Need);
cout << " Enter the Default Queue to set for the server ";
cin >> pTempQue;
DefQue = (char *)pTempQue;
cout << " Enter the Debug level for Log file to set for the Server ";
cin >> DebugLevel;
ServInfo = (BATCH_SERVER_INFO *)ServBuff;
ServInfo->debuglevel = DebugLevel;
ServInfo->defaultqueue = DefQue;
ReturnVal = BatchSetServerInfo(ServName,*ServInfo);
switch(ReturnVal)
{
case BATCH_ERROR_BAD_SERVER_NAME :
cout << " The syntax of the server name was not valid. " << endl;
break;
case BATCH_ERROR_MANAGER_ACCESS_DENIED
:
cout << " The user does not have manager privileges. " << endl;
break;
default:
cout << "SUCCESSFUL COMPLETION OF BATCHSETSERVER INFORMATION"<< endl;
}
cout << " COMPLETED EXECUTION OF BATCHGETSERVERINFO API " << endl;
delete [] pTempName;
delete [] pTempQue;
LocalFree(ServBuff );
}
120
BatchStartQueue
Description
Sets the outflow state of the named queue to "STARTED". The caller must have operator
privileges on the server.
Syntax
DWORD BatchStartQueue(LPCTSTR queuename);
Parameter
LPCTSTR queuename
Return Values
BATCH_ERROR_NO_SUCH_QUEUE
BATCH_ERROR_BAD_QUEUE_NAME
BATCH_ERROR_OPERATOR_ACCESS_DENIED
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
char * pTemp;
LPCTSTR QueName;
DWORD
ReturnVal;
cout << " STARTING THE EXECUTION OF BATCHSTARTQUEUE API"<< endl;
pTemp= new char[ MAX_LENGTH];
if (pTemp == NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
exit(0);
}
cout << " Enter the name of the QUEUE to start"<< endl;
cin >> pTemp;
QueName = (const char *)pTemp;
ReturnVal = BatchStartQueue(QueName);
switch(ReturnVal)
{
case BATCH_ERROR_NO_SUCH_QUEUE
:
cout << "The queue does not exist. " << endl;
break;
case BATCH_ERROR_BAD_QUEUE_NAME :
cout << " The syntax of the queue name was not valid. " << endl;
break;
case BATCH_ERROR_OPERATOR_ACCESS_DENIED
:
cout << " The user does not have operator privileges. " << endl;
break;
default:
cout << " SUCCESSFUL COMPLETION OF START QUEUE "<< endl;
}
cout << " COMPLETED THE EXECUTION OF BATCHSTARTQUEUE API"<< endl;
delete [] pTemp;
}
121
BatchStopQueue
Description
Sets the outflow state of the named queue to "STOPPED". If jobs are running in the queue, the
state is set to "STOPPING" until the jobs complete, and then it is set to "STOPPED". The caller
must have operator privileges on the server.
Syntax
DWORD BatchStopQueue(LPCTSTR queuename);
Parameter
LPCTSTR queuename
Return Values
BATCH_ERROR_NO_SUCH_QUEUE
BATCH_ERROR_BAD_QUEUE_NAME
BATCH_ERROR_OPERATOR_ACCESS_DENIED
Example Program
#include <iostream.h>
#include "batchapi.h"
#define MAX_LENGTH 25
void main()
{
char * pTemp;
LPCTSTR QueName;
DWORD
ReturnVal;
cout << " STARTING THE EXECUTION OF BATCHSTOPQUEUE API"<< endl;
pTemp = new char[ MAX_LENGTH];
if (pTemp == NULL){
cout << "unable to allocate the memory.\n Exiting the program"<<endl;
exit(0);
}
cout << " Enter the name of the QUEUE to start"<< endl;
cin >> pTemp;
QueName = (const char *)pTemp;
ReturnVal = BatchStopQueue(QueName);
switch(ReturnVal)
{
case BATCH_ERROR_NO_SUCH_QUEUE
:
cout << " The queue does not exist. " << endl;
break;
case BATCH_ERROR_BAD_QUEUE_NAME :
cout << " The syntax of the queue name was not valid. " << endl;
break;
case BATCH_ERROR_OPERATOR_ACCESS_DENIED
:
cout << " The user does not have operator privileges. " << endl;
break;
default:
cout << "SUCCESSFUL COMPLETION OF STOPPING THE QUEUE " << endl;
}
cout << " COMPLETED THE EXECUTION OF BATCHSTOPQUEUE API"<< endl;
delete [] pTemp;
}
122
QueueBatchJob
Submits a batch job to a batch queue. The caller must have submit access to the named queue.
The job is described in the BATCH_JOB_INFO_2 (on page 86) structure. Default values for
this structure have been defined, see Default Values for QueueBatchJob (on page 125).
Syntax
DWORD QueueBatchJob(LPCTSTR queue, BATCH_JOB_INFO_2 jobinfo, LPBYTE jobid,
DWORD cbsize, LPDWORD cbneeded);
Parameters
LPCTSTR queue
BATCH_JOB_INFO_2 jobinfo
LPBYTE jobid
DWORD cbsize
Specifies the size of the jobid buffer. This value must greater
than or equal to BATCH_JOB_ID_SIZE.
LPDWORD cbneeded
Return Values
BATCH_ERROR_BAD_JOB_INFO
BATCH_ERROR_NO_SUCH_QUEUE
BATCH_ERROR_QUEUE_NOT_ENABLED
BATCH_ERROR_QUEUE_ACCESS_DENIED
BATCH_ERROR_BAD_QUEUE_NAME
BATCH_ERROR_NO_ACCOUNT_MAPPING
BATCH_ERROR_BAD_SCRIPTNAME
BATCH_ERROR_BAD_JOB_PRIORITY
BATCH_ERROR_BAD_RUN_PRIORITY
BATCH_ERROR_INVALID_HOLD
BATCH_ERROR_BAD_JOB_FLAG
BATCH_ERROR_QUEUE_RUN_
PRIORITY_EXCEEDED
123
124
case
BATCH_ERROR_BAD_RUN_PRIORITY
:
cout << " The run priority was invalid." << endl;
break;
case
BATCH_ERROR_INVALID_HOLD
:
cout << " A hold other than a user hold was specified. " << endl;
jobid
owner
name
If this value is NULL, it is set to the basename of the script (or STDIN if the
script has no pathname).
priority
runpriority
restartable
starttime
size
state
holds
script
reserved2
stderr
stdout
system
user
shell
If this value is NULL, the system uses the default shell set in the queue.
envp
This value has no default, and may be set to NULL. (See comments below
for more information.)
logmsg
account
infiles
outfiles
origin
125
flags
filesizelimit
recurrence
Set to zero by default. Unused until a recurring job flag is set in the flags
field.
The envp member has some special constraints. The following environment variables will not be
put into the job environment, even if they are included in the envp structure:
HOMEDRIVE
HOMEPATH
HOMESHARE
Path
ComSpec
TZ
USERNAME
QSUB_HOME
QSUB_PATH
QSUB_SHELL
QSUB_MAIL
QSUB_TZ
QSUB_USER
QSUB_REQID
QSUB_REQNAME
QSUB_HOST
Certain environment variables will be taken from the submitting user's environment (NOT the
envp member), renamed, and put into the job execution environment:
User environment variable
ComSpec
QSUB_SHELL
HOMEDRIVE, HOMEDIR
QSUB_HOME
QSUB_MAIL
Path
QSUB_PATH
TZ
QSUB_TZ
USERNAME
QSUB_USER
If an environment variable does not exist in the user's environment, then the corresponding
variable is not exported into the job execution environment.
At job execution time, the following environment variables are exported into the job environment:
126
QSUB_HOST
the name of the computer where the queue to which the job was
submitted resides
QSUB_REQID
the jobid
QSUB_REQNAME
BATCH_ERROR_BAD_HEADER
BATCH_ERROR_BAD_JOB_FLAG
BATCH_ERROR_BAD_JOB_INFO
BATCH_ERROR_BAD_JOB_NAME
BATCH_ERROR_BAD_JOB_PRIORITY
BATCH_ERROR_BAD_MAGIC
BATCH_ERROR_BAD_QUEUE_INFO
BATCH_ERROR_BAD_QUEUE_NAME
BATCH_ERROR_BAD_QUEUE_TYPE
BATCH_ERROR_BAD_RUN_PRIORITY
BATCH_ERROR_BAD_SCRIPTNAME
BATCH_ERROR_BAD_SERVER_INFO
BATCH_ERROR_BAD_SERVER_NAME
BATCH_ERROR_BAD_SHELLNAME
BATCH_ERROR_INVALID_HOLD
BATCH_ERROR_JOB_IS_RUNNING
BATCH_ERROR_JOB_NOT_RUNNING
127
BATCH_ERROR_NO_SUCH_QUEUE
BATCH_ERROR_NOT_SUPPORTED
BATCH_ERROR_QUEUE_ACCESS_DENIE
D
BATCH_ERROR_QUEUE_IS_ACTIVE
BATCH_ERROR_QUEUE_NOT_ENABLED
BATCH_ERROR_QUEUE_NOT_EMPTY
BATCH_ERROR_QUEUE_RUN_PRIORITY_ The run priority of the job is greater than the run
EXCEEDED
priority of the queue.
128
BATCH_ERROR_SERVER_DOWN
BATCH_ERROR_UNEXPECTED
BATCH_ERROR_UNKNOWN_PKT
No privileges
BatchAbortJob
job owner
operator
BatchAbortQueue
BatchCreateQueue
BatchDeleteJob
BatchDeleteQueue
BatchDisableQueue
BatchEnableQueue
BatchEnumerateJobs
BatchEnumerateQueues
BatchGetJobInfo
BatchGetQueueInfo
BatchGetServerInfo
BatchJobHold
BatchJobMove
BatchJobRelease
BatchPurgeQueue
BatchServerShutdown
BatchSetJobInfo
BatchSetQueueInfo
manager
X
X
129
No privileges
job owner
operator
BatchSetServerInfo
130
BatchStartQueue
BatchStopQueue
QueueBatchJob
manager
SECTION 6
In This Section
Name Syntax .............................................................................. 131
Submitting Jobs .......................................................................... 135
Deleting or Aborting Batch Jobs .................................................. 138
Obtaining Job and Queue Status ................................................ 139
Managing Batch Services ........................................................... 140
Name Syntax
The batch service determines which batch provider to use for operations based on the syntax of
names. Servers, queues, job-ids, user names, group names, and file names may all be remote.
The following table shows the remote items and their syntax for the various batch providers:
Item
Local syntax
server
\\LocalNodeName
\\host
queue
queue
\\host\queue
job-id
seqno.host
\\host\job-id
user
user
DOMAIN\user
HOST\user
group
group
DOMAIN\group
HOST\group
file
filename
\\host\filename
Queue
Specifies the local or remote queue name. A set of valid characters has been chosen for queue
names. The character set consists of all alphanumeric (both upper and lower case) and
punctuation characters, with the following exceptions:
The punctuation characters @ \ ( ) = and , are invalid. These characters already have
special meaning for the qmgr interface.
The punctuation characters - and / are invalid for the first character of a queue or shell
name. In most cases, the command line utilities expect these characters to signal the start of
an option.
Specify the queue name according to the following syntax:
131
queue
\\host\queue
Dest-name
Specifies the local or remote destination name. Destinations can be a local or remote queue,
according to the following syntax:
Local syntax
queue
\\host\queue
Group
Specifies the name of the local or remote group, according to the following syntax:
Local syntax
group
HOST\group
DOMAIN\group
Server
Specifies the name of the server, according to the following syntax:
Local syntax
\\LocalNodeName
\\host
User
Specifies the name of the local or remote user, according to the following syntax:
Local syntax
user
DOMAIN\user
HOST\user
Shell-name
Specifies the simple name of the shell. If the specified shell is located on a removable media, a
dialog will prompt you to insert the media. Batch Services provides a set of valid characters for
shell names. The character set consists of all alphanumeric (both upper and lower case) and
punctuation characters, with the following exceptions:
The punctuation characters @ \ ( ) = and , are invalid. These characters already have
special meaning for the qmgr interface.
132
The punctuation characters - and / are invalid for the first character of a queue or shell
name. In most cases, the command line utilities expect these characters to signal the start of
an option.
Runlimit
Defines the maximum number of requests allowed to run in a particular queue at any given time.
The default runlimit is 1.
Job-id
Specifies the local or remote job-id, according to the following syntax:
Local syntax
seqno.host
\\host\job-id
Priority-value
Specifies the scheduling priority of the request. The priority is used for scheduling the order of
job execution within the queue. The priority value must be in the range of [-1024..1023].
Nice-value
Specifies the initial nice value (also known as the run time or execution priority) of the request.
Nice-value can be within the range of [-20..20]. It can also be one of the following alphanumeric
descriptors:
Descriptor
Numeric Equivalent
IDLE
20
NORMAL
HIGH
10
REALTIME
-20
A REALTIME process preempts all other processes, including the operating system.
Intergraph recommends that you avoid using the REALTIME priority.
Debug Level
Specifies the debug level. A value of 0 turns off debug information, while non-zero value enables
debugging. Increasing values indicate that more information is to be displayed.
Debug Level
Logging Type
No Logging
Server Logging
Level 1 plus:
Meaning
133
Queue Logging
Job Logging
Level 2 plus:
Job Error Logging
Level 3 plus:
Pipe Debugging
Debug auditing types may aid in diagnosing
Packet Debugging low-level problems with the batch service. This
information may not be useful to users or
Other Debugging
operators.
Shell-path
Specifies the full pathname of the executable, according to the following syntax:
Local syntax
shell-path
\\host\\share\path*
*This specification works if the user who will run the job has access to the specified share.
date-time parameter
The syntax that is accepted for the date-time parameter is flexible. Unspecified date and time
values default to the current date and time. A date can be specified as a month and a day
(current year assumed).
Examples of valid date-time specifications are:
"01-Jan-2012 12am"
"Tuesday, 23:00:00"
"11pm tues."
"tomorrow 23"
The year can also be explicitly specified. It is also possible to specify the date as a weekday
name (for example, "Tues"), or as one of the strings "today" or "tomorrow." Weekday and month
names can be abbreviated by any three-character (or longer) prefix to the actual name. An
optional period can follow an abbreviated month or day name.
The time of day can be specified using a 24-hour clock or "am" and "pm" specifications. When
"am" or "pm" is not specified, a twenty-four hour clock is assumed. The time of day specification
is interpreted using the precise "am" or "pm" definitions. "12am" refers to the 24-hour clock time
of 0:00:00; "12m" refers to noon; and "12pm" refers to 24:00:00. Alternatively, the phrases
"midnight" and "noon" are accepted as time of day specifications, where "midnight" refers to
24:00:00.
134
Submitting Jobs
qsub: An Overview
The qsub utility allows you to submit jobs for batch processing. The qsub utility accepts as
arguments a shell script to be executed, a list of environment variables, a list of files to copy
before and after executing the job, and various options controlling job execution.
If the job submission is successful, the qsub will return a unique job identification string, or job
ID. The job ID may be used to perform further operations on that job. If the job submission is
unsuccessful, qsub returns an error message indicating the problem.
Synopsis
qsub [flags...] ["script-file[<TAB>script-args]"]
Qsub Interface (on page 135)
qsub Interface
The qsub utility accepts as an argument the file name of a shell script to execute. If no such
argument is given, the utility reads from stdin until an end of file is encountered, and uses this
input as the shell script. By default, the job name is the name of the shell script. If the shell script
is read from stdin, STDIN is the default job name.
The name of a script should not contain any characters that have special meaning to the
shell associated with the queue.
The qsub utility returns a unique job-identification string (job-id). You can use the job-ID to track
the job.
The return value indicates the success or failure of the submission. If qsub is invoked without
the -z option, qsub returns a message informing you whether or not the job submission was
successful.
If an option requires an argument, you must specify the argument when using the option. For
example, if you specify qsub -j but do not specify y|n, any options following -j will cause an
error. The qsub utility accepts the following options:
-A account -- Defines an account string to use. The account can be an arbitrary string of
unlimited length.
-a time -- Does not run the batch request until the specified date-time parameter (on page 134).
If a date-time specification is composed of two or more words, the date-time specification must
be in double quotes as in: "-a July, 4, 2026 12:31".
-C directive_prefix -- Defines the string of characters used to identify qsub options that appear
on the first line of a shell script. The default is the value of the environment variable
POSIX2_PBS_DPREFIX. If this variable is not defined, then the character string "#@$" is be the
default.
-e file -- Saves stderr into file. A remote file name may be specified, as described in Name
Syntax (on page 131). If a local file is specified without a full pathname, the current working
directory is used. The default stderr file name is "jobname.e." This name may be truncated due
to file system limitations. If the filename for stderr is invalid, the file is placed into the current
user's home directory on the execution computer.
-eo -- Writes stderr to stdout.
135
valid ranges
will be run at
IDLE
10 ...20
20
NORMAL
0...9
HIGH
-1...-10
-10
REALTIME
-11...-20
-20
A REALTIME process preempts all other processes, including the operating system.
Intergraph recommends that you avoid using the REALTIME priority.
If a job is submitted with a run priority that does not match the run priority of the queue to
which it is submitted, the submission fails and qsub will return an error.
-M mail_list -- Defines a list of addresses to which mail is sent, where mail_list is a list of mail
addresses, separated by semi-colons. Supported mail addresses are SMTP format(user@host)
and messages via the event log (\\host). If no mailing address is specified, the default mail
address is the Universal Naming Convention (UNC) name of the local host (\\local_host).
Because of Windows's built-in security, messages will be placed in the event log of the batch
server where the job executed.
-m mailoptions -- Defines when or if mail should be sent about the submitted job. Mailoptions
may include any of the following:
b -- Sends mail when the job begins (same as -mb).
e -- Sends mail when the job ends (same as -me).
a -- Sends mail if the job is aborted (same as -ma). This is the default.
n -- Sends no mail
-mb -- Sends mail when the job begins (same as -m b).
-me -- Sends mail when the job ends (same as -m e).
136
137
qdel Interface
The qdel utility accepts as arguments a list of job identifiers representing jobs to delete or kill. A
job identifier may contain a server name in the form \\server\job-id. The identifier instructs qdel
to direct the delete job request to the specified host.
If the -k option is not given, and the job is running, qdel informs you that the job is running and
does not delete it. The return value indicates the success or failure of the delete request. A
message is also printed for each job, informing you if it was deleted.
The qdel utility accepts the following options:
138
Option
Purpose
-k
-u user
qstat Interface
The qstat utility accepts as argument a list of queues. You may reference queue names and job
identifiers on remote servers. The qstat utility also accepts a hostname, and displays all of the
queues for that host.
The qstat utility displays information about each specified queue, including each job. If you
invoke qstat with no arguments, the utility displays all batch and pipe queues on the local server.
By default, qstat displays both queue and job information in short format.
The return value for qstat indicates the success or failure of the qstat request.
The qstat utility accepts the following options:
Option
Purpose
-b
-p
-a
Displays the status of all jobs, even if you do not own them.
-r
-u username
139
qmgr Interface
The qmgr utility accepts no arguments. Instead, it accepts a series of commands that it
processes interactively. The utility also accepts input from stdin if no console exists. Most of the
commands' arguments can be local or remote. The syntax for the arguments is described in
Name Syntax (on page 131). Exceptions are noted in the command descriptions.
The qmgr utility returns a message to the user after each line of input indicating the success or
failure of the command. The return value will not be set when qmgr exits.
The qmgr utility provides the following commands:
Abort queue (on page 141)
Add destination (on page 141)
Add groups (on page 141)
Add managers (on page 141)
Add shell-name (see "Add shell_name" on page 142)
Add users (on page 142)
Create pipe-queue (see "Create pipe_queue" on page 142)
Create batch-queue (see "Create batch_queue" on page 142)
Delete destination (on page 142)
Delete groups (on page 143)
Delete managers (on page 143)
Delete queue (on page 143)
Delete request (on page 143)
Delete shell-name (see "Delete shell_name" on page 143)
Delete users (on page 144)
Disable queue (on page 144)
Enable queue (on page 144)
Exit (on page 144)
Help (on page 144)
Hold (on page 144)
Modify request (on page 144)
Move request (on page 145)
Purge queue (on page 145)
Quit (on page 145)
Release (on page 145)
Restart queue (on page 145)
Set debug (on page 145)
140
Abort queue
abort queue queue
Kills all of the running jobs associated with a queue. Jobs are not restarted.
Operator or manager privileges are required to use this command.
Add destination
add destination = dest-name queue
add destination = (dest-name [,dest-name...]) queue
Adds a single destination or several destinations to the existing destination set for a pipe queue.
Manager privileges are required to use this command.
Add groups
add groups = group queue
add groups = (group [,group...]) queue
Adds an entire group (or several groups) to the existing list of those users allowed to access a
queue. Note that you may not add a group when queue access is unrestricted.
Manager privileges are required to use this command.
Add managers
add managers user:{m,o} ... [server]
add managers group:{m,o} ... [server]
141
Indicates that the specified account will be granted Batch manager privileges.
:o
Add shell_name
add shell_name = shell-name:shell-path queue (on page 131)
add shell_name = (shell-name:shell-path [,shell-name:shell-path..]) queue
Adds a shell (or several shells) to the list of shells available for use on a queue.
Manager privileges are required to use this command.
Add users
add users = user queue
add users = (user [,user...]) queue
Adds a user (or several users) to the list of users allowed to access the named queue. You may
not add a user when queue access is unrestricted.
Manager privileges are required to use this command.
Create pipe_queue
create pipe_queue queue priority = queue-priority [ destination =dest-name ] [ run_limit =
run-limit ]
create pipe_queue queue priority = queue-priority [destination = (dest-name [,dest-name...])]
[run_limit = run-limit]
Defines a new Batch pipe queue. A set of destination queues can be assigned to the pipe queue
using the destination= parameter. The queue is created in a disabled and stopped state, and
must be explicitly enabled and started. If a pipe queue has no destinations, it will act as though it
is stopped. This will occur even if the outflow state of the queue is "STARTED."
Manager privileges are required to use this command.
Create batch_queue
create batch_queue queue priority =queue-priority [run_limit = runlimit]
Defines a new Batch request queue. The queue is created in a disabled and stopped state, and
must be explicitly enabled and started.
Manager privileges are required to use this command.
Delete destination
delete destination = dest-name queue
142
Delete groups
delete groups = group queue
delete groups = (group [,group...]) queue
Deletes an entire group (or several groups) from the list of those allowed access to the named
queue.
Manager privileges are required to use this command.
Delete managers
delete managers user:{m,o} ... [server]
delete managers group:{m,o} ... [server]
Removes manager and/or operator privileges from the specified user(s) or group(s). The
Administrators group cannot be removed.
You can delete managers and operators on the same line. You can also delete multiple users,
groups, or a combination of users and groups, at the same time.
You must use one of the following suffixes at the end of each account:
:m
:o
Delete queue
delete queue queue
Deletes the named queue. To delete a queue, no requests can be present in the queue and the
queue must be disabled and stopped.
Manager privileges are required to use this command.
Delete request
delete request job-id...
Deletes a request from a queue. If the specified request is running, sending the request signal
terminates it. If the request is not running, it is simply removed from its containing queue and
discarded.
Jobs may be deleted by the job owner or by a user with operator or manager privileges.
Delete shell_name
delete shell_name = shell-name[:shell-path] queue
delete shell_name = (shell-name[:shell-path] [,shell-name[:shell-path]...]) queue
143
Delete users
delete users = user queue
delete users = (user [,user...]) queue
Deletes a user (or several users) from the list of those allowed to access the named queue.
Manager privileges are required to use this command.
Disable queue
disable queue queue
Prevents any more requests from being placed in the named queue.
Operator or manager privileges are required to use this command.
Enable queue
enable queue queue
Enables the specified queue. This means that the queue will be able to accept new requests.
Operator or manager privileges are required to use this command.
Exit
exit
Exits from the qmgr program. The qmgr program is also exited if an end-of-file is encountered
from the standard input file.
Help
help [command]
Displays a page of text about the specified qmgr command or subcommand.
Hold
hold job-id ...
Puts a queued request into the operator hold state.
Operator or manager privileges are required to use this command.
Modify request
modify request job-id [ priority = priority-value ] [ nice_limit = nice-value ]
Modifies the parameters of a request that is already in its final destination queue, but has not
started yet. Jobs may be modified by the job owner or by an user with operator or manager
privileges.
144
Move request
move request job-id queue
Moves the specified request from the queue it is currently in to the specified queue. The source
queue (the queue that the job currently resides in) and the destination queue must both be on
the same computer.
Jobs may be moved by the job owner or by an user with operator or manager privileges.
Purge queue
purge queue queue
Causes all requests that are not running to be purged (deleted) from the named queue.
Operator or manager privileges are required to use this command.
Quit
quit
Exits from the qmgr program. The qmgr program is also exited if an end-of-file is encountered in
the standard input file.
Release
release job-id ...
Releases the specified request from any held or waiting states, and places the request into the
queued state ready to run. The release command removes a request from a user and/or
operator hold, if possible.
If the user owns the job, then any user hold will be released. If the user has operator or manager
privileges, then all holds on the job will be released.
Restart queue
restart queue queue
Kills all running jobs in the named queue, and then immediately reschedules the requests for
execution. Only jobs marked as "restartable" will be rescheduled.
Operator or manager privileges are required to use this command.
Set debug
set debug debug-level [server]
Allows a Batch manager to enable or disable Batch debugging (or auditing) output. Manager
privileges are required to use this command.
This command accepts the following values:
Debug Level
Logging Type
No Logging
Server Logging
Meaning
145
Level 1 plus:
Queue Logging
Job Logging
Levels 2 plus:
Job Error Logging
Server Debugging
Queue Debugging
Job Debugging
Level 3 plus:
Pipe Debugging
Packet Debugging
Other Debugging
Set destination
set destination = dest-name queue
set destination = (dest-name [,dest-name...]) queue
146
Set managers
set managers user:{m,o} ... [server]
set managers group:{m,o} ... [server]
Removes manager and operator privileges from existing Batch managers and operators (except
the Administrators group). These privileges are then reassigned to the specified user(s) or
group(s).
You must use one of the following suffixes at the end of each account:
:m
Indicates that the specified account will be granted Batch manager privileges.
:o
Set nice_value_limit
set nice_value_limit = nice-value queue
Sets the default per-process run time priority for the specified queue.
Manager privileges are required to use this command.
Set no_access
set no_access queue
Deletes all groups and users from the access list for the specified queue.
Manager privileges are required to use this command.
147
Set priority
set priority = queue-priority queue
Changes the priority of a queue, where priority is in the range [0-64]. This command is used only
by Intergraph NQS.
Manager privileges are required to use this command.
Set runlimit
set run_limit = run-limit queue
Changes the run-limit of a batch or pipe queue.
Operator or manager privileges are required to use this command.
Set shell_name
set shell_name =shell-name:shell-path queue
set shell_name = (shell-name:shell-path [,shell-name:shell-path...]) queue
Removes any shells from the named queue's list and replaces them with the specified list of
shells.
Manager privileges are required to use this command.
Set unrestricted_access
set unrestricted_access queue
Grants all users access to the named queue.
Manager privileges are required to use this command.
Show all
show all [server]
Displays general status information on all of the Batch limits supported, managers, queues, and
the general operating parameters for the specified Batch server. If no server is specified, then
information about the local serer is shown.
148
Show managers
show managers [server]
Displays a list of the users that have either Operator or Manager privileges on the specified
server. If no server is specified, then the information shown applies to the local server.
Show parameters
show parameters [server]
Displays the current values for the general Batch operating parameters on the specified server.
Show queue
show queue [queue [ user ] ]
Displays status information about the specified Batch queue in a short format. If no queue name
is specified, then status information is displayed for all local Batch queues. If a queue name is
specified, then specific status information for the named queue is displayed. If a user name is
specified, then the requests shown will be limited to those belonging to that user.
Shutdown
shutdown [ grace-period ]
Shuts down the Batch Queuing System on the local supporting host. For each queue that is
running, the equivalent of the Abort Queue command is performed, except that all requests
terminated as a result of the shutdown command are requeued for later execution.
If grace-period is not specified, then a default value of twenty (20) seconds is used.
The Batch service on Windows cannot be restarted using qmgr. To restart batch service, either
restart the system, or restart the batch server (BATSERV.EXE) through the Control Panel icon
in Program Manager.
Operator or manager privileges are required to use this command.
Start queue
start queue queue
Starts the named queue. Any requests in the named queue become eligible for execution.
Operator or manager privileges are required to use this command.
Stop queue
stop queue queue
Stops the named queue. Any requests in the queue that are currently running are allowed to
complete execution. All other requests eligible for execution in the queue are prevented from
running.
Operator or manager privileges are required to use this command.
Unhold
unhold job-id ...
149
150
setpasswd.exe Utility
APPENDIX A
setpasswd.exe Utility
A command line utility, ..\Win32app\Ingr\BATCH\bin\setpasswd.exe, is available to change
Account Mapping passwords on remote computers (provided write access to remote registry is
available). Using this utility, an adiministrator can change the passwords on all client computers
from a single computer.
The command line syntax is:
setpasswd.exe servername domain account [password]
Where:
servername is the name of the remote computer
domain is the user domain name
account is the user name
password is the user name's password. The password as a command line argument is optional.
If you do not specify the password, the utility will prompt you to type and then confirm the
password. The password is invisible while typing it this way.
Error messages:
"ERROR: Access is denied." - No write permissions to remote registry.
"ERROR: The network path was not found." - A remote computer with the supplied
servername cannot be found.
"ERROR: No mapping between account names and security IDs was done. - Incorrect
domain and/or account names supplied.
"ERROR: The system cannot find the file specified." - No account mapping exists for the
supplied user.
"ERROR:Overlapped I/O operation is in progress" - When you see this error, check all the
above cases.
If the remote computer is running Windows Vista, members of the Administrators group
do not get privileges to the registry by default. Contact Intergraph support for assistance.
151
setpasswd.exe Utility
152
APPENDIX B
Troubleshooting
This section provides tips and information for answering common questions and solving
common problems with Batch Services.
Basics of Batch Services
Understanding batch queues and pipe queues (on page 154)
Understanding queue states and job states (on page 154)
Job Status Notification
Receiving mail notification (on page 155)
Obtaining information about failures (on page 155)
File Staging
Sending and Receiving Files (on page 155)
Security
Submitting jobs to remote nodes (on page 156)
Resource Usage
Controlling queue usage (on page 156)
Aborting running jobs (on page 156)
More Problem Solving Ideas
Setting up a shell (on page 157)
Power failures (on page 157)
SMTP mail (on page 157)
In This Appendix
Customer Support....................................................................... 153
Basics of Batch Services............................................................. 154
Job Status Notification ................................................................ 155
File Staging ................................................................................ 155
Security ...................................................................................... 156
Resource Usage ......................................................................... 156
Frequently Asked Questions ....................................................... 157
Customer Support
Intergraph Process, Power & Marine provides complimentary software support for 30 days. At
the end of the 30-day complimentary support period, you should take advantage of Intergraph
Process, Power & Marine's purchasable support plans. For more information or to purchase a
support plan, call 1-800-766-7701 (in the United States), or contact your local Intergraph
subsidiary or distributor (at international locations).
See the following topics for more information on the various avenues of customer support:
1. Telephone Support (on page 154)
2. Our Web Site (on page 154)
153
Troubleshooting
Telephone Support
If you experience problems with your software, or have questions about the information in this
document, you can contact Intergraph Process and Building Solutions for help.
1. In the United States, call 1-800-766-7701.
2. At international locations, contact the Intergraph subsidiary or distributor from which you
purchased your Intergraph system or software.
Have the following information readily available when you call:
1. Your name and telephone number.
2. The product's name.
3. A brief description of the question or problem.
Information on telephone support is also available on our web site: http://www.intergraph.com.
Web Site
You can find Intergraph on the Internet at http://www.intergraph.com.
Intergraph Directory
If you are outside the United States, contact the subsidiary or distributor from which you
purchased your software.
General Information
1-256-730-2000
Internet
http://www.intergraph.com
Mailing Address
Intergraph Corporation
Process, Power & Marine
300 Intergraph Way
Madison, Alabama 35758 USA
154
Troubleshooting
will run the jobs that are already queued. When queues are created, they are both disabled and
stopped. You must enable and start a queue before you can submit and run jobs in it.
Question: I do not understand the job states "WAITING," "TRANSITING," "QUEUED," or
"RECURRING."
Answer:
QUEUED: A job that has been accepted into the queue, but is not being
processed by the queue yet.
TRANSITING: A job that is being routed from a pipe queue to a destination queue.
WAITING: A job that has been accepted into the queue, but is waiting on an event
before it can be executed. The most common reason for a job to be in the WAITING state is that
a future start time for the job was specified.
RECURRING: Jobs scheduled to run more than once are called recurring jobs. When a
recurring job is not running, it stays in the RECURRING state until its next occurrence.
File Staging
Sending and Receiving Files
Problem: Some of my jobs produce extra output files that I would like to have delivered to my
computer after the job has run. Some jobs also require data files as input.
Solution: You can use the File Staging (see "Job Submit: File Staging" on page 63) menu to tell
the batch server which files you would like to have delivered back to your computer (or to the
location of your choice) after your job completes and which files you would like to have delivered
155
Troubleshooting
to the execution computer for use by your job. When staging files (see "File Staging" on page
15) between Batch servers, be sure to use full path names for source and destination.
Problem: I submitted my job via Batch Manager and did not specify where the job's standard
error and standard output files should be placed. I can't find them now.
Solution: By default the error and output files from your job will be returned to your computer in
the submission directory. If your job produces additional files which you would also like to have
returned, use the File Staging Property Page (see "Job Submit: File Staging" on page 63) in the
Job Submit dialog to tell Batch Services which output files you are interested in. See File
Staging (on page 15) for more information.
When using the Batch Manger, the submission directory starts off as the product
directory. You may change this by modifying the current directory in the Batch Manager's icon. If
you browse for your script, the submission directory becomes the directory where the script file
is located. This is where output and error files will go by default.
If you look in the appropriate directory and do not find the error and output files from your job,
there may be a problem with the account mapping between the submission computer and the
execution computer. Check to be sure the account your job is running as on the remote
computer is able to write files on your local computer. If this situation occurs, the output files will
be on the execution computer in the directory where the job executed.
Security
Submitting jobs to remote nodes
Problem: Whenever I submit a batch job to a remote node, it is deleted by Batch Services and I
get some message about impersonation tokens.
Solution: This could mean that the password for the user you are impersonating on the
execution computer was entered incorrectly into the Server Account Mapping (see "Server
Properties: Security Tab" on page 75) dialog, that the password has expired, or that the user
does not have "log on locally" access. You can check the "log on locally" access via the User
Manager
Resource Usage
Controlling queue usage
Problem: I have a backlog of scripts in my queues and extra processing power.
Solution: Check the run-limit on your queues. The run-limit is the maximum number of running
(or transferring) jobs. The default (and minimum) value is 1. The maximum value is 60.
Problem: I do not understand what the queue processor affinity settings are used for.
Solution: If the computer on which the queue resides is a multiprocessor computer, the
selections tell the queue which processors should run jobs for the queue. These controls are
useful only on a multi-processor computer. If the queue for which you select processors is a
single processor computer, the processor check-boxes will be cleared and setting them will have
no effect.
156
Troubleshooting
Solution: The Windows operating system does not support the concept of a process group.
Therefore, aborting a running job only terminates the script that was submitted. Any processes
started by the script will not be killed.
Power failures
Question: A power failure occurred. What happened to my job?
Answer:
If your job is in a queue at the time of the power failure, it will be submitted when
the power returns. If your job is executing when the power failure occurs, it will be re-queued
and restarted when the computer comes back up.
SMTP mail
Question: What port is used?
Answer: Batch Services uses TCP port 25 to establish a connection with the SMTP host.
Question: What identity is used to connect to the email server?
Answer: No account is used to establish connection, but mail is delivered to user@hostname as
selected from the Address Book.
Question: What security measures are in place to prevent abuse of this feature (namely
SPAM)?
Answer: Security should be performed on the SMTP server side.
157
Troubleshooting
158
Glossary
A
account mapping
The process of determining the account name to use when running jobs. Batch Services
requires an account name and password to use when running jobs. To perform account
mapping, the server tries to match the job owner with an account mapping entry.
B
batch job
A batch job is the full set of instructions to Batch Services to perform a given task or set of tasks
on a computer system. The job itself is identified with a script, or a file that can be interpreted by
some program to perform a set of instructions. An example of a script is a .BAT file, which is
interpreted by the CMD.EXE program.
A unique job identifier or jobid identifies each job. No two jobs will have the same jobid. See also
job and shell.
batch queue
A batch queue accepts requests to execute scripts or commands from the keyboard as if the
user submitting the request were logged in to the system. Jobs are executed in a batch queue.
The resulting output returns to the directory from which the original requestor submitted the job.
You can request the output to remain on the executing node or return to a remote node.
Batch queues can also have a list of shells associated with them, allowing an administrator to
configure a queue to run certain types of scripts. For example, a batch queue may be set up to
run scripts for the Perl program. See also queue.
batch server
A Windows service that processes batch jobs, and maintains queue and job information. A
Batch Server is also the system on which Batch Services runs. The Intergraph Batch Server is a
system service that may be controlled using the Services icon on the Control Panel.
D
default queue
The queue to which a job is assigned when a user does not specify a queue.
default shell
The shell that is used to run a job submitted to a queue when a user does not specify a shell for
that job.
159
Glossary
disabled
A queue state in which the queue will not accept new jobs.
E
enabled
A queue state in which the queue will accept new jobs.
execution host
The computer where a batch job is run.
execution priority
The run time priority indicates the priority of a job when it is run. This value is also known as the
"nice value" in the qmgr interface. Valid execution priority values are:
IDLE
NORMAL
HIGH
REALTIME
A REALTIME process preempts all other processes, including the operating system.
Intergraph recommends that you avoid using the REALTIME priority.
H
hold
A delay in running a job submitted to a queue. A held job will not run until the hold is released, or
the job is deleted from the queue.
A user hold may be placed on a job submitted by that user when the job is submitted. A user
hold can be released either by the submitting user, or by a user with operator or manager
privileges on the server.
A user with operator or manager privileges may place an operator hold on a job, after the job is
submitted but before it runs. Only a user with operator or manager privileges can release an
operator hold.
When a job is being held, the job will remain in the queue until it is deleted or released. It will not
run while the hold is in place. See also privilege.
I
inflow state
The state of a queue with regard to accepting jobs. See also queue state, enable, disable.
160
Glossary
J
job
A set of instructions needed to perform a given task or set of tasks on a computer system. See
also batch job and shell.
M
manager
See privilege.
O
operator
See privilege.
outflow state
The state of a queue with regard to processing jobs. See also queue state, started, stopped.
P
per-process file size limit
The file size limit indicates the maximum total file size used by a request. This value is not used
in Windows.
pipe queue
A pipe queue routes requests to another queue. Pipe queues can accept either a batch request,
or a request from another pipe queue. A pipe queue receives the request and sends it to the first
available queue in its destination list that will accept the request. The destination list may contain
any queue type. Pipe queues are normally used to create a connection to a remote batch
queue.
privilege
An operational permission level assigned to every Batch Services user. Non-privileged users
can submit jobs to queues to which they have been granted access; operators can issue
commands that directly affect queue management; and managers can control all aspects of
Batch Service operation.
161
Glossary
Q
queue
A queue is a waiting line in which job requests reside until they are processed. A queue can
control the number of jobs submitted to it, the number of simultaneous jobs, and the execution
priority of those jobs. A queue can also restrict the users and groups that have access to it. The
batch system supports batch queue and pipe queue.
queue state
A queue has two states: the inflow state and the outflow state.
Inflow State - The inflow state is either enabled or disabled. An enabled queue will accept new
jobs that are submitted or transferred to it; a disabled queue will not.
Outflow State - The outflow state is either stopped, started, or stopping. A stopped queue will
not run the jobs it contains. A queue must be started in order to run jobs.
Example
An "enabled/stopped queue" is a queue that will accept jobs but not run them.
See also enabled, disabled, started, stopped.
queue view
The view in Batch Manager that shows information on the jobs in a queue.
R
recurring jobs
Jobs scheduled to run more than once at a regular interval. Use the Job Submit\Scheduling tab
in Batch Manager to submit recurring jobs. Hourly, daily, weekly, monthly, and yearly intervals
are available.
S
scheduling priority
The scheduling priority, or "intra-queue priority," is used for scheduling the order of job execution
within the queue. The priority value must be in the range of [-1024..1023].
script
A file that contains instructions for the execution of a batch job.
server view
The view in Batch Manager that shows information about the operation of one or more queues.
162
Glossary
shell
An executable program that can be used to run a script. For example, cmd.exe is a shell that
can be used to run .bat scripts. See also script.
spooling
The process of storing a file internally by Batch Services until a batch job ends, and then
returning the files to the intended directories. Spooling is not supported on remote computers.
started
A queue state in which the queue will run jobs submitted to it.
stopped
A queue state in which the queue will not run jobs submitted to it.
163
Glossary
164
Index
A
Abort command (Queue Menu) 72
Abort queue 141
aborting a queue 27
Aborting all jobs 32
aborting jobs 32
Aborting running jobs 156
About Batch command (Help Menu) 76
Access 24
Accessing a remote server 42
Accessing a Remote Server 42
Accessing Other Nodes 13
account mapping 159
Account Mapping 73
Account Mapping Command (Server Menu)
73
Account Mapping Dialog 73
Account Mapping Overview 14
Add destination 141
Add groups 141
Add managers 141
Add shell_name 142
Add shell-name 142
Add users 142
Add Users and Groups dialog 74
Add Users and Groups Dialog Box 74
Adding and Deleting Batch Queue Shell
Lists 27
Adding and deleting destinations 29
Adding and Deleting Pipe Queue
Destinations 29
Adding and deleting shell lists 27
Adding shell lists 27
API Description 79
API Error Codes 126
API structures 81
B
Basics of Batch Services 154
Batch API Error codes 126
Batch API function calls 93
Batch API Function Calls 93
Batch API Structures 81
Batch Client API 79
Batch Client API interface 80
Batch Client API Set 14
batch job 31, 37, 159
165
Index
Batch-Specific Error Conditions 126
BatchStartQueue 120
BatchStopQueue 121
C
Changing security 24
Command Line Interface 131
Configuring SMTP Mail 45
Configuring SMTP mail notification 45
Configuring the batch server 42
Configuring the Batch Server 42
Connect to command (Queue Menu) 65
Connect To Command (Server Menu) 72
Connect to Queue 65
Connect to Server Dialog 72
Connecting to a queue 21
Connecting to a Queue 21
Contents command (Help Menu) 76
Context Sensitive Help Button 76
Controlling queue usage 156
Create batch_queue 142
Create batch-queue 142
Create command (Queue Menu) 65
Create pipe_queue 142
Create pipe-queue 142
Create Queue 65
Destinations 68
General 66
Job Defaults 67
Scheduling 66
Security 67
Shells 67
Create Queue Destinations 68
Create Queue General 66
Create Queue Scheduling 66
Create Queue Shells 67
Creating a queue 21
Creating a Queue 21
Customer Directory 154
customer support 154
Customer Support 153
D
date-time parameter 134
Debug Level 133
default queue 159
Default Queue 159
default shell 159
Default Shell 159
Default Values for QueueBatchJob 124
delete batch job 31
Delete command (Job Menu) 59
166
E
Enable command (Queue Menu) 71
Enable queue 144
enabled 160
Enabling a queue 23
Enabling/Disabling a Queue 23
execution host 160
execution priority 160
Exit 144
Exit command (Job Menu) 55
F
File staging 15, 32, 33
File Staging 15, 155
Staging Files In 32
Staging Files Out 33
File Staging Example 16
files 32, 33
Frequently Asked Questions 157
G
General 69
getting job status 33
Getting job status information 33
Index
Getting Started 13
Granting jobs access to the desktop 43
Granting Jobs Access to the Desktop 43
Group 132
H
Handling Batch Job Output Files 34
Handling output files 34
Handling Queue Security 24
Help 144
Help Menu 53, 76
hold 160
Hold 144, 160
Holding a batch job 37
I
Inbound Staging 16
Inflow 162
inflow state 160
Input Methods 54
Intergraph Directory 154
J
job 161
Job ID 161
job identifier (job ID) 161
Job Menu 52, 55
Job Properties
Advanced 59
File Staging 58
General 56
Notification 57
Output 59
Resources 57
Scheduling 56
Job Properties Dialog Box 55
Job Properties General 56
Job Properties Output 59
Job Property Dialog 55
Job Status Notification 155
Job Submit 60
Advanced 63
File Staging 63
General 61
Notification 62
Output 63
Resources 62
Scheduling 61
Job Submit File Staging 63
Job Submit General 61
Job Submit Notification 62
M
manager 161
Manager 14
Managing Batch Services 139
Managing the Batch Manager Display 50
Mapping One Server to Another 48
Mapping to Other Computers 48
Modify request 144
Modifying a batch job 36
Modifying a Batch Job after Submission
36
Modifying queue parameters 25
Modifying Queue Parameters 25
Move command (Job Menu) 60
Move Job Dialog 60
Move Job Dialog Box 60
Move request 144
Moving a batch job 37
Moving a Batch Job 37
N
Name Syntax 131
Named Jobs 17
Naming Restrictions 18
Nice-value 133
O
Obtaining information about failures 155
Obtaining Job and Queue Status 139
operator 161
Operator 14
Operator Hold and Release commands
(Job Menu) 59
Outbound Staging 17
Outflow 162
outflow state 161
Output files 34
Overview 51
P
Pausing a batch job 37
Pausing/Holding a Batch Job 37
per-process file size limit 161
pipe queue 161
Pipe Queues 161
Power failures 157
Priority-value 133
167
Index
privilege 161
Privilege 161
Properties command (Job Menu) 55
Properties command (Queue Menu) 68
Properties Command (Server Menu) 74
Purge command (Queue Menu) 72
Purge queue 144
Q
qdel
An Overview 138
Qdel 138
qdel Interface 138
Qdel interface 138
qmgr
An Overview 139
Qmgr 139
qmgr Interface 140
Qmgr interface 140
qstat
An Overview 139
Qstat 139
qstat Interface 139
Qstat interface 139
qsub
An Overview 135
Qsub 135
qsub Interface 135
Qsub interface 135
queue 22, 32, 162
Queue 131
Queue Menu 52, 64
Queue Properties
Destinations 71
General 69
Job Defaults 69
Scheduling 69
Security 70
Shells 70
Queue Properties Dialog Box 68
Queue Properties General 69
Queue Properties Job Defaults 69
Queue Properties Scheduling 69
Queue Security 24
queue state 162
Queue States 162
Queue States and Job States 154
queue view 162
Queue View 53, 162
QueueBatchJob 122
Quit 145
168
R
Receiving mail notification 155
recurring jobs 162
Recurring Jobs 162
Refresh command (View Menu) 76
Release 145
Releasing a Batch Job 38
Removing the batch service 43
Removing the Batch Service 43
Required Calling Privileges 128
Resource Usage 156
Restart queue 145
Restarting a batch job 38
Restarting a Batch Job 38
Restricting access 24
Run Now (Job Menu) 60
Runlimit 133
S
Sample Scripts 77
Saving and restoring named batch jobs 39
Saving and Restoring Named Batch Jobs
39
scheduling priority 162
script 162
Script Browser 76
Script Examples 77
Security 156
Sending and Receiving Files 155
Server 132
Server Menu 52, 72
Server Properties
General Tab 74
Security 75
Security Tab 75
Server Properties Dialog Box 74
Server Property Dialog 74
server view 162
Server View 53, 162
Set debug 145
Set default batch request priority 146
Set default batch request queue 146
Set default batch_request queue 146
Set default shell 146
Set destination 146
Set managers 146
Set nice_value_limit 147
Set nice-value limit 147
Set no access 147
Set no default batch request 147
Set no default batch request queue 147
Set no default shell 147
Index
Set no_access 147
Set per_process permfile_limit 147
Set per-process permfile limit 147
Set priority 147
Set runlimit 147
Set shell_name 148
Set shell-name 148
Set unrestricted access 148
Set unrestricted_access 148
setpasswd.exe Utility 151
Setting batch server logging level 44
Setting Batch Server Logging Level (Debug
Level) 44
Setting debug level 44
Setting server managers 44
Setting Server Managers and Operators
44
Setting server operators 44
Setting the default queue 30
Setting the Default Queue 30
Setting the default shell 28
Setting the Default Shell 28
Setting up a shell 157
shell 163
Shell 163
Shell-name 132
Shell-path 134
Show all 148
Show limits supported 148
Show long queue 148
Show managers 148
Show parameters 148
Show queue 149
Shutdown 149
Shutting down the batch server 47
Shutting Down the Batch Server 47
SMTP mail 157
spooling 163
Spooling 163
Staging files in 32
Staging files out 33
Start command (Queue Menu) 71
Start queue 149
started 163
Starting a queue 26
Starting the batch server 47
Starting the Batch Server 47
Starting/Stopping a Queue 26
status 22, 33
Status Bar 54
Status Bar command (View Menu) 75
stderr 163
stdin 163
T
Task Reference 19
telephone support 154
Telephone Support 154
Toolbar 52
Toolbar command (View Menu) 75
Troubleshooting 153
U
Understanding batch queues and pipe
queues 154
Understanding queue states and job states
154
Unhold 149
User 132
User Hold and Release commands (Job
Menu) 60
Using a default mail address 47
Using a Default Mail Address 47
Using Help command (Help Menu) 76
Using Recurring Jobs 40
V
View Menu 52, 75
Viewing job notification messages 47
W
web site 154
Web Site 154
What's New in Batch Services 9
Win32 Error Codes 128
Window 50
Working with Account Mapping 48
Working with Batch Jobs 31
Working with Batch Manager Display 49
Working with Batch Queues 27
169
Index
Working with Batch Servers 41
Working with Batch Services 19
Working with Pipe Queues 29
Working with Queues 20
170