Argent Scheduler
Argent Scheduler
Users Guide
United States and Canada Europe, Middle East and Africa Asia Australia and New Zealand
860 674 1700 44 207 959 3200 852 2330 0310 61 3 9863 8220
www.Argent.com
Trademarks
Argent Console is a trademark of ArgSoft Intellectual Property Holdings, Limited. Argent Data Consolidator is a trademark of ArgSoft Intellectual Property Holdings, Limited. Argent Dashboard is a trademark of ArgSoft Intellectual Property Holdings, Limited. Argent Defender is a trademark of ArgSoft Intellectual Property Holdings, Limited. Argent Exchange Monitor is a trademark of ArgSoft Intellectual Property Holdings, Limited. Argent Guardian is a registered trademark of ArgSoft Intellectual Property Holdings, Limited. Argent Predictor is a registered trademark of ArgSoft Intellectual Property Holdings, Limited. Argent Sentry is a trademark of ArgSoft Intellectual Property Holdings, Limited. Argent SQL Server Monitor is a trademark of ArgSoft Intellectual Property Holdings, Limited. Argent SuperMaps is a trademark of ArgSoft Intellectual Property Holdings, Limited. Argent SuperLinks is a trademark of ArgSoft Intellectual Property Holdings, Limited. Argent Total Support Interface is a trademark of ArgSoft Intellectual Property Holdings, Limited.
Contents
About This Document i Conventions ....................................................................................................i Worldwide Technical Support Chapter 1: Basic Concepts 1 2
In This Chapter.............................................................................................. 2 Using Argent Job Scheduler Screens ............................................................ 3 Toolbar Buttons ................................................................................. 3 Figure 2.1: Standard Toolbar......................................................................... 3 Managing The Argent Job Scheduler Scheduling Service ............................. 5 How To Access.................................................................................. 5 Service Management Window ........................................................... 6 Argent Job Scheduler Service Management Options ......................... 6 Argent Job Scheduler Log Window Options....................................... 7 Components of A Batch Job .............................................................. 8 Types of Alerts................................................................................... 8 What Are Macros? ............................................................................. 8 Chapter 2: Scheduling Jobs 9
How To Access ............................................................................................. 9 In This Chapter.............................................................................................. 9 Using Job Masks ......................................................................................... 11 Summary Summarize Argent Job Scheduler Job Activity.............. 11 Date Masks...................................................................................... 11 Using the Date/Time Format ............................................................ 11 Types Of Job Masks ........................................................................ 12 Scheduler Colors ............................................................................. 12 Description of Job Details Columns ............................................................. 13 Popup Menu Options ....................................................................... 14 How To Access ........................................................................................... 16 In This Chapter............................................................................................ 16 Connect To Argent Queue Engine (W200X/NT) .......................................... 17 Connecting To A Server Running W200X/NT Argent Queue Engine ............................................................................................. 17 Connecting To A Remote Server Running W200X/NT Queue Engine ............................................................................................. 18 Argent Queue Engine Properties................................................................. 22 General Info..................................................................................... 23 Startup Jobs .................................................................................... 23 Permissions ..................................................................................... 23 Queue Engine Properties ............................................................................ 24 Queue Status................................................................................... 24 Queue Priority.................................................................................. 24
Contents 4
Max Pending Jobs ........................................................................... 25 Max Executing Jobs......................................................................... 25 Automatically Starting and Stopping Queues ................................... 25 Retain Jobs...................................................................................... 25 Queue Description ........................................................................... 25 Popup Menu Options................................................................................... 26 Queue Options Windows............................................................................. 27 The Queue Property Tab ................................................................. 27 Queue Permission Tab .................................................................... 29 Queue CPU Affinities Tab ................................................................ 29 Argent Queue Engine Main GUI .................................................................. 30 Queue Engine Commands .......................................................................... 31 Queue Engine Security................................................................................ 32 Chapter 4: Argent Queue Engine for UNIX 33
Connect To UNIX Queue Engine................................................................. 34 General Info..................................................................................... 37 Queue Properties............................................................................. 38 Priority ............................................................................................. 39 Status .............................................................................................. 39 Pending Jobs Limit .......................................................................... 39 Executing Jobs Limit ........................................................................ 39 Automatic Starting and Stopping of Queues .................................... 39 Queue Permissions.......................................................................... 40 CPU Affinity ..................................................................................... 41 Jobs in Queue Engines.................................................................... 41 UNIX Queue Engine Security ...................................................................... 42 Chapter 5: Argent iSeries Job Adapter 43
Connect To Argent iSeries Job Adapter ...................................................... 44 General Info ................................................................................................ 47 Queue Properties ........................................................................................ 48 Status .............................................................................................. 48 iSeries Jobs ..................................................................................... 49 Submitting Jobs ............................................................................... 49 How the Job Scheduler Adapter Executes Jobs............................... 49 Job Log Files ................................................................................... 49 Job Scheduler Adapter Security .................................................................. 50 Chapter 6: Integrate With SAP System 51
How to Access............................................................................................. 54 Argent SuperMap Define ............................................................................. 55 Argent SuperMaps define window, Screen ID J15B. ................................... 55 Delete.......................................................................................................... 56 Delete.......................................................................................................... 57 Location Setting window, Screen ID J15C. .................................................. 57
Contents 5
59
How to Access............................................................................................. 59 In This Chapter............................................................................................ 59 Creating a Job Class ................................................................................... 60 Creating a Job Template ............................................................................. 62 List Of Job Definitions ...................................................................... 67 Job Definition Window ................................................................................. 68 Job Definition Basic Dialog .............................................................. 70 Job Security Dialog .......................................................................... 75 Job Schedule Dialog ........................................................................ 76 Job Server Group Dialog ................................................................. 80 Job Dependencies Dialog ................................................................ 81 Post Job Dialog: Alert Notifications .................................................. 82 Exit Code Handling .......................................................................... 83 Job Limits Dialog ............................................................................. 84 Job Advanced Dialog ....................................................................... 85 Menu Items ................................................................................................. 87 Job Submission and Execution.................................................................... 87 How Queue Engine Executes Jobs.................................................. 88 Job Log Files and Parameters..................................................................... 89 Job Parameters ............................................................................... 89 Job Exit Codes................................................................................. 90 Chapter 9: Alert Definitions 91
How To Access ........................................................................................... 91 In This Chapter............................................................................................ 91 Alert Description Window ............................................................................ 92 Email Alert Tab............................................................................................ 93 Setting Up Exchange Email ......................................................................... 95 Setting up SMTP Mail.................................................................................. 97 Advanced Pager Setup .................................................................. 101 Bell Alert Tab............................................................................................. 103 Run Command Alerts Window................................................................... 104 Example......................................................................................... 105 W200x Message Alerts Window ................................................................ 106 Argent Console Alerts Window .................................................................. 108 Menu Items ............................................................................................... 109 Chapter 10: Creating and Using Macros 110
How To Access ......................................................................................... 110 In This Chapter.......................................................................................... 110 Macros Window......................................................................................... 111 Pager Macros Window .............................................................................. 112 Defining Pager Macros .............................................................................. 113 Email Macros Window ............................................................................... 115 Defining Email Macros............................................................................... 116 Alert Macros Window................................................................................. 118 Defining Alert Macros ................................................................................ 119 User Macros Window ................................................................................ 120
Contents 6
Defining User Macros ................................................................................ 121 Queue Macros Window ............................................................................. 123 Defining Queue Macros............................................................................. 124 Job Sequence Macros............................................................................... 126 Defining Job Sequence Macros................................................................. 127 Global String Macros ................................................................................. 129 Defining Global String Macros ....................................................... 130 The System Strings........................................................................ 132 Menu Items ............................................................................................... 132 Chapter 11: Advanced Scheduling Using Calendars 133
How to Access........................................................................................... 133 In This Chapter.......................................................................................... 133 Calendars Window .................................................................................... 134 Defining Calendar Definitions .................................................................... 135 Defining a Complex Calendar ........................................................ 137 Testing a Calendar Definition......................................................... 138 Defining An Every Definition......................................................... 139 Define Period Definitions ........................................................................... 142 Defining Holidays ...................................................................................... 144 Menu Items ............................................................................................... 145 Some Examples of Calendars ................................................................... 146 Every Definition.............................................................................. 146 Period Definition ............................................................................ 146 Holidays Definition ......................................................................... 146 Chapter 12: Using Job Scheduler 147
How to Access........................................................................................... 147 In This Chapter.......................................................................................... 147 System Menu ............................................................................................ 147 Start Or Stop Service ..................................................................... 147 Verify Database ............................................................................. 148 Backup Database .......................................................................... 148 Restore Database.......................................................................... 148 Scan Entire Network ...................................................................... 148 Refresh Time Zone Cache ............................................................. 148 Quit Without Saving Changes ........................................................ 148 Job Menu .................................................................................................. 148 Submit Jobs................................................................................... 148 Execute Manual Rollover ............................................................... 149 Edit Job Class Table ...................................................................... 150 Create Job Forecast ...................................................................... 151 Archive Job List ............................................................................. 153 View Job History File ..................................................................... 153 Settings Menu ........................................................................................... 154 Configuration Options .................................................................... 154 System Options ......................................................................................... 155 GUI Options .............................................................................................. 157 Email Options............................................................................................ 161 Windows Messaging Email Options ............................................... 162
Contents 7
SMTP Protocol Email Options........................................................ 163 Security ..................................................................................................... 164 Job List...................................................................................................... 166 CPU Affinity............................................................................................... 168 Service Restart.......................................................................................... 169 Backup Node............................................................................................. 170 Rollover & Archiving .................................................................................. 172 License...................................................................................................... 174 Globally Update Argent Queue Engine Server Settings............................. 175 Assign User Rights.................................................................................... 177 Chapter 13: Design Job Files for Argent Queue Engine 178
Queue Engine, Predefined Environment Variables.................................... 178 Error Handling In Command Procedures ................................................... 179 Accessing Network Shares From Command Procedures .......................... 182 Return Codes ............................................................................................ 183 Using Job Parameters ............................................................................... 183 Appendix A: Command Reference 184
Document Conventions ............................................................................. 184 On-line Help................................................................................... 184 Command Qualifiers ...................................................................... 184 Using Commands Across A Network ............................................. 185 QCANCEL ..................................................................................... 186 QCLOSE........................................................................................ 187 QCREATE ..................................................................................... 188 QDELETE...................................................................................... 190 QMODIFY...................................................................................... 191 QOPEN.......................................................................................... 193 QREQUEUE .................................................................................. 194 QSHOW......................................................................................... 195 QSTART ........................................................................................ 196 QSTOP .......................................................................................... 197 QSUBMIT ...................................................................................... 198 QSYSTEM ..................................................................................... 202 Appendix B: Architecture And Concepts 205
Queue Engine ........................................................................................... 205 Scheduler Engine ...................................................................................... 205 Rollover ..................................................................................................... 206 Background Jobs....................................................................................... 207 Security ..................................................................................................... 207 Fault Tolerance and Backup Nodes........................................................... 207 Appendix C: Troubleshooting Batch Jobs 208
Isolate the Problem ................................................................................... 208 Step 1: Did The Job Run Before? .................................................. 208 Step 2: Run the Job Directly From the Argent Queue Engine ........ 209 Argent Queue Engine Server ......................................................... 212
Contents 8
Argent Job Scheduler Logs............................................................ 213 W200x Event Logs......................................................................... 213 Appendix D: UNIX Command Reference 214
Document Conventions ............................................................................. 214 On-line Help .............................................................................................. 214 Command Options .................................................................................... 214 Queue Names ........................................................................................... 215 Using Commands Across A Network......................................................... 215 QCANCEL ..................................................................................... 216 QCLOSE........................................................................................ 217 QCREATE ..................................................................................... 217 QDELETE...................................................................................... 219 QMODIFY...................................................................................... 219 QOPEN.......................................................................................... 221 QREQUEUE .................................................................................. 222 QSHOW......................................................................................... 222 QSTART ........................................................................................ 223 QSTOP .......................................................................................... 224 QSUBMIT ...................................................................................... 224 QSYSTEM ..................................................................................... 227 Appendix E: W200x and the UNIX Queue Engine 230
W200x Facilities ........................................................................................ 230 W200x Administration................................................................................ 230 HOSTS.DAT .................................................................................. 230 USERS.DAT .................................................................................. 232 Appendix F: Argent iSeries Job Adapter 234
Introduction ............................................................................................... 234 Available Functionality............................................................................... 234 The Three Scheduler Processes ............................................................... 235 The Monitor Daemon ..................................................................... 235 The Listener................................................................................... 235 The Worker.................................................................................... 235 Using CFGARGJSA During Installation ..................................................... 236 CFGARGJSA Command Syntax ............................................................... 236 CFGARGJSA Command Parameters........................................................ 236 Sample CFGARGJSA Command .............................................................. 240 Using the iSeries Command Prompter with CFGARGJSA......................... 241 When to Use CFGARGJSA ....................................................................... 242 Including CFGARGJSA in Your Programs................................................. 243 Getting Started with CFGARGJSA ............................................................ 243 Modifying the iSeries IPL Start Up Program .............................................. 245 Retrieving the C/L Source .............................................................. 245 Modifying the C/L Source............................................................... 246 Re-Compiling IPL Start Up Program .............................................. 247 Appendix I: Job Scheduler Adapter for iSeries Operations 248
Contents 9
Starting the Argent iSeries Job Adapter..................................................... 248 Recognizing When the Argent iSeries Job Adapter is Active ..................... 250 Ending the Argent iSeries Job Adapter...................................................... 251 Advanced Topics: Automating the Start Up and Shut Down ...................... 253 Appendix L: Job Scheduler Adapter for iSeries - Special Library List Considerations 255
Changing the QSYSLIBL System Value .................................................... 255 Changing the ARGSCHED Job Description ................................... 258 Special Issues for V5R2 and Earlier Releases .......................................... 258 Appendix M: Argent iSeries Job Adapter Messages Appendix N: Argent iSeries Job Adapter Service Log Index 259 262 263
Contents 10
Conventions
This documentation uses the following conventions: Font Use
Arial Bold
Used for procedural instructions, button labels, commands, etc. Used for textual emphasis. Indicates Command Line text. Indicates a Toolbar or Menu Bar choice. Examples: Click the Configuration button on the Toolbar. The Configuration window provides access to the Console.
Italic Type
Emphasizes important words or phrases customers need to know. Also used to indicate choice decisions in procedural instructions. Used to differentiate the command keys on your keyboard. Examples: SHIFT, ENTER
Terminology Box Feature Box Check box Click Right Click Select
Use A section of the Argent Job Scheduler screen. Box with 3D style that can be checked / unchecked to select/deselect the entity. Embossed box that can be checked/unchecked to select/deselect the entity. Left click of the mouse. Right click of the mouse. Click or Double-click of the left mouse button to highlight the selected entity. Examples: Select Alert1 from Alert leaf... Select the Home Path and enter a new one.
Supply the input information. To select/deselect an entity. A folder containing a tree-like view of related entities.
Email:
Asia
Telephone: Fax: Mail: 852 2330 0310 852 2330 0311 Argent Technical Support Unit 2017-2018, Metropolis Tower, 10 Metropolis Drive, Hung Hom, Kowloon, Hong Kong. [email protected]
Email:
Email:
Note: Calendars are an optional facility available in the Argent Job Scheduler. Here optional means that the Argent Job Scheduler can run without specifying any calendaring mechanism.
In This Chapter
This chapter includes the following topics: Using the Argent Job Scheduler screens Toolbar Buttons Managing the Argent Job Scheduler Service Forecast Log Window Components of a Batch Job Types of Alerts
Toolbar Buttons
Customers can access commands in three ways. On the toolbar, icons represent the most frequently used commands. They are Exit, Refresh All, Submit, Validate Job, Connect Queue Engine, Manual Job Rollover, Queue Engine Settings, Archive Jobs, Archived Jobs, Configuration, Report, Service Management, Argent Instant Help and About Box.
Figure 2.1: Standard Toolbar Customers can also access and execute commands by clicking the right button of the mouse anywhere in the window, whereupon the pop-up menu will display a list of commands that can be selected.
Note: The choices displayed will be relevant to the option highlighted in the map details window. Also, commands can be accessed from the menu bar and, in some cases, commands can be executed using hot keys.
The Argent Job Scheduler toolbar provides point and click access to the different the Argent Job Scheduler screens. The toolbar buttons are listed following:
Exit the Argent Job Scheduler Read control information from database and refresh the GUI Submit Job Validate Job Connect to a server running the queue engine Manually rollover jobs Argent Queue Engine general settings Manually archive jobs View archived jobs Argent Job Scheduler system configuration Access Argent Job Scheduler reports Service management Argent Instant Help Access Help
How To Access
The Argent Job Scheduler service can be accessed in three ways: 1. To launch the Argent Job Scheduler from the Desktop: Click Start > Programs > Argent Job Scheduler > Scheduling Engine. 2. To start or stop the Scheduling Engine Select Start Service or Stop Service from the System menu bar From the Status Bar, click on the service status icon (the yellow light bulb) in the lower right hand corner of the Argent Job Scheduler status bar. Select Service Management from left tree panel. Use the correspondent button to start or stop the service.
Server Log There are three different types of entries in the Argent Job Scheduler logs: Event, Warning, and Error. Warning and Error entries are entered for events that affect the function of the Argent Job Scheduler. Event entries record the routine functions of the Argent Job Scheduler, such as starting and stopping the service or the GUI, and any changes made to the Argent Job Schedulers configurations or definitions.
Scheduler Log Displays the Schedulers service and error status including: A log showing the service status for the Argent Job Scheduler; i.e., whether in Start or Stop mode. Lists error messages pertaining to errors in running the Argent Job Scheduler.
Types of Alerts
Alerts are messages to be sent depending on certain events that may occur. Alerts can be used to notify operations staff of a problem and/or to automatically take corrective action. Alerts may also be used to inform the operations staff of normal progress, for example, Job Started and Job Completed Normally. The types of Alerts are: Email, Pager, Bell, Run Command, Message, and Argent Console.
How To Access
Argent Job Scheduler Schedule window can be accessed in the following manner: From the left pane in the Argent Job Scheduler window, click on the Schedule Of Current Jobs leaf.
In This Chapter
This chapter contains the following topics: Schedule Window Refreshing the Job List Descriptions of Scheduler Columns Menu Items
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference. Scheduler screen, Screen ID J1.
The Schedule window (right pane) contains the Summary, Date Mask, Server Mask and Job Status Mask options while the job details list appears in the middle half of the pane. This screen uses the Argent UST list. Users can click on the column headings to sort in ascending / descending orders.
Date Masks
The table below describes the options available for specifying what jobs are displayed in the Scheduler screen. Start Time / End Time Set the start and end times to limit which jobs are displayed by their scheduled or actual execution times. To change the Start and End date/times, select either the month, day, year, hour or minute fields, then use the spin buttons to increment or decrement the values. Alternately, click on the pulldown button (at the right of each date/time field) to display a calendar for selection. Show Todays Job List When this feature box is checked, only those jobs that have been submitted today are displayed. Show Only Next Instance Of Job When this feature box is checked, only the next instance of the jobs are displayed. Show All Jobs, Ignore Date Range When this feature box is checked, ignore date range.
Scheduler Colors
The individual job entries can be set to various colors and/or fonts based on the value of their Status column refer to the Using the Job Scheduler / Job List.
Show Log/Quick Help Toggle on/off to display/hide the log and quick help window (bottom pane). Find Finds particular job/entries. Expand All Leaves Expands all leaves (branches) in the services tree (the Explorer view in the left pane). Expand Lower Leaves Expands all leaves (branches) below the selected leaf in the services tree. Collapse All Leaves Collapses all leaves (branches) in the services tree (left pane).
Chapter 3: Argent Queue Engine for Windows The Queue Engine Servers screen displays information on the list of connected servers running the queue engine. It also maintains information about them like version, local server time, time zone and time difference, and displays information on whether the jobs are being executed or not.
How To Access
The queue engine window can be accessed in the following manner: Expand the leaf of Server Where Job Runs and select a server running the queue engine.
In This Chapter
This chapter contains the following topics: Connecting to a server running the queue engine General Information, Startup Jobs, Permissions The queue engine Queue Properties Queue Status Queue Priority Max Pending Jobs Max Executing Jobs Automatic Starting and Stopping of Queues Retain Jobs Queue Description Menu Items
Figure 5.1: Connect to a server running the queue engine Step 2: If the intended Argent Queue Engine is not in the list, the name of server running Argent Queue Engine can be manually entered by clicking on Manual.
Customers unsure of the existing Argent Queue Engines can click Scan Network to scan the network for a server running the queue engine service. The scan options for finding a server running the queue engine are: The Whole Network Only Specific Domains Exclude Specific Domains Use Active Directory
When specifying more than one domain, separate each entry by a comma or space. Once the scan is complete, select the server(s) to connect to and click OK. Note: Connected servers are checked. Use Ctrl+Click or Shift+Click to connect to multiple servers. Or customers can select the servers manually. Step 3: After the Argent Job Scheduler is connected to the queue engine, the Queue Engine window will be displayed.
Queue Engine Server The DNS resolvable name for the remote Queue Engine. TCP/IP Port 3135 for Argent Queue Engine (XS), 3000 for Argent Queue Engine (Pre-W200X), 3012 for iSeries Job Adapter. Comm Protocol It can be one of Not Using Message Header, Using Message Header and 4.6A NT Version Or Previous Versions. Note: The settings must match the actual configuration of the remote Queue Engine to communicate properly. For Argent Queue Engine (XS), the default setting is Not Using Message Header. For Pre-W200X Argent Queue Engine, the option 4.6A NT Version Or Previous Versions must be used.
The next step is to set up the account mapping. The remote Queue Engine may run under a complete different network, the Argent Job Scheduler service account or job account may not be valid for the network. It is vital to map the service account and job account to the accounts acceptable in the remote network in order to execute job properly. Window account should be specified in the format of DOMAIN\USER for domain account and MACHINE\USER for local account.
After saving the changes and repeating the Connect Server operation, customer should see that the newly added server shows up in the dialog box.
General Info
Use the button View System Log on Server to load a server running the queue engine log. It displays information such as Server Local Time, Revision Level, Default Queue, System Log File, Priority Quantum, Log Size Limit, Job Number Wraps After Job, System Boot Threshold, Maximum Executing Jobs, Maximum Job Processes and Used Todays Licensed Jobs as well as Current Statistics of the executing jobs and job processes.
Startup Jobs
Use the Startup Jobs tab to set parameters like Job time limit, and select whether customers want the job to be aborted if the time limit is exceeded. Options also allow specifying how the job should be executed as: Every time the service starts When the service starts at system boot When the service starts after a non-orderly shutdown
Permissions
Click on the Permissions tab to view details about users and the rights they have been given. Customers can add a user name and rights assigned to the user to the existing list.
Queue Properties
Queues have several properties that control the way they behave. These properties can be specified when the queue is created, and they can be modified after the queue has been created. Most sites will want to create several queues with different properties, to serve different purposes. For example, a site could set up: A queue with a high priority and an executing jobs limit of 4 or 5 for the jobs that require immediate attention A queue that executes jobs only at night and has a low priority for the jobs that can wait until the next day A queue with a low priority and an executing jobs limit of 2 or 3 for the jobs that are not urgent and can be performed in the background
In addition, a site could create queues for specific workgroups or specific tasks.
Queue Status
There are two elements to a queues status. The first is whether the queue is Started or Stopped, and the second is whether the queue is Open or Closed. A started queue will execute pending jobs in the queue, while a stopped queue will not. An open queue will accept new jobs that are submitted to it, while a closed queue will not. Queues can also be set by choosing auto to start and stop and to open and close automatically at certain times of the day. For example, customers could set a queue to start every evening and stop every morning, so that jobs in the queue do not execute, and thus consume CPU time, during the workday. With this arrangement, users can submit jobs to the queue and expect the jobs to be completed by the next morning, yet those jobs will not increase the systems daytime workload.
Queue Priority
Every queue has a queue priority ranging from 0 to 255. The priority of a queue determines the amount of CPU time given to jobs that execute in the queue, relative to jobs that execute in other queues. For example, a job in a queue with a priority of 200 would receive roughly twice the CPU time as a job in a queue with a priority of 100, assuming that both jobs were equally CPU-bound. Most real-world jobs, however, are not strictly CPU-bound. For this reason, the queue engine takes full advantage of the preemptive multitasking and Symmetric MultiProcessing (SMP) support built into Windows 200x, allowing lower priority jobs to use any CPU time unused by higher priority jobs.
The Queue Engine service enforces queue priorities by dynamically tracking and adjusting the priority class of all processes in all of the executing jobs several times per
Retain Jobs
Jobs can also be retained for a specified amount of time.
Queue Description
A description of the queue can be specified here.
Default Job Protection These options allow specific W200x permissions to be set at the queue level. For an example: the administrator of the data center may not want certain jobs to be changed, or even seen by the operators. This option allows that flexibility down to the granularity of a job definition. Allow Everyone Read Access If selected, the queue can be read by all users. Allow Everyone Full Control Access if selected, full access and control is granted to everyone. Refer also to the Permission tab (following) for additional permission settings. Queue Priorities A high-priority queue has a default priority of 255 while a low priority queue has a default value of 0 for background operations and a value of 128 (mid-range) would be used for a queue which was neither urgent or background. Max Pending Jobs This option is used to manage job loads. Once a queue has reached its Max Pending Jobs limit, the queue is then considered to be unavailable. If the Argent Job Scheduler has a choice of multiple queues to use and is instructed to use the first available queue, then the Scheduler will pass over the now unavailable queue and submit the job to a different queue. Max Executing Jobs One of the most powerful uses of this option is to set the maximum to 1 this permits only a single job to be run through the queue at any time. This might be set because a job (or jobs) are too resource intensive to run more than one at a time or because of licensing issues or complications involving resource sharing. Retain Jobs for Sets the period of time to retain a job. Once a job is complete, something needs to be done with it. If every complete job record were stored in the queue database, its performance would soon be degraded. This setting allows the record of completed jobs to remain for a short time. with a default queue setting of 24 hours. Status Queue status may be manually set as Started or Stopped and as Open or Closed. Started The queue is running (active). Stopped The queue is halted (inactive). Open The queue is ready to accept new tasks. Closed The queue will not accept new tasks.
Alternately, the Auto setting may be selected for both status selections with the Auto Start: / Auto Stop: fields setting the time of day to start and stop queue operations and the Auto Open: / Auto Close: fields setting the time of day during which new tasks are accepted.
Queue Description Provides a description of the queue. This could include notes on the purpose the queue is intended to serve, who is responsible for the queue operations or who or what groups are authorized to use the queue.
Figure 10.1: The Argent Queue Engine Any change in the queue system, such as a job being submitted by another user, or a queue being created, causes the display to be updated immediately. From any computer on customers network, the queue engine Main GUI gives them an immediate and accurate picture of all queues and jobs on the queue engine server. When it comes to submitting/automating jobs, they will be working most with the Argent Job Scheduler. If customers have advanced needs, please use The Scheduler as it was designed with this in mind and has much functionality, which the queue engine lacks.
Appendix A: Command Reference provides an alphabetical reference to these commands. Queue Engine commands are available on any computer containing either a Queue Engine client or service installation. To make customers the commands available at the Command Prompt, add the queue engine directory to their path. Any of the commands may be used on the local computer or sent across the network to a remote Queue Engine server computer. (See Appendix A: Command Reference for more information about using the commands across a network.)
Domain A
Domain B
Domain C
Queue Engine Server The DNS resolvable name for the UNIX Queue Engine. TCP/IP Port Default value is 3000
The next step is to set up the account mapping. UNIX server generally has its own account management. It is vital to map the service account and job account to the correct UNIX accounts in order to execute job properly.
After saving the changes and repeating the Connect Server operation the newly added server should appear in the dialogue box.
General Info
Use the button View System Log on Server to load a server running the queue engine log. It displays information such as Server Local Time, Revision Level, Default Queue, System Log File, Priority Quantum, Log Size Limit, Job Number Wraps After Job, System Boot Threshold, Maximum Executing Jobs, Maximum Job Processes and Used Todays Licensed Jobs as well as Current Statistics of the executing jobs and job processes.
Queue Properties
Queues have several properties that control the way they behave. A queues properties can be specified when the queue is created, and they can be modified after the queue is created. Most sites will want to create several queues with different properties, to serve different purposes. For example, a site could set up: A queue with a high priority and an executing jobs limit of 4 or 5, for jobs that require immediate attention A queue that executes jobs only at night and has a low priority, for jobs that can wait until the next day A queue with a low priority and an executing jobs limit of 2 or 3, for jobs that are not urgent and can be performed in the background
In addition, a site could create queues for specific workgroups or specific tasks.
Priority
The generic UNIX interface for affecting process priority is known as nice. A process may be nice to other processes running on the system by increasing its nice value. The UNIX OS uses the nice value to calculate the process priority value. The higher a process nice value, the lower a process scheduling priority will be. Since many jobs scheduled on a queue are batched background tasks, which run in the background, lowering the process priority, in order to minimize its impact on the other processes running on the system, is a desirable feature. Nice values range from 0 to 39. A process is usually created with a nice value of 20. Any process may raise its nice value, thereby lowering its priority. Only a process with root privileges may lower its nice value.
Status
There are two elements to a queues status. The first is whether the queue is started or stopped, and the second is whether the queue is open or closed. A started queue will execute pending jobs in the queue, while a stopped queue will not. An open queue will accept new jobs that are submitted to it, while a closed queue will not. Queues may also be set to start and stop or open and close automatically at certain times of the day. For example, customers could set a queue to start every evening and stop every morning, so jobs in the queue do not execute, and thus consume CPU time, during the workday. With this arrangement, users can submit jobs to the queue and expect the jobs to be completed by the next morning, yet those jobs will not increase the systems daytime workload.
Queue Permissions
Queue permission controls who can read/write/execute job in the queue. It is configured in the typical UNIX style (owner, group and others). Read permission controls who can see the queue settings in GUI. Write permission controls who can change the queue settings. Execute permission controls who can submit and eventually execute the jobs in the queue.
CPU Affinity
This setting can be useful for tuning the efficiency of job execution on the multiprocessor high-end UNIX servers.
iSeries Job Adapter The DNS resolvable name for the iSeries server. TCP/IP Port Default value is 3012
The next step is to set up the account mapping. iSeries server generally has its own account management. It is vital to map the service account and job account to the correct iSeries accounts in order to execute job properly.
After saving the changes and repeating the Connect Server operation, the newly added server should appear in the dialogue box.
General Info
Use the button View System Log on Server to load a server running the queue engine log. It displays information such as Server Local Time, Revision Level, etc.
Queue Properties
iSeries queues are associated with subsystem description objects. The relationship between a subsystem description object and queue that are related to it is controlled by job queue entries within the subsystem description object. A Queue can be created at any time, but the apportionment of the queue to a subsystem description object is controlled directly on the iSeries server through the ADDJOBQE, CHGJOBQE, and RMVJOBQE commands. The relationship between a queue and the iSeries subsystem description object is displayed on the queue properties.
Status
There are two elements to a queues status. The first is whether the queue is started or stopped, and the second is whether the queue is open or closed. On iSeries, a queue is started if is is not in a HELD status. If the queue is held on the iSeries server using the HOLDJOBQ command, the status in the Argent Job Scheduler will appear as stopped.
On iSeries, a queue is open if it is configured in an active iSeries subsystem description. If the queue is not configured in any iSeries subsystem description, it will appears in closed status. If a queue is configured in an iSeries subsystem description, but the subsystem is not active, the queue will also appear as closed.
iSeries Jobs
Jobs are the basic units of work that may be submitted to queues. An iSeries job consists of a command and optional associated parameters. A command can be an iSeries operating system command, a user-created command, and application-provided command, or even the CALL command. iSeries jobs are always executed as batch jobs by the Argent iSeries Job Adapter. Batch are expected to require full-screen user or keyboard input, since they execute unattended. Batch jobs are allowed to interact with users through iSeries message commands such as SNDPGMMSG.
Submitting Jobs
Jobs are submitted to queues using the Argent Job Scheduler Command File and Paremeters prompts. For example, to submit a command named NIGHTLYPAY with parameters MONTHLY(*YES) and REPORTS(*ALL), customers specify NIGHTLYPAY as the Command File and MONGTHLY(*YES) REPORTS(*ALL) as the Parameters.
Page 50
Page 51
SAP Server The real SAP server name. SAP App Server The IP address of the SAP server SAP Router The SAP router string. Default is empty. SAP System Number Default value is 0 SAP Client Number Default value is 000
The next step is to set up the account mapping. The SAP system has its own account management. It is vital to map the service account and job account to the correct SAP accounts in order to execute job properly.
Page 52
After saving the changes and repeating the Connect Server operation, the newly added server should appear in the dialoque box.
Page 53
How to Access
Customers can access Argent SuperMap window by selecting Servers Where Jobs Run from the left tree pane. Argent SuperMap window, Screen ID J15.
Argent SuperMaps Use the dropdown to select the Argent SuperMap to be displayed.
Page 54
Page 55
Add Use the Add button to enter the name of the new Argent SuperMap. Argent SuperMap name window, Screen ID J26.
Click OK.
Click OK to select the desired image. Note: The map need not be the image of a country or state, it can be anything that represents a logical image, such as a corporate map of factories. Delete Use this button to delete an existing SuperMap. Select the required SuperMap from the combo box and click on the Delete button.
Click Yes to delete the selected SuperMap or click No to exit from the dialog. Set As Home Check this option to set the selected SuperMap as the Argent SuperMaps home. The Argent SuperMaps home is the one that is first displayed. Browse For New Map File Use this button to desired image from the list.
Page 56
Delete Use this section to add the servers and queues onto the map to be monitored. Click to create a new location and to edit an existing location.
Text Align Use the drop down to select the text alignment of the location. Text Color Use the color picker to specify the text color of the location. Custom Text Enter the name to be shown on the SuperMap X Position, Y Position Enter the X and Y coordinates for the location to be placed on the SuperMap. The X and Y Coordinates can be change by dragging the location rectangle on the SuperMap define window.
Page 57
Hotlinks The Hotlinks function is similar to an image map in HTML pages. It can link Argent SuperMaps to form any kind of hierarchy. Click edit an existing Hotlink. to create a new Hotlink and to
Press left mouse button to draw a rectangle on the map for the hotlink area. Select the desirable Argent SuperMap to be linked to. Customers can select the desired map from the combo box of the sub window. Hotlink Settings window, Screen ID J76.
Page 58
How to Access
The Job Classes window can be accessed in the following manner: Click on the Job Classes leaf.
In This Chapter
This chapter contains the following topics: Creating a Job Class List of Job Classes Creating and Defining a New Job Queue Options Alert Notification Post Job Progress Advanced Job Class Options Menu Items
Page 59
Figure 9.1: The New Job Class Name dialog The Job Classes leaf (branch) will expand to show the new class and the Job Class Properties dialog will appear. Note: Each Class customers create will be listed in a sub-directory under the Job Classes leaf.
Page 60
Step 3:
Figure 9.2: The Job Class Properties dialog Edit the job class properties if necessary, then close the Job Class Properties dialog.
Page 61
Note: On iSeries, the Command File prompt refers to the name of the command to execute on the iSeries server such as CALL or DSPLIB. The Parameters prompt refers to the actual command line parameters that are available for the command defined as the Command File.
Page 62
Page 63
Step 3: Click Next to further specify the server to submit the job. Click Finish to create the new Job.
Page 64
Step 4: Click Next to further specify the job schedule. Click Finish to create the new Job.
Page 65
Step 5: Specify the job schedule. Click Finish to create the new Job.
Page 66
Page 67
Page 68
Job Basic
Job Security
Job Limit
Job Advanced
Job Dependencies
Post Job
Job Schedule
At the bottom of the window, the users rights are shown. For example, the rights might appear as: Your Rights: Read, Change, Submit Control.
Page 69
Page 70
(UNIX Job)
Page 71
(iSeries Job)
Page 72
(SAP Job)
The following list shows all of the definable job parameters: Job Name Shows the name of the job selected. To create a new job, right-click the mouse on the Class leaf under which customers want to place the job Job File Browse the file customers want to place in a queue for execution. This field should not be left blank. Edit Opens Notepad to edit a batch or command file. Log Setting This option is disabled when the Default Log Setting is selected. If any of the remaining three log options are chosen, this field is used to specify the log filename and/or path.
Page 73
Default Log Setting The job defers to the queue to assign a log directory path and filename. Use as Log Directory The Log Setting field specifies the directory path where the log is created; the log filename is specified by the Scheduler. Use as Log File The Log Setting field specifies both the directory path and the log filename. Each time the job executes, the previous log file is overwritten. Use as Log File with Job Number Appended The Log Setting field specifies both the directory path and the log filename. Each time the job executes, a number is added to the filename to create a new file such that the previous log file is not overwritten. Parameters Specify any parameters required for the job. Test Tests a global string macro, assuming one is included in the Parameters specification. For an example, select the JOB_GLOBAL_STRING job created as a demo during the installation of the Argent Job Scheduler and then click the Test button. Submit Job in Held Mode Select to submit this job in Held mode.
Page 74
Where to get Password when the Job Instance Executes This group of options allows selection of the source for the username, domain and password. Use this Password Select this option in order to choose a new username, domain and password. Username The current users name will appear by default. Enter a new username or use the browse button to select a domain and user account. Domain The local domain appears by default. This field will change if the browse button has been used to select a new domain. Alternately, a domain name can be entered. Password Enter the correct password for the selected user. Confirm Enter the password a second time as confirmation. Use password setting specified in the Job Class table Select this option to use the username, domain and password specified in the Job Class properties. For example, from the tree in the Explorer pane, right click on the Generic job class and then select Job Class Property from the popup menu to display the class properties. Execute job under default account of the Argent Queue Engine This is the default password selection and uses the name, domain and password values from the queue engines default account.
Page 75
To create a schedule for a job by clicking on the schedule button on toolbar and click the New button the leftmost button in the group of four at the right of the caption to display the When to Submit Job dialog.
Page 76
Initially, the When to Submit Job dialog appears in the collapsed format. use the More button to display the Advanced Settings portion of the dialog as shown.
Page 77
Scheduling options are: Schedule Task This pull down list offer five options as Once, Daily, Weekly, Monthly and Use Calendar. As scheduling interval is selected, the dialog changes to reflect the selection options. Once Since the task will only execute once, the only scheduling option is the Start Time (following). Daily Use the Schedule Task Daily options to schedule execution every x days. Use the spin buttons to change the repeat interval or enter the number of days manually. Weekly Use the Schedule Task Weekly options to schedule execution every x weeks on selected days of the week. Monthly Use the Schedule Task Monthly options to schedule execution either by the day of the month or by the week and day of the week. Options are; Day Select the day of the month. Select Months Select which months the job should run. Use Calendar Use the Advanced Task Scheduling option to select a Calendar Definition (see Chapter 8, Advanced Scheduling Using Calendars) to control job submission. Start Time All of the Schedule Task options allow a start time to be specified. (The default Start Time will be the time the job submission is created.) Use the spin buttons to change the start time or enter the desired start time manually. Repeat Job In addition to scheduling a starting time and date(s) for a job, a job can be repeated at regular intervals or Every Select an interval in Minutes or Hours for the job to repeat. For example, customers may specify that a job should repeat every 10 minutes or every 2 hours. Until Rather than allowing a job to repeat indefinitely, repeat operations are set either until a specified time or for a specified duration as: Time Sets a time to terminate the repeat job. The default is one hour later than the time the job submission was created. Duration Sets an interval in hours/minutes for the job to repeat. The default is one hour.
Page 78
Advanced Settings The advanced options do not appear until the More button is selected but allow start and end dates to be specified for a job. date. End Date The ending date must be selected explicitly but will default to todays date. Both the start and end dates can be changed by selecting any of the date fields day of week, month, day or year and using the spin buttons to increment or decrement the values. Alternately, customers can choose the calendar button at the right of the field to display a calendar and select the desired date. Ignore Year Select this option to ignore the year field in the start and end dates. The dates will appear only as month/day/*, omitting the day of the week. Other option settings for job schedules are: Do Not Include This Job in Rollover If selected, this job is not included in rollover. While a job is normally submitted automatically at rollover, there are a number of reasons why customers might not want it to be submitted. The job should not run. Either the job is obsolete, not yet complete, or not ready to be put into production. With this option on, the scheduler ignores the job during rollover. The job is submitted by another job. Often jobs are grouped into sequences where one job submits another job based on its successful completion. Using this option prevents the job from being added to the schedule by rollover. If not Started, Do Not Rollover If selected and the job has not started, the job is not included in rollover. For example: a job is submitted every day at 00:01 that waits for a file (i.e., a file dependency). However, the required file only shows up on some days and not at all on other days. If the job did not have this option enabled, then when a job waited for a day and was not run the next day the job would have been submitted again, and, if the file arrives on that day, both instances of the job would run. If Job Not Started By Rollover, Purge The Job Instance If selected and the job has not started by rollover, the job is purged from the job instance. Start Date The starting date is enabled by default and will appear as todays
Note: A single Job Definition, when submitted by a human (ad hoc) or at rollover time (typically midnight for the next days job instances), can create multiple job instances. For example, a Job Definition called JOB1 may have a schedule of from 00:00 to 23:58, once an hour, every hour. Thus, one Job Definition creates twenty-four job instances.
Page 79
The Job Servers Group shows the available server (or servers) where the job can execute. If multiple servers are listed, the Affinity options are: First Available Server Executes the job on the first started open queue on the first running server in the given list.. All Servers Specified Above Executes the job on all the servers/ queues listed. This means that multiple instances of the job will run, one for each server/queue listed. Running a job with this option requires that the job be able to run on each of the servers. Use Universal Naming Convention (UNC) paths for job files, and be sure that all resources required by the job are available on all servers. Least-busy Server (Lowest CPU) Executes the job only once, but on the node with the lowest CPU load at the time of submission. This type of affinity can be used for balancing job loads across multiple servers.
Page 80
Define File Dependencies for job If selected, a File Dependency entry is created for the job and appears as a sub-branch under the tree entry. The File Dependency requires a specified file to exist before the job can be executed. Define Job Dependencies for job If selected, a Job Dependency entry is created for the job and appears as a sub-branch under the tree entry. A Job Dependency requires another specified job to have executed with a specific result and/or within a specified period. Define ODBC Dependencies for job If selected, an ODBC Dependency entry is created for the job and appears as a subbranch under the tree entry. An ODBC Dependency can set several conditions for executing a job, including a column value in an ODBC-compliant database and can include SQL statements to perform conditional tests.
Page 81
In the Post Job Dialog, five response options are available as notifications. Notify When Job Starts If this option is selected, when a job begins, two responses can be defined as: Fire Following Alerts Fire an Alert when a job starts Execute Following Jobs Execute another job when a job starts
Notify if Structural Error Happens If this option is selected, when a structural error occurs, two responses can be defined as: Fire Following Alerts Fire an Alert when a structural error occurs Execute Following Jobs Execute another job if a structural error occurs
Page 82
The fifth and most important Eesponse option is the Exit Code Handling option:
What Is An Exit Code? An exit code is a number that is returned when a process ends. In batch job scheduling, exit codes are important because they can be used to monitor the results of jobs so that automated decisions can be made. The exit code that is returned by customers job process is dependent of the job process itself. Some processes return a simple 0 if the process was successful, and a 1 if it was not. Other programs can have hundreds of discriminating exit codes that are cataloged in their documentation.
Page 83
Execution restrictions include: Execution time limit Limits the maximum execution time for a job CPU time limit Limits the maximum CPU time allowed for a job Limit running job Limits how many times a job can be run within a specified time frame (starting and ending dates). Notifications include: Notify if job runs more than Issues an Alert if a job takes longer than a specified time. Notify if job is late more than Issues an Alert if a job is late by a specified time. Notify if job has not started by Issues an Alert if a job has not executed by a specified time.
Page 84
Notify if job has not ended by Issues an Alert if a job has not completed by a specified time.
Only one job instance being executed at any time Only one instance of a job is permitted to execute. This prevents inadvertent overlapping of processes. Protect from Everyone Read Prevents unauthorized accounts from viewing the job definition by removing the Read permission from the Everyone group. Protect from Everyone Full Control Prevents unauthorized accounts from administering the job definition. Abort job if waiting for keyboard input This option instructs the queue engine to monitor the job for any pauses that are due to
Page 85
the program waiting for keyboard entry. To use this option, the job must be a 32-bit console application. Abort job if waiting for dismissal of message box This option instructs the queue engine to abort the scheduled job if it is waiting for message box for dismissal. Caution: any pop-up error messages, or dialog boxes that are generated by the job will not be detected by this method. Do not Monitor Job CPU Time Normal Queue Engine jobs are monitored directly by the queue engine's launcher program however, such close supervision may cause some applications to perform badly. To avoid such execution problems, the queue engine has the capacity to allow jobs to be submitted without CPU time monitoring. In some cases, processes such as BCP in MS SQL Server may run faster in the No Monitor Environment. However, disabling monitoring of the CPU time usage means the queue engine cannot report CPU usage back to the Scheduler. The Do not Monitor Job CPU Time option in the Advanced tab effectively overrides the CPU time limit option found in the Limits tab. Use exit code file Exits codes are written to an exit code file on termination. Exit codes are based on the output of the job process. Some job processes or applications have internal error codes but do not pass these to the environment as exit codes. The exit code file provides a way for these codes to be extracted from the batch job by creating a file name that both the batch job and the Scheduler are aware of. Then the batch job process can write an error code to this file, and the Scheduler can read the file and use this code as the exit code for the batch job. As an example: Visual Basic has extensive error codes internally, but does not use these error codes as exit codes. A Visual Basic batch job may encounter a severe error internally, and still complete with an exit code of 0. The following code fragment can be added to the error handler in the Visual Basic app so that its internal error levels, which are defined by the object Err.Number, are communicated to the Scheduler
ErrorHandler: Dim strExitCode As String strExitCode = Environ$("TABF_EXIT_CODE_FILE") Open strExitCode For Output As 1 Write #1, Err.Number Close #1 End Sub
Retain for debugging purpose; do not delete exit code file The exit code file is retained for later use. Normally, the exit code file is deleted and this is preferred since many files may be created. This setting causes the scheduler to leave the file intact so that if the batch job is not writing to the file correctly it can be debugged.
Page 86
Write Record to W200x Event Log for Stopped Jobs Optional switch to log stopped jobs notification to the W200x Event Viewers Application Log. Optional Pre-Job Scripts Optionally, one or more scripts can be defined for execution prior to running the job. Optional Post-Job Scripts Optionally, one or more scripts can be defined for execution after to running the job.
Menu Items
The list below describes the menu items used to define jobs, queue options, alerts and advanced options. New Job Click to create a new job Save Click to save a new or revised definition Delete Click to delete the job Rename Click to rename existing jobs Copy Click to copy an existing Job Definition Delete Schedule Click to delete a Job Schedule Delete File Dependency Click to delete a File Dependency Delete Job Dependency Click to delete the Job Dependency sub-rule Validate Job Definition Click to validate a job Submit Job Click to submit a job after customers have defined it. Also, they can click on the Submit icon on the tool bar to submit a Job. Job Class Properties Click to modify the properties for any job class. Click on the right mouse button for the drop-down box to be displayed or access these options from the menu bar.
Page 87
Scheduler uses the same API as the command line utility QSUBMIT to submit jobs. We will uses QSUBMIT in the following paragraphs to explain the concept. Jobs are submitted to queues by their filenames. For example, to submit a batch file called PAYROLL.BAT to a queue called NIGHTLY, customers would select the batch file on the Submit Job screen in the queue engine, or use this command:
C:\> QSUBMIT PAYROLL.BAT /QUEUE=NIGHTLY
Page 88
Job Parameters
When customers submit a job to a queue, they can enter one or more parameters. The executable or command procedure that they submit can use these parameters when it executes. This feature can be very useful for setting up generic jobs or Job Classes. For example, customers could create a batch job to compile a source code file, but instead of naming the file in the batch job, they could use the special character %1. When they submit the job, they can specify the name of the file to compile as a job parameter, as in the following command:
C:> QSUBMIT COMPILE /QUEUE=DEV/PARAMS=C:\PROJECT\MAIN.C
Another example could be to create a batch job to rename a file, but instead of naming the file in the batch job, customers could use the special characters %1 and %2. Suppose the batch file holds the command
RENAME %1 %2.
Customers can then specify the batch file name in the job file field and the old and new file names of the file that needs to be renamed in the job parameters field. This feature is useful for setting up batch jobs to perform backups, file transfers, database transactions, and any other utility-type programs that are used frequently.
Page 89
Page 90
How To Access
The Alert Definitions window can be accessed in the following manner: In the Explorer window (left pane), click on the Alerts leaf, then select an individual Alert to display properties.
In This Chapter
This chapter contains the following topics: Email Alerts Setting Up Exchange Mail Setting Up SMTP Mail Pager Alerts Bell Alerts Run Command Alerts W200x Message Alerts Argent Console Alerts Menu Items
Page 91
Figure 6.1: The Basic Tab in the Alert Description Window The Basic tab in the Alert description is used to set the alert priority (as Low, Medium or High), to select the Alert Type (or types) as Email, Pager, Bell, Run Command, NT Message and/or Guardian Alert and to display a description of alert. The Description field is used to enter notes describing the purpose of the alert, who should be notified, why the alert was created and by whom or other information which could potentially be useful at a later date.
Page 92
Figure 6.2: Email Alerts Window The Argent Job Scheduler has the capability of sending email messages through either the local MS Exchange client, or directly from the Argent Job Scheduler in Simple Mail Transport Protocol (SMTP). The Argent Job Scheduler can use both modes of transport at once. To specify which one is used for the particular Email alert that is being sent, select the Argent Job Scheduler Alert type as Email (J25) The email message sent by the Argent Job Scheduler can be modified in several ways. Email Type Use the pull down menu options to specify the type of email to be sent as either MAPI or SMTP.
Page 93
To/CC Multiple recipients can be specified either in the main address field, or to receive the alert as a carbon copy (CC). Separate multiple addresses on one line with a semicolon. The selection buttons () at the right of the To: and CC: fields allow customers to choose entries from their email address book. Subject Specify either a custom subject line or use the default subject: The Argent Job Scheduler Alert. Attach File A specific file can be attached to the message. Use the Browse button to select a file or enter the path/filename manually. Message Text Text entered in the message field will be included in the message. Include the queue engine Job Log The job execution log can be included as an attachment to the message. Include Detail of Job Execution Result The alert can include detailed system information about the job in the mail message. Options are: None No details are included with the message. Summary A summary of the job execution result is appended. Complete The complete results of the job execution results are included.
Page Condenses the message to the smallest reasonable size and should produce a level of detail smaller than the Summary detail level. While most alphanumeric pagers now have email addresses, standard pages can only receive 80 characters at a time. In response, pager service providers may truncate email messages sent to pagers to 80 characters or may page multiple times. Note: Either a MAPI- or SMTP-based-client must be installed on the node to run this feature.
Page 94
Page 95
Step 11: If customers have a personal address book, enter the location or create one. Step 12: Customers can then select to start Exchange automatically. Step 13: Then click Finish
Remember, the two most common errors are: Wrong profile for login When customers create a profile, it is associated only with their current login profile. Choosing the wrong mailbox
Page 96
Customers must select a mailbox created by their current login account. Exchange allows customers to select an incorrect mailbox but will return a MAPI error when they try to use it.
Page 97
Page 98
Figure 6.3: Pager Alerts Window Pager alert options are: Telephone Number Enter the telephone number used to reach the pager. Pager ID Enter the pager ID. This is normally a seven digit ID found on the back of the pager. Be sure customers have the correct paging number. This is called the modem access number. The customer must provide his operating system and node type to the paging service to get the right number. Baud Rate Supported baud rates are 110 through 256,000 COM Port A pull down list offers the options COM1 through COM9.
Page 99
Type The Argent Job Scheduler can send pages to either a numeric or alphanumeric pager or, of course, to a beep-only pager. Select the pager type as: AlphaNumeric Pager A pager capable of displaying a text message. Numeric Pager A pager capable only of displaying numbers. Beeper Only A pager without a display feature. The Argent Job Scheduler sends messages to alphanumeric pagers by means of a modem that connects to a pager service provider, and communicates using the TeleAlphanumeric Protocol (TAP) standard. Max Chars per Page For alphanumeric pagers, sets the maximum number of characters, which can be displayed on a page (screen). Message Text A text message to send to an alphanumeric pager or a number to send to a numeric-only pager. If Failed, wait for If the Scheduler is unable to sent the alert to the pager, enter the interval (in seconds) to wait between tries and the number of times to retry. Include Detail Select to include details with the pager alert only for alphanumeric pagers which support extended message displays. Advanced The Advanced button displays the Advanced Pager Setup dialog discussed following. Test Pager Sends a test message to the pager to test the alert settings.
Page 100
Figure 6.4: The Advanced Pager Setup Dialog The Advanced Pager Setup dialog is used to select settings suitable for the modem used to send the pager alert message. Settings include: Modem Initialization String A command string used to initialize the modem. The default string ATH+++ instructs the modem to terminate a call (that is, hang up the phone just in case the phone is offhook) and to pause for three seconds before proceeding. Modem Termination String A command string used to terminate the connection. The default string ATH instructs the modem to terminate the call (hang up the phone).
Page 101
Modem Debug File Spec This is a file used to test and debug an alphanumeric pager issue. Enter a path and filename and, when the pager is tested, a debug log is written to the indicated file. Debug Level Set the debug level to 1 for testing. Data Bits Options are 5, 6, 7 or 8 data bits. The default of 7 data bits is compatible with most modems. Stop Bits Options are 1, 1.5 or 2. The default of 1 stop bit is compatible with most modems. Parity Options are None, Odd, Even, Mark or Space. The default parity option of Even is compatible with most modems. Parity Check The Parity Check option is enabled by default and is compatible with most modems. Flow Control Options are Xon/Xoff, Hardware or None. The default flow control option of None is compatible with most modems. Timing Options are Extended, Long, Standard, Short or None. The default timing option of Standard is compatible with most modems. Dial Type Options are Tone or Pulse. The default is Tone but customers may select Pulse for older phone systems which do not support tone dialing. To simplify connecting to many modems, initialization strings should contain the following instructions: Disable error correction Disable data compression Disable hardware flow control Force the proper baud rate
Paging companies do not always have the newest and most sophisticated equipment available and may have a limited ability to adjust baud rate and detect advanced modem features. Check out the capabilities of customers paging service to ensure that they support the features they are anticipating and relying on. Because paging companies all have mixed modems, testing pagers is nearly impossible as a different modem is always answering at the paging end. The solution is to rely on a simplest common denominator simplest settings which should be compatible with all standard modems.
Page 102
Figure 6.5: The Bell Alerts Window The Argent Job Scheduler bell alert will activate the system bell on the server where the Argent Job Scheduler is running. The frequency and duration of the bell can be changed to reflect different priorities. The three predefined System Bells High Priority, Medium Priority and Low Priority each have set frequencies and durations while the Customized bell allows both the Frequency and Duration to be defined. Selecting the Repeatedly option causes the bell to repeat ten times. Use the Test button to listen to the alert; use the Save button to retain changes
Page 103
The Argent Job Scheduler Command Alert will launch a program or command. This program will be executed on the same node that is running the Argent Job Scheduler service. Additionally, the Argent Job Scheduler keywords can be added to the command-line to provide information about the specific job being run.
Page 104
Queue Engine keyword variables can be used in Run Command alerts as:
%TABF_EXIT_CODE_FILE% The path and file name of the exit code file used by the
%LowDetail% Summary details of the batch jobs execution %ServerNode% The name of a server running the queue engine where the batch job is executing.
Example
The following command alert excerpt displays a line containing information about the job: Net Send ServerXYZ Job %TABF_JOB_NUMBER% was submitted by %USERNAME%. If the job containing this line were submitted by user TomD and were job number 1073, then the following would appear on ServerXYZ: Job 1073 was submitted by TomD.
Page 105
Figure 6.7: The W200x Message Alerts Window The Argent Job Scheduler has the capability to send console messages to a user or to all members of a sender group. There are several ways to specify an W200x Message Alert. A console message can be sent to a Name, Domain or All Users connected to a server. Customers can select one of three types of recipient as: Name Customers can select a user name from the drop-down list, or enter * for all members of a sender group. Domain Enter a domain name. If customers do not specify a domain name, the current domain name is assumed. All Users Currently Connected to Servers
Page 106
Select this option to send a console message to all users currently connected to the server. Message Text Enter text in the message field to be included with the Argent Job Scheduler Message Alert. Include Job Detail Customers can select one of the following options to include job details: None Select this option if customers do not want to send any Job Detail with the console message. Complete Summary Select this option to send complete Job Detail with the console message. Select this option to send a summary of Job Detail with the console message. Test Use this button to test the console message.
Page 107
Figure 6.8: Argent Console Alerts Window Argent Extended Technology is a powerful monitoring and alerting product offered by Argent. Argent Job Scheduler has the capability to use Argent Console as its alerting mechanism. Any alert created for the Argent Console can be fired by the Argent Job Scheduler. The Argent Console Alert message is defined by: Argent Console Main Engine The name of the Argent Console main engine where the message will be directed. Alert Name Specify the name of an alert defined on the Argent Console. Console Comment Enter a console comment.
Page 108
Summary Enter a brief summary of the alert message. Message Text Enter a complete text message for the alert. Include Job Detail The following options control job details included with the Guardian Alert message: None Complete Summary No job details are included in the message. Complete job details are included with the message. A summary of the job details are included with the message. Test Use to test the Guardian Alert message.
Menu Items
The list following describes the menu items provided for defining Alerts. New Alert Creates a new Alert definition Save Save the Alert definition Delete Delete the Alert definition Undo Undo changes Rename Rename the selected Alert Copy Copy an existing Alert definition Reset Tab Content Click to reset the tabs content Click on the right mouse button for the drop-down box to be displayed. These options can also be accessed from the menu bar.
Page 109
How To Access
The Macros window can be accessed in the following manner: Click on the Macros leaf in the Explorer pane (left window) to expand the Macros branch. Select a macro type to expand to view individual macros or Right-click on the Macros leaf or a macro type leaf and select New Macro from the popup menu to create a new macro.
In This Chapter
This chapter contains the following topics: Pager Macros Email Macros Alert Macros User Macros Queue Macros Job Sequence Macros Menu Items
Page 110
Macros Window
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference. Macros window, Screen ID J6.
Figure 7.1: The Macros Window In the Macros window, notice that a series of macros are listed which have been provided as examples during the installation of the Argent Job Scheduler.
Page 111
Figure 7.2: Pager Macros Window The Pager Macros window shows a sample email macro or, in this case, a macro template which can be further, defined and then used in the Pager Alerts discussed in Chapter 6. Click on the &PM_SAMPLE to view the macro details.
Page 112
Figure 7.3: The New Macro for Pager dialog The name entered will be automatically prefixed with the string &PM_ to identify a pager macro. Thus, if customers entered PAGER_TEST_MACRO, the finished macro name will be &PM_PAGER_TEST_MACRO. The new macro will be created as a blank macro definition. At this point customers may: Enter a macro definition directly or Select the blank definition and then click on the browser button () at the right of the blank definition listing to select an existing definition file or Select the New button (leftmost button) from the tools button bar right of the Macro Definition label bar. at the
Page 113
Figure 7.4: The Pager Macro Parameters dialog Enter the Telephone Number and Pager ID. Select appropriate Pager Type, Data Bits, Stop Bits, Parity and Flow Control. Click OK to save these settings. Step 4: The blank pager macro definition for the new macro is replaced with a definition based on the information provided.
Page 114
Figure 7.5: Email Macros Window The Email Macros window shows a sample email macro or, in this case, a macro template which can be further, defined and then used in the Email Alerts discussed in Chapter 6. Click on the &EM_SAMPLE macro to view the macro details.
Page 115
Figure 7.6: The New Macro for Email dialog The name entered will be automatically prefixed with the string &EM_ to identify an email macro. Thus, if customers entered EMAIL_TEST_MACRO, the finished macro name will be &EM_EMAIL_TEST_MACRO. The new macro will be created as a blank macro definition. At this point customers may: Enter a macro definition directly or Select the blank definition and then click on the button () at the right of the blank definition listing to select an existing entry from customers address book or Select the New button (leftmost button) from the tools button bar right of the Macro Definition label bar. at the
Page 116
Figure 7.7: Using the Address Book to create an Email Macro Step 4: Select one or more email recipient names, then click OK when finished. Note that the Cc and Bcc buttons are grayed out and cannot be selected. Carbon copy and blind carbon copy addresses are not supported for email alerts. The blank email macro definition for the new macro is replaced with a definition based on the information provided.
Page 117
Figure 7.8: Alert Macros Window The Alert Macros window shows a sample alert macro, which might be used in the Job Notify tab in place of hard-coding an Alert entry. Click on the &AM_SAMPLE macro to view the macro details.
Page 118
Figure 7.9: The New Macro for Alert dialog The name entered will be automatically prefixed with the string &AM_ to identify an alert macro. Thus, if customers entered ALERT_TEST_MACRO, the finished macro name will be &AM_ALERT_TEST_MACRO. The new macro will be created as a blank macro definition. At this point customers may: Enter a macro definition directly or Select the blank definition and then click on the button () at the right of the blank definition listing or Select the New button (leftmost button) from the tools button bar right of the Macro Definition label bar. at the
Step 3: Select a predefined alert using drop-down menu and click OK.
Figure 7.10: Selecting a predefined alert Select a predefined alert from the pull down list, then click OK to save the alert macro definition.
Page 119
Repeat the selection process to add additional alerts to the macro definition.
Figure 7.11: The Argent Job Scheduler User Macros Window The User Macros window shows a sample users macro, which might be used in the Job Notify tab in place of hard-coding a User name. Click on the &UM_SAMPLE macro to view the macro details.
Page 120
Figure 7.12: The New Macro for User dialog The name entered will be automatically prefixed with the string &UM_ to identify a user macro. Thus, if customers entered USER_TEST_MACRO, the finished macro name will be &UM_USER_TEST_MACRO. The new macro will be created as a blank macro definition. At this point customers may: Enter a macro definition directly or Select the blank definition and then click on the button () at the right of the blank definition listing or Select the New button (leftmost button) from the tools button bar right of the Macro Definition label bar. at the
Page 121
Figure 7.14: Selecting a domain or a local user Select a the appropriate account and Click OK to complete the User macro.
Page 122
Figure 7.5: The Queue Macros Window The Queue Macros window shows a sample queue macro, which might be used in the Job Queue tab in place of hard-coding a Server and Queue name. Click on the &QM_SAMPLE macro to view the macro details.
Page 123
Figure 7.16: The New Macro for Queue dialog The name entered will be automatically prefixed with the string &QM_ to identify a user macro. Thus, if customers entered QUEUE_TEST_MACRO, the finished macro name will be &QM_QUEUE_TEST_MACRO. The new macro will be created as a blank macro definition. At this point customers may: Enter a macro definition directly or Select the blank definition and then click on the button () at the right of the blank definition listing or Select the New button (leftmost button) from the tools button bar right of the Macro Definition label bar. at the
Page 124
Figure 7.17: The Select a Server and Queue dialog Select a server and a queue from the tree. Queue options are: Any Queue on the Server (default) Use any available queue on the selected server. Wildcard Queues Use a wildcard specification to select a group of queues. Default Queue on the Specific Server Use the default queue on the selected server. Specific Queue Use the queue selected from the server tree (upper window). This option is automatically selected by choosing any queue from the tree. Queue Macro Enter or select a Queue Macro to identify the desired queue or queues.
Page 125
Figure 7.18: The Job Sequence Macros window Job Sequence macros create flexible easy to manage job flow lists. Users can create a Job Sequence macro to tie any number of Job Classes together and control the flow of processing. Job Sequence macros provide the power to run multiple job dependencies with one easy configuration. For example, JOB1, JOB2, JOB3 and JOB4 are dependent on each other in numeric order. A Job Sequence macro allows the group to be listed dependently in one macro. This alleviates the configuration of multiple Job Dependencies on each Job Class. From the Argent Job Schedulers J1 screen, Job Classes listed in Job Sequence macros are shown with an additional append to the job number. This gives administrators a view of each macros progress from one screen. Click on the &JS_SAMPLE macro to view the macro details.
Page 126
Figure 7.19: The New Macro for Job Sequence dialog The name entered will be automatically prefixed with the string &JS_ to identify a user macro. Thus, if customers entered JOB_SEQUENCE_TEST_MACRO, the finished macro name will be &JSTE_JOB_SEQUENCE_TEST_MACRO. The new macro will be created as a blank macro definition. Unlike previous examples, however, the macro definition screen is not entirely blank see Figure 45 because three job handling options appear for selection using radio button controls. At this point customers may: Enter a macro definition directly or Select the blank definition and then click on the button () at the right of the blank definition listing or Select the New button (leftmost button) from the tools button bar right of the Macro Definition label bar. at the
Page 127
Select a predefined job from the pull down list and click OK. Optionally, the Run Job Immediately selection can be checked to launch the job Step 4: Select the desired Job Handling option as: Purge all downstream jobs if predecessor ends abnormally Suspend all downstream jobs if predecessor ends abrnomally Submit all jobs at the same time
Page 128
Figure 7.22: Global String Macros Window Global string macros provide the ability to enter variables into jobs and are separated into two categories, Private Strings and System Strings. (See Figure 49, following, where the two string types are identified in the Global String dialog.) A Private String is entered as a text value and gives users incredible flexibility, in both writing job files, and using the Argent Job Scheduler to run them. For example, Help Desk contact information which changes periodically can be written as a Private String. Subsequently, selecting the correct string will insert the proper information into the job without changing the job coding. A System String can only be defined as a variable maintained by the computer i.e., a value and identifier predefined by the system. For example, the Global String macro can insert the date a System String maintained by the computer into a running job file. This can be used to create reports, which are time and date stamped without making changes to job command coding.
Page 129
Figure 7.23: The New Macro for Global String dialog The name entered will be automatically prefixed with the string &TX_ to identify a user macro. Thus, if customers entered GLOBAL_STRING_TEST_MACRO, the finished macro name will be &TX_GLOBAL_STRING_TEST_MACRO. The new macro will be created as a blank macro definition. Enter a macro definition directly or Select the blank definition and then click on the button () at the right of the blank definition listing or Select the New button (leftmost button) from the tools button bar right of the Macro Definition label bar. at the
Page 130
Step 3: The Global String dialog allows entry either of a Private String value as simple text or selection of a System String from the list of predefined values.
Figure 7.24: The Global String dialog Description Displays an explanation of the selected System String. Append text to current Global String This option can be used to append a new entry to an existing global string. For example, begin by creating a Private String reading: This string should show the date (note the trailing space) and save the entry. Now open the same entry, select the %DAY% System String, check the Append option, and click OK. The new Global String will be identified as a Private String but it will be defined as: This string should show the date %DAY%.
In this fashion, a complete custom (Private) formatted string can be created using any combination of text and predefined system values.
Global String macros can also contain multiple strings as any mixture of Private String and System String entries which will be concatenated in use with a space delimiter
between items.
Page 131
Current day in the 2-digit format. For example, for 15 Dec 1999, this is 15.
%DAY_NAME%
Current month in the 2-digit format. For example, for December this is 12.
%MONTH_NAME%
Current month in the abbreviation of month name, such as Jan, Feb, etc.
%TIME%
Current year in the format of CCYY. For example, 1999. These variables are dynamically maintained by the computer.
Menu Items
After selecting the Macro leaf, the table below describes the menu items provided for defining New Macro, View Macro in a List, Arrange Icon, and Print. New Macro Select to create a new macro. Expand All Leaves Fully expands all leaves (branches) in the tree. Expand Lower Leaves Expands all leaves (branches) below the selected leaf. Collapse All Leaves Collapses all leaves (branches) in the tree. Show Log/Quick Help Displays or hides the log and quick help pane at the bottom of the window. Print [Ctrl+P] Print a list of existing macros. Click the right mouse button on the Macros leaf to display the popup menu.
Page 132
How to Access
Clicking on the Calendars leaf can access the Calendars window. All the Calendars that customers have defined will be displayed under the Calendars leaf in the map details window.
In This Chapter
This chapter contains the following topics: Calendar Definition Every Definition Period Definition Holiday Definition Menu Items
Page 133
Calendars Window
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference. Calendars window, Screen ID J71.
Page 134
Figure 8.2: Define New Calendar Definition Enter the new definition name and click OK or press ENTER. The Calendar name appears with the prefix CAL. Step 3: The Pick A Calendar Day window is displayed.
Page 135
Step 4: Select the type of calendar entry to create as: Specific Date Select the month, day or year field and use the scroll button to increment or decrement the value or Use the calendar button (at the right) to select the month, day and year from the popup calendar. Ignore Year If checked, the year is treated as a wildcard; i.e., the month and day repeat every year. Specific Weekday Select the day of the week from the pull down list. Calendar Formula Select either an Every Definition or a Period Definition from the pull down lists. The Every Definition and Period Definition options are discussed following. Calendar Definition Select an existing Calendar Definition from the pull down list. Step 5: Click OK to save the selection.
Page 136
Figure 8.4: A complex calendar definition To add additional data elements: Enter a data element definition directly or Select a blank data element and then click on the button () at the right of the blank listing or Select the New button (leftmost button) from the tools button bar the right of the Include or Exclude label bars. at
Page 137
Figure 8.5: Testing a Calendar definition Notice that Friday, September 15th which is one of the exclusion dates does not appear in the list of Wednesdays and Fridays. Start Date of Forecast / End Date of Forecast Select the range of dates examined. The start and end dates can be selected, as discussed previously, in the same fashion as other date entries. Notepad Exports the forecast results to the Notepad where, if desired, the dates can be saved as an ASCII text file.
Page 138
Figure 8.6: Define New Every Definition Window Enter the new Every definition name and click OK or press ENTER. The name of each Every definition will be prefixed with EVR_.
Page 139
Step 4: Select the Days/Year/Month and optional Holiday logic from the Definition window (J63) that appears.
Figure 8.7: The Every Definition Window In the Every definition window, there are a variety of options for selecting dates and date ranges, including: Weeks Of The Year Select All Selects all weeks of the year (1st through Last). Clear Clears all weeks of the year (1st through Last). Weeks of the year can also be selected or cleared individually. Days of the Week All Days
Page 140
Selects all of the days of the week (Sunday through Saturday). Weekdays Selects only weekdays (Monday through Friday). Specific Days Allows individual days of the week to be selected or cleared. Months of the Year Year Selects all twelve months of the year (January through December). Month Months are selected or cleared individually. Optional Holiday Logic The Holiday entry under Calendars (discussed following) optionally specifies the days to be skipped in the Every definitions. Use Prior non-HOLIDAY weekday If a job is scheduled for a holiday, the first weekday (Monday through Friday) preceding the holiday event is used. Use Next non-HOLIDAY weekday If a job is scheduled for a holiday, the next weekday (Monday through Friday) following the holiday event is used. Use Prior non-HOLIDAY day If a job is scheduled for a holiday, the first day of the week (Sunday through Saturday) preceding the holiday event is used. Use Next non-HOLIDAY day If a job is scheduled for a holiday, the next day of the week (Sunday through Saturday) following the holiday event is used. Skip day completely If a job is scheduled for a holiday, the job is skipped entirely. No HOLIDAY test at all No test is made to determine if a job is scheduled for a holiday event. Optionally, a description can be added to explain or identify the Every definition.
Page 141
Procedure 16: Creating a Period Definition Step 1: Right-click on the Period leaf and select New Period Definition from the popup menu. Step 2: The New Period Definition dialog will appear.
Figure 8.8: Define New Period Definition Window Enter the new Period Definition name and click OK or press ENTER. The name of the Period Definition entry will be prefixed with PRD_.
Page 142
Figure 8.9: The Calendar Day dialog Two options are offered as: Specific Date Displays a single date entry field. Date Range Displays two date entry fields for beginning and ending dates. For either the specific (single) or range (dual) date fields, customers have several choices for how to select dates. Customers may select the month, day or year portions of the date and use the spin (up/down) buttons to increment or decrement the values. Customers may enter a date manually. Customers may select the arrow button at the right of either field to display a popup calendar and choose the year, month and day as a calendar selection.
Ignore Year Select to have the year field treated as a wildcard. I.e., the same date or date range will subsequently be used every year. The Period definition may contain more than one date or range of dates.
Page 143
Defining Holidays
The steps to create a Holiday definition are listed following: Procedure 17: Creating A Holiday Definition Step 1: Select the Holiday leaf. (The Calendars section contains only one Holiday definition.) Step 2: Click on the New button and a highlighted area will be displayed with a Browse button. (The New button is the leftmost of the four buttons found at the right of the Holiday Definition caption.) Step 3: Click on the Browse button to display the Pick A Calendar Day dialog (see Figure 8.3, page 135). While the Pick A Calendar Day dialog includes options to select Calendar Formula (based on Every definitions) and Calendar Definitions, these are less applicable for Holiday Definitions than the Specific Date and Specific Weekday selections. Step 4:
Page 144
Specify a day or date customers want to treat as a holiday in conjunction with various period definitions. The default HOLIDAY calendar has three entries: 1/1/* or New Years Day, 7/4/* or Independence Day and 12/25/* or Christmas Day. Since each of these are fixed dates as opposed to movable holidays the asterisk (*) is a wildcard indicating these occur on the same date regardless of the year. Other common holidays such Memorial Day and Labor Day are commonly celebrated on a Monday but on a different date every year. In like fashion, Thanksgiving Day which falls on the 4th Thursday in November is also a moveable feast. These and other holidays must be entered as full dates. In other cases and in other countries other holidays and dates follow other rules. In Mexico, for example, Cinco de Mayo May 5th, Mexicos Independence Day is a fixed Holiday but July 4th is not observed. Thus, while holidays vary worldwide, the HOLIDAY definition is fully flexible and customizable for each region.
Menu Items
The menu items provided for defining Calendars are listed as the following: New Calendar Definition Click to create a new Calendar definition New Period Definition Click to create a new Period definition New Every Definition Click to create a new Every definition Save Click to save the Calendar definition Delete Click to delete the Calendar definition Rename Click to rename the selected Calendar definition Copy Click to copy the selected Calendar definition Test Click to test the selected Calendar definition Click on the right mouse button to display the drop-down menu box or access these options from the menu bar.
Page 145
Every Definition
An Every Definition may specify the first and third Mondays for the execution of a Job.
Period Definition
A Period Definition may specify three date ranges: 1 Jan to 17 Jan 4 Feb to 18 Mar 5 Oct to 19 Dec
Thus the above two examples the Every Definition and the Period Definition would interact by saying: IF today is the first or third Monday of 1 Jan to 17 Jan OR IF today is the first or third Monday of 4 Feb to 18 Mar OR IF today is the first or third Monday of 5 Oct to 19 Dec THEN Execute the Job that specifies these Period and Every Definitions.
Holidays Definition
A site may wish to run a Job on the first or third Monday, unless the day is listed in the Holidays Definition. If it is listed in the Holidays Definitions, then customers can specify a range of options, such as using the prior non-holiday date, skipping monitoring, and so on.
Page 146
How to Access
The menu items can be accessed in the following way: Click on the System, Job or Settings items on the menu bar. A drop-down menu list will be displayed. Click on an individual menu option to select.
In This Chapter
This chapter contains following sections: System Menu Job Menu Settings Menu
System Menu
The System menu options enable customers to backup and restore the database and use the forecast menu to schedule jobs. This section contains the following topics: Start or Stop Service Verify Database Backup Database Restore Database Import Database Scan Entire Network Refresh Time Zone Cache Quit Without Saving Changes
Page 147
Verify Database
Use this menu option to verify the integrity and consistency of the Argent Job Scheduler database across the network.
Backup Database
Performing a backup of the database is a routine function in any enterprise. Create offline storage for the Argent Job Schedulers objects database with this menu.
Restore Database
Use this menu option to restore a database from an existing backup.
Job Menu
The Job menu enables customers to perform a number of administrative and operational activities. and use the forecast menu to schedule jobs. This section contains information on the following topics: Submit Job Execute Manual Rollover Edit Job Class Table Create Job Forecast Archive Job List View Job History File
Submit Jobs
Use this menu to submit jobs for scheduling after customers have defined jobs and specified the server.
Page 148
Figure 9.1: The Manual Job Rollover Dialog The Manual Job Rollover dialog (J109) offers three options as: All of Todays Jobs rolls over all jobs with scheduled times later than the previous rollover and earlier than the next scheduled rollover. Partial Days Jobs rolls over all jobs with scheduled times from the present to the next scheduled rollover. Over a Range of Days From / To rolls over all jobs with scheduled times with a specified range of days. To change the From and To dates/times, either select the month, day, year, hour or minute and use the spin buttons to increment or decrement the values or click on the pulldown button (at the right of each date/time field) to display a calendar for selection.
Page 149
The job class properties options include: Job Class Select the job class from the pull down list of job classes. Default Username Shows the default username. The browse button can be used to select a domain to list usernames or to select a local username. Domain Shows the current or selected domain. Use Password If the default username is not selected; enter the appropriate password for the selected username. Execute job under guest account of the Argent Queue Engine This account allows the Job Scheduler to let the Queue Engine assign the account and password to the job. It is the easiest way to assign an W200x account to the job and is also handy where the job runs under an account that is local to the server where the Queue Engine resides. Job Class Permissions Shows the users or groups which have permissions for the selected job class and the specific permissions allowed to each user or group. Add Perm Sets permissions for an entire class of jobs. Delete Perm Deletes permissions for an entire class of jobs
Page 150
Figure 9.3: The Forecast of Scheduled Jobs Dialog A jobs forecast is used to manage the scheduling of jobs in the enterprise by preparing a list of batch jobs to be scheduled that will help customers in managing resources. The Forecast of Scheduled Jobs dialog is used to select and display pending jobs as: Start Date of Forecast Sets the starting date for the forecast. By default, this will be the current date. End Date of Forecast Sets the end date for the forecast. By default, this will be a date seven days (one week) later than the current date. The Start/End dates help in planning the profile of the batch workload and executing the jobs most effectively. To change the Start and End dates, either select the month, day or year, and use the spin buttons to increment or decrement the values or click on the pulldown button (at the right of each date field) to display a calendar for selection.
Page 151
Job Name Specify an individual job by name or use wildcards (* and ?) to select a series of jobs with similar names. By default, with no job name specified, all jobs are included. Include Jobs not included in Rollover Select to include jobs which have the Do Not Include This Job in Rollover flag set in the jobs J20B screen. Forecast Creates a forecast list using the specified dates and criteria. Stop Stop execution of the selected job. Job Definition Select a listed job and then click the Job Definition option to view the full job definition in the Argent Job Schedulers main window. Print Prints the Forecast Result List. View with Notepad Displays the Forecast Result List as a text file using the Notepad editor. This also allows the result list to be saved for later reference. Job Total Shows the total number of jobs in the Forecast Result List. Forecast Result List Displays the forecast jobs as a list see Figure 58 where the results can be sorted by clicking on any of the list headers. Two additional status columns Held and Rollover are displayed by scrolling right in the window.
Page 152
The Archive Job List can be selected by: Purging Filter Selected Includes only selected jobs. All Includes all jobs. From / To Selects only jobs between the From and To date/time specifications.
To change the From and To dates/times, either select the month, day, year, hour or minute and use the spin buttons to increment or decrement the values or click on the pulldown button (at the right of each date/time field) to display a calendar for selection. Job Status Ended Selects only jobs with an Ended status Failed Selects only jobs with a Failed status Aborted Selects only jobs with the Aborted status. Others Selects all jobs which do not have Ended, Failed or Aborted status.
Page 153
Settings Menu
The Settings menu items enable customers to general configuration and Queue Engine options. This section contains the following topics: Configuration Globally Update the Argent Queue Engine Server Settings Assign User Rights
Configuration Options
The Configuration menu items enable customers to select system configuration options. This section contains the following topics: System Options GUI Options Email Options Security Job List CPU Affinity Service Restart Backup Node Rollover & Archiving License
Page 154
System Options
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference. System Options window, Screen ID J1P.
Figure 9.5: System Options Window Use the System Options tab to set options. Access these by clicking on the tab. Home Path Specifies the location of the Argent Job Schedulers executable files such as tajs_gui.exe, i.e., the Argent Job Scheduler GUI. Database Specifies the location of the Argent Job Schedulers control files. The Argent Job Schedulers control files are used to hold control information that is created whenever users define objects, such as Jobs, Alerts, Macros, etc. Note: Do not use UNC PATH, i.e., it should be local to the system on which the Argent Job Scheduler is installed. Server Since the Argent Job Scheduler GUI can run on a server other than the Argent Job Scheduler Server, customers must specify this field if the current server is not the
Page 155
Argent Job Scheduler Server. The local server is assumed to be the Argent Job Scheduler Server unless another, fully-qualified location is specified. ODBC Setup The Argent Job Scheduler can use SQL 7.0 for its backend. The ODBC Setup shows the Data Source Name (DSN) used to connect to the SQL database. If the SQL option is not used, then this field reads Not Applicable Job List Refresh Interval The main Scheduler screen (J1) is updated in one of two ways; either by explicit user request (right-click and select Update Now) or by an automatic timer. This value defines the time interval, in seconds, that Job Scheduler will automatically update the Job List on the Scheduler screen. For example, if this value is set to 30, then the Argent Job Scheduler will automatically update the Scheduler screen every 30 seconds and any changes to any jobs status will be reflected on the Scheduler screen. Wait between Queue Engine Scans If the Argent Job Scheduler cannot establish communications with a server running the queue engine, then the server running the queue engine is said to have timed-out. This value specifies the time, in seconds, which the Argent Job Scheduler will wait for a response from the server running the queue engine before determining a timeout has occurred. This error is recorded on the main Scheduler screen. Sleep after Scheduling Cycle Determines the scan rate that used for calculating dependencies. Specifically, the Scheduler does not check dependencies like job, file, ODBC every second, this could put unnecessary stress on a system. Instead, it checks on an interval determined by this setting. Job Processing Thread Limit Specifies the maximum number of threads that can be created for processing a job. Job Limit Per Submission The number of jobs that can be submitted at one time. This would prevent a user from manually submitting too many jobs at once. Job Limit Per Session The number of jobs that can run during a rollover period. Like the Job Limit Per Submission, this can be used as a safety to prevent server overload. Log Screen Width Sets the width in characters for the job log screen. Debug Level There are three debug levels: 1,2,3. One (1) is the normal (default) setting while three (3) creates an extensive log for troubleshooting purposes. Selecting a debug level of 3 for logging during normal operations is not advised since this will fill the service log with unnecessary information and make the log harder to read. Log Size Limit Sets the maximum size in megabytes for the job log file. Delete Jobs Log When Job Is Deleted If selected - when the Argent Job Scheduler user explicitly deletes a job from the main Scheduler screen, the jobs actual the queue engine log will be deleted as well.
Page 156
GUI Options
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference. GUI Options window, Screen ID J2P.
Figure 9.6: The GUI Options Window Use this tab to set database and scanning parameters. Options are listed following: Save When Leaving New or Changed Record Check this feature box to save changes to an object (such as a job definition, an alert entry, or a macro) whenever the user changes from one tab to another tab, or from one leaf to another leaf. Show Warning Message on Delete Check this feature box to display a warning message prior to the Argent Job Scheduler object being deleted. Discard Incomplete Record Check this feature box to discard an incomplete record when the user moves from one tab to another tab, or from one leaf to another leaf.
Page 157
Application Maximized at Startup Check this feature box for the main the Argent Job Scheduler screens to be maximized at startup. Display Session Manager Registry Warning at Startup The Argent Job Scheduler uses Net Send extensively as part of the Argent Job Scheduler alerting. The Registry entry
System\CurrentControlSet\Control\SessionManager\SubSystems\Windows must have a
value that is greater than 512 in the part of SharedSection=1024,3072,nnn <nnn>= 512 Retain Job List Settings Check this feature box to retain the default settings every time the Argent Job Scheduler service is started. Show Warning Message if non_UNC file name is used for job Displays a warning message if the file name used for a job is not UNC compliant. Exclude Weekends For Product Day Exclude the weekends in the report Disable Splash Screen Not showing splash screen when GUI starts Show Job List After Submitting Job Switch to Job List screen (J1) after submitting an adhoc job. SuperMap Display Options It controls the dot size, text font and background color of SuperMap Enable Orthogonal Links It controls the job diagram style
Page 158
Page 159
Page 160
Email Options
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference. Email Options window, Screen ID J3P.
Page 161
The Configuration Email Options include: Send Test Message Use this facility to ensure that all the specifications have been set properly. This button creates a test message and sends that test message using the current options on the screen. This is a quick and easy way to test that the Email options are correctly set. Email Type This feature allows users to specify parameters for both Windows Messaging (Figure 62) and SMTP Email (Figure 63). While the Email Alert Definition controls which protocol is used, the parameters for each type of email must be defined here.
Page 162
Figure 9.8: Email Options for SMTP Protocol User ID The user name for the email account. The User ID and Password entries are subject to the rules of the SMTP mail server. While some mail servers do not require a user ID and password, others impose firm restrictions. Password User password for the email account. If the mail server does not require a password, this field can be left blank or may contain a bogus password. Some SMTP servers integrate the email account with the W200x account used to send the mail. In this case, the W200x password may be required as an entry. In any case, the password entry is stored in an encrypted state. SMTP Host The address of the SMTP email server; may be a NetBIOS name, an IP address or a DNS name. Examples are: SrvNotesNY2 198.114.66.150 Mail.CompanySMTP.com
This Site The return address, which will be added to the user ID. For example, if the user ID is John and the site is identified as Mycompany.com, the return address becomes [email protected].
Page 163
Security
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference. Security window, Screen ID J4P.
Figure 9.9: The Security Window Use this option to limit access of various groups of users to the Argent Job Scheduler Service. The Argent Job Scheduler has an integrated security system. This system uses standard 200x security to enforce the Argent Job Scheduler security. For example, a site can wish to limit the ability of some users to start or stop the Argent Job Scheduler service (The Argent Job Scheduler service is used by the Argent Job Scheduler to perform repetitive, or time-based activities, such as scheduling jobs on a repetitive basis).
Page 164
Security Sensitive Operations Specify which of the Argent Job Schedulers operational functions is to have security added. For example, the first entry is Service while other operations include: Backup/Restore, License, View GUI, Define SCHEDULER Database, Modify BATCH Settings and Modify Job Class. Explicit Groups Needed to Perform this Operation To restrict access to one or more valid 200x group names, simply select the user group(s) from the drop-down list. To add a new group, click on the icon to display the User Groups window. Select the user group to which the new user belongs and click Apply. For example, a site can define an 200x security group called the Argent Job Scheduler_SERVICE, and then specify the Argent Job Scheduler_SERVICE in the Security tab field Explicit Groups Needed to Perform this Operation. In this manner, only users with 200x accounts that explicitly are members of the 200x group the Argent Job Scheduler_SERVICE will be able to perform the Argent Job Scheduler Service functions. Description Displays a summary description of the Argent Job Scheduler operation selected in the Operations field. In this instance, the description for the Service operation reads: Start/Stop Service, Job Rollover, Job Control Panel, System-Wide Parameters, Service Restart Option, Service Failure Proof Option. Test Groups Against Security Requirement Use this tab to check out the privileges given to the user groups. Click on Test Groups Against Security Requirements button to display the Test Security Requirement window. If the Current Logon Account box is checked, then the privileges given to that user group are displayed. To check the privileges of other users, check the Current Logon Account box, and then enter the User Name, Domain and Password. The privileges are Service, Backup/Restore, License Update, GUI View, Define UI, Submit Job, Cancel/Delete/Rerun Job, and Setup Queue Engine Service. Current user is a member of Lists the groups to which the current user belongs.
Page 165
Job List
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference. Job List window, Screen ID J5P.
Figure 9.10: Job List Window The Argent Job Scheduler enables a site to customize the format of the main Scheduler screen (J1) by selecting the font and color of each job entry status line. For example, a site can send visual clues to operators regarding the status of jobs by using foreground and background colors and fonts.
Page 166
Show Jobs Externally Submitted Selecting this option will display queued jobs which were not submitted by this particular instance of the Argent Job Scheduler. If a job was submitted by the Argent Job Scheduler, the job will appear in the schedule screen (J1) as a normal job. Alternately, if a job is in the queue but does not appear on the schedule screen, then it is an external job. This option makes it possible to monitor jobs which may have been submitted manually to the Queue Engine or which may have been submitted by another instance of the Argent Job Scheduler (i.e., one executing on another machine). Also, a job submitted by the local instance of Scheduler might be considered an external job if: It has been removed from the schedule screen, either by automatic rollover, or manual archive/delete. The queue Retain Jobs option is set to retain an instance of the completed job for a long time. In this case, the job is no longer in the scheduler screen (J1) so it is considered External. Font Allows selection of the font (typeface) used to list jobs. Line Color Selection Allows selection of the foreground (text) color and the background color used to identify individual job types. Date Format This drop-down list box enables a site to specify the format of the dates displayed on the main Scheduler (J1)
Page 167
CPU Affinity
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference.
CPU Affinity window, Screen ID J6P.
Figure 9.11: The CPU Affinity Window Use this tab to restrict the execution of the Argent Job Scheduler GUI and the Argent Job Scheduler Service to a specific CPU. Check the boxes, specify the CPUs by checking the appropriate ones listed in the dialog box, and then click Apply. The CPU Affinity window lists CPU_0 through CPU_15 a total of 16 CPUs.
Page 168
Service Restart
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference.
Service Restart window, Screen ID J7P.
Figure 9.12: Service Restart Window Use this tab to specify restart options on the Argent Job Scheduler Service, and the Alerts to be fired if it fails. Run service in single-thread mode Specify whether customers want the job scheduler service to run in single-thread mode by checking the box. Minimum Time Duration Specify the minimum time in seconds the service must stay alive before it is counted as failed too soon. Maximum Restart Count Specify the maximum number of times job scheduler service may fail too soon before it is deemed Fails Too Frequently and a restart is no longer attempted. Alert to Fire if Service Fails Too Frequently Select the alert to be fired when service fails too frequently.
Page 169
Backup Node
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference. Important Note: See the Engineering Note available at www.Argent.com on Setting Up a Backup Engine for the Argent Job Scheduler Service Restart window, Screen ID J8P.
Figure 9.13: Backup Node Window The Argent Job Scheduler enables a site to have two the Argent Job Scheduler Services operating concurrently on two different 200x servers in the network to ensure that there is always one the Argent Job Scheduler Service running and processing the Argent Job Scheduler work. (The Argent Job Scheduler Service is used to perform repetitive or time-based activities, such as scheduling jobs on a repetitive basis.)
Page 170
The main, or primary, service processes the repetitive requests, while the back-up service on a second server is in sleep mode. Periodically, the primary the Argent Job Scheduler Service copies all of its control files to the backup service. This is done to ensure that the backup service has the most up-do- date files available, in the event it has to take over from the primary server. From time to time, the secondary service interrogates the primary service to ensure that the primary service and its server are running properly. If this turns out not to be the case, then the secondary service takes over. Current Node Name Displays the name of the current node. This node runs the primary service If the current node is the primary service node, then just check the box. If this feature box is checked, it indicates to the Argent Job Scheduler that this is the node on which the primary the Argent Job Scheduler service is executing. Main Service Node If the above feature box is not checked, then the current node is a secondary or backup node. This field specifies the name of the primary node, allowing the backup server to retrieve setup information. Failure-proof path for backup Should the service fail, specify the backup path to which the control files should be copied. This field specifies the UNC name of the node and directory where the Argent Job Scheduler control files are to be copied. Service status update frequency Specify in seconds how frequently the primary Argent Job Scheduler Service should update the status file. Service status checking frequency Specify in seconds how frequently the backup service should check the status file. If the status file is not updated for these many seconds, the backup server will assume that the primary server is down and take over the service. Alert to fire on service takeover Specify the name of the Argent Job Scheduler Alert to fire when the backup service finds that the primary node or the primary the Argent Job Scheduler service has failed. Export Control Files Use this tab to backup the files. Take care about specifying the path. The files will be copied into the directory specified.
Page 171
Figure 9.14: The Rollover & Archiving Window Options provided by the Rollover & Archiving dialog are: Execute rollover and archiving at Select the time of day (hours, minutes, seconds) to execute rollover and archiving. Radio buttons allow selection of rollover and archiving at Daily, Weekly or Monthly intervals or, using the Every option, at a specified interval of days. Important Note: The rollover signals the beginning of the job processes for the designated period. The conventional (and the default) time for a rollover to occur is at midnight (00:00). The individual job schedule is based on a day unit. Therefore, when the rollover is set to a non-midnight time, the job that is scheduled for that day may not appear on the schedule until the next days rollover.
Page 172
For example: if the Job Scheduler is configured to rollover at 12:00 PM, and a job is scheduled to run on Monday at 1:00 PM. The job will not appear on the Monday schedule, but will appear on the Tuesday schedule because the rollover is at 12:00 PM. Archiving Format Three archive formats are supported as: Excel comma delimited The comma-delimited format is compatible with Microsofts Excel spreadsheets but can also be imported by most databases. If selected, a path/file name must be supplied. Append to file Select to have new data appended to an existing file. Otherwise, any existing data recorded in the named file will be erased (the file will be truncated) before the new data is recorded. Argent Job Scheduler history file Creates a data file which can be viewed using the Argent Job Scheduler viewer. ODBC compliant database Creates a data file in a format compatible with an ODBC-compliant database. ODBC Setup Act as a pointer to the database to use Specify the ODBC drivers to use Specify security settings Specify the connection type (Named Pipes, TCP/IP, etc) for use Used to select or create a Data Source Name (DSN) which may:
Archive service log at the same time If selected, the service log is archived during the rollover and archiving operation. Delete archived job logs and prior system logs older than If selected, specify an age interval after which archived job and system logs can be deleted. Do NOT do automatic Rollover If selected, automatic rollover is disabled. Use this tab to set parameters to establish rollover and archiving frequency of jobs.
Page 173
License
The Screen ID Number is a numbered blue box in the upper right hand corner of each of the Argent Job Scheduler screens. This number identifies the screen for reference. Rollover & Archiving window, Screen ID J10P.
License is introduced in Argent Job Scheduler 5.0A-0607 and above. It controls what Queue Engine, iSeries Job Adapter and SAP server that Argent Job Scheduler GUI can connect to, and Argent Job Scheduler service can submit jobs to. Note: W200X/NT/UNIX Queue Engine and iSeries Job Adapter installation require its own license. SAP system does not need license installed on SAP server.
Page 174
Customers can set various parameters for a server running the queue engine to define how the server will execute jobs. Select this option by clicking on the Queue Engine icon on the tool bar or from the menu. Choose settings by checking the appropriate boxes. Customers can set: Default Queue Identifies the queue to be used if the default queue is specified in the Job Scheduler or Queue Engine job submission. System Log File An ASCII text file where all log details will be saved. Use the browse button (at right) to select a path and/or existing file. Log Size Limit Maximum size of the log file in kilobytes. Maximum Executing Jobs Maximum number of jobs, which can be executing at any one time. Maximum Job Processes Maximum number of job processes, which can be executing at any one time. The processes limit should always be larger than the jobs limit.
Page 175
Priority Quantum Sets the queue priority (0..255) used by the Queue Engine to allocate CPU workloads for queued jobs. Thus a low Priority Quantum places a queue in the slow lane while a high setting places a queue in the fast lane for execution. Job Number Wraps After Job Each job is assigned a job number by the queue engine. When the specified limit is reached, the job number rolls over to 1. System Boot Threshold The queue engine measures the uptime of the machine and compares this value to the boot threshold setting when the service starts. If the boot threshold is larger than the uptime value, the queue engine assumes that the server has just been rebooted. The results of this comparison are used in conjunction with the Startup Jobs option in the queue engine. Click OK to save the settings. To change these settings, follow the same procedure.
Page 176
Figure 9.17: The Assign Required User Rights Dialog To assign required user rights, simply select one or more user names by checking the boxes next to each name and then clicking the OK button. The log on as a batch job and log on locally rights are automatically assigned to the selected accounts.
Page 177
The username the job is running under The following command procedure excerpt displays a line containing information about the job: ECHO Job %TABF_JOB_NUMBER% was submitted by %USERNAME%. If the job containing this line was submitted by user TomD and was job number 1073, then the following would appear in the jobs log file: Job 1073 was submitted by TomD.
Page 178
Another way to implement error handling is to use the && (double ampersand) and || (double vertical bar) operators. The && operator causes the command that follows it to execute only if the command that precedes it succeeds. The || operator causes the command that follows it to execute only if the command that precedes it fails. The & (single ampersand) operator allows customers to combine multiple commands on the same line, and parentheses allow them to group multiple commands together as one. Using these special operators, the preceding example could be rewritten as follows:
dir \\PV1\testshare || (echo Error accessing PV1 & exit) dir \\TULSA\testshare || (echo Error accessing TULSA & exit) copy \\PV1\testshare\database.dat \\TULSA\testshare && goto success echo Error copying file exit
Page 179
:success echo The file has been copied from PV1 to TULSA
The UNIX command processor provides a simple means of implementing error handling in command procedures, through the use of the if $? constructs. This construct tests the exit code of the last executed command in the batch file. Based upon the convention that an exit code of 0 represents successful completion and a non-zero exit code represents an error, error handling can be set up as in this example:
cd /PV1/testshare if [ $? -ne 0 ] then echo Error accessing PV1 exit 1 fi cd /tulsa/testshare if [ $? -ne 0 ] then echo Error accessing TULSA exit 2 fi cp /PV1/testshare/database.dat /tulsa/testshare if [ $? -ne 0 ] then echo Error copying file exit 3 fi echo The file has been copied from PV1 to TULSA
Another way to implement error handling is to use the && (double ampersand) and || (double vertical bar) operators. The && operator causes the command that follows it to execute only if the command that precedes it succeeds. The || operator causes the command that follows it to execute only if the command that precedes it fails. The ; operator allows customers to combine multiple commands on the same line, and braces allow customers to group multiple commands together as one. If the commands are grouped in parentheses, instead of braces, the commands are executed in a separate shell. This would create a different effect in having the separate shell exit instead of the one that we are executing from. The shell script would continue without an error if the
Page 180
directory test failed. Using these special operators, the preceding example could be rewritten as follows:
# success is a shell function, written very much like a C function success() { echo The file has been copied from PV1 to TULSA } [ -d /PV1/testshare ] || { echo Error accessing PV1 ; exit 1;} [ -d /TULSA/testshare ] || { echo Error accessing TULSA && exit 2 ;} cp /PV1/testshare/database.dat /TULSA/testshare && success if [ $? -ne 0 ] then echo Error copying file exit 3
fi
Page 181
Network connections (device letters assigned to network sharepoints) may also be used in batch jobs, although there is a drawback to using them. The drawback is that all network connections that are established are effective across an entire computer. Thus, conflicts can occur if two batch jobs attempt to create network connections using the same device letter, or if a batch job tries to create a network connection using a device letter that the currently logged on user has already assigned. In these cases, the batch job that tries to create a network connection with a device letter that is already in use will receive the error message The local device name is already in use. However, if network connections are used carefully and standard and unique device letters are used for different jobs, then network connections can be a very useful way of accessing network resources. For example, the following command procedure excerpt performs the same compile operation as the previous example, but it does so through network connections instead of sharenames.
REM *** ESTABLISH NETWORK CONNECTIONS *** NET USE J: \\JP\MSVCNT || EXIT NET USE K: \\JP\PROJECT || EXIT REM *** SET INCLUDE PATH *** SET INCLUDE=J:\INCLUDE REM *** COMPILE THE SOURCE FILE *** J:\BIN\CL /C FILE.C REM *** DELETE NETWORK CONNECTIONS
Page 182
Note the addition of || EXIT after each of the NET USE commands. This causes the batch job to terminate if an error occurs in creating either of the network connections, rather than allowing the procedure to continue and possibly use a network connection that is mapped to an incorrect location.
Return Codes
Queue Engines provide customers the ability to notify a user, execute a job if job succeeds or execute a job if job fails depending on the jobs return code that is received. For example if Job1 completes with a return code that is not equal to zero then execute Job2. If Job1 completes with a return code that is equal to zero then notify user.
When customers submit the job, enter the parameters for the job in the Submit Job dialog box or use the /PARAMS qualifier with the QSUBMIT command, as in the following example:
C:> QSUBMIT C:\BAT\GET_FILE.BAT /PARAMS=FY94.DAT
If customers need to specify more than one parameter with the QSUBMIT command, separate the parameters with spaces and enclose them in quotes, as in this command:
C:> QSUBMIT C:\BAT\RENAME.BAT /PARAMS=NAME1 NAME2
When customers specify more than one parameter, the characters %1 in the batch file are replaced with the value of the first parameter, %2 is replaced with the value of the second parameter, and so on.
Page 183
Document Conventions
The following conventions are used to show the syntax of the commands: Text that must be entered exactly as shown is printed in a normal font, e.g.
QSUBMIT
Text that represents a value that customers must provide is printed in Italics, e.g.
QueueName
Text that is optional is enclosed within square brackets, e.g. [/ABORT] Vertical bars indicate one of many options may be used, e.g. QueueName |
JobNumber | /EXECUTING_JOBS
On-line Help
An on-line help screen for any Queue Engine command can be displayed simply by entering the command with the /? or /HELP qualifier. For example, to see a help screen for the QSUBMIT command, enter:
C:\> QSUBMIT/?
If the help screen scrolls too fast, use the MORE filter, as in this example:
C:\> QSUBMIT/? | MORE
Command Qualifiers
Most of the queue engines commands accept qualifiers, or switches, that modify the meaning of the command. Qualifiers begin with the forward slash character. Many qualifiers can specify values, which are given after an equals sign, as in /QUEUE=NIGHTLY. If customers want to specify a value that contains a space, enclose the entire value in quotes, as in the following example:
C:\> QCREATE QUEUE1/DESCRIPTION=Default queue
Qualifiers do not need to be spelled out in full. Customers only need to provide enough characters to make a qualifier unique. For example, customers may use /DESCR instead of /DESCRIPTION.
Page 184
The first QSHOW command in this example reported an error because the Queue Engine service was not running on the local computer. The second command was successful because a server computer was specified with the /SERVER qualifier. Here is an example of the second method, setting the TABF_SERVER environment variable:
C:\> SET TABF_SERVER=NT2 C:\> QSHOW Connecting to server NT2. Queue Name BACK BUILD NIGHTLY SQL Status Started, Open Started, Open Stopped, Open Started, Open Priority Description 20 Background job queue 100 Background build queue 100 Nightly processing queue 200 SQL query queue ---------------- ---------------- -------- --------------------------
In this example, the /SERVER qualifier was not required for the QSHOW command, because the TABF_SERVER environment variable had been set. This method is easier to use than the /SERVER method, because once the environment variable is set, all Queue Engine commands will automatically be directed to the correct server computer. In addition, customers could set the TABF_SERVER environment variable with the Control Panel System applet, so that it is set automatically when they log on.
Page 185
QCANCEL
The QCANCEL command cancels, aborts, or discards a job, depending on the current status of the specified job. Syntax
QCANCEL JobNumber [/ABORT] [/SERVER=ComputerName]
Qualifiers If the /ABORT qualifier is present and the specified job is executing, then the job is aborted. If this qualifier is not present, then this command returns an error if the job is executing. Terminating jobs is a potentially dangerous action, and, depending on the nature of the job that is terminated, it may cause loss or corruption of data. The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
C:\> QCANCEL 522
This example cancels job number 522. If the job is executing at the time this command is entered, then an error message is displayed and the job is not canceled.
C:\> QCANCEL 522/ABORT
Page 186
QCLOSE
The QCLOSE command closes a queue. When a queue is closed, it will not accept jobs that are submitted to it. Syntax
QCLOSE QueueName [/SERVER=ComputerName]
Qualifiers The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
C:\> QCLOSE LOW_PRI
This example closes the queue called QUEUE2 on server computer NT2.
Page 187
QCREATE
The QCREATE command creates a queue. Various queue properties can be specified when the queue is created, and they can also be changed at a later time with the QMODIFY command. Default values are used for any attributes that are not specified. The queue name may be up to 16 characters long, and may not contain any spaces. Syntax
QCREATE QueueName [/DESCRIPTION=string] [/PRIORITY=n] [/PENDING_JOBS=n] [/EXECUTING_JOBS=n] [/STOPPED | /STARTED] [/CLOSED | /OPEN] [/AUTO_START=hh:mm /AUTO_STOP=hh:mm] [/AUTO_OPEN=hh:mm /AUTO_CLOSE=hh:mm] [/SERVER=ComputerName] [/WORLDREAD] [/WORLDCONTROL]
Qualifiers The /PRIORITY qualifier specifies the priority for the new queue. This value may range from 0 to 255. The priority of a queue should represent its priority relative to other queues. More CPU time is given to jobs that execute in the queues with higher priorities. If this qualifier is not specified, a default priority of 128 is used. The /PENDING_JOBS qualifier specifies the pending jobs limit for the new queue. The pending jobs limit determines the maximum number of jobs that may be pending in the queue at one time. If this qualifier is not specified, a default of 32 is used. The /EXECUTING_JOBS qualifier specifies the executing jobs limit for the new queue. This value determines the maximum number of jobs that may be executing in the queue at one time. Typical values range from 1 to around 6 or 7. If this qualifier is not specified, a default value of 1 is used. The /STOPPED and /STARTED qualifiers specify whether the new queue is initially stopped or started. By default, a queue is started when it is created. The /CLOSED and /OPEN qualifiers specify whether the queue is initially closed or open. By default, a queue is open when it is created. The /AUTO_START and /AUTO_STOP qualifiers specify optional automatic start and stop times for the queue. If these are specified, then the queue is automatically started every day at the hour and minute specified by /AUTO_START and stopped every day at the time specified by /AUTO_STOP. Times are specified with these qualifiers in 24-hour time; for example, 6:30 means 6:30 AM, and 18:30 means 6:30 PM. If these qualifiers are not specified, then the queue has no automatic start and stop times.
Page 188
The /AUTO_OPEN and /AUTO_CLOSE qualifiers specify optional automatic open and close times for the queue. If these are specified, then the queue is automatically opened every day at the hour and minute specified by /AUTO_OPEN and closed every day at the time specified by /AUTO_CLOSE. Times are specified with these qualifiers in 24-hour time; for example, 6:30 means 6:30 AM, and 18:30 means 6:30 PM. If these qualifiers are not specified, then the queue has no automatic open and close times. The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. The [/WORLDREAD] qualifier allows the queue to be viewed by other users. If this qualifier is not specified, other users, except administrators, cannot view the jobs contained by the new queue. The [/WORLDCONTROL] qualifier allows the queue to be controlled by other users. If this qualifier is not specified, other users, except administrators, cannot delete, abort, or otherwise control the jobs contained by the new queue. Examples
C:\> QCREATE ABC
This command creates a queue called ABC, with default values for all queue attributes.
C:\> QCREATE QUEUE1 /DESCR=Default queue /PRIORITY=150 /PENDING_JOBS=30 /EXECUTING_JOBS=3
This command creates a queue called QUEUE1, with the description Default queue, a priority of 150, a pending jobs limit of 30, and an executing jobs limit of 3.
C:\> QCREATE NIGHTLY /DESCR=Nightly batch queue /PRIORITY=80 /PENDING_JOBS=50 /EXECUTING_JOBS=3 /AUTO_STOP=8:00/AUTO_START=18:30
This command creates a queue called NIGHTLY, with a priority of 80, a pending jobs limit of 50, and an executing jobs limit of 3. The queue will automatically stop every day at 8:00 AM and start every day at 6:30 PM.
Page 189
QDELETE
The QDELETE command deletes a queue, canceling any jobs in the queue. If the queue contains any executing jobs, the QDELETE command will not delete the queue unless the /ABORT_JOBS qualifier is used. Syntax
QDELETE QueueName [/ABORT_JOBS] [/SERVER=ComputerName]
Qualifiers The /ABORT_JOBS qualifier instructs the queue engine to abort any executing jobs in the queue in order to delete the queue. If customers do not use this qualifier, and the queue contains one or more executing jobs, then the Queue Engine does not delete the queue. The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
C:\> QDELETE QUEUE1
This example deletes queue QUEUE1. If the queue contains any executing jobs, then an error message is displayed and the queue is not deleted.
C:\> QDELETE QUEUE1/ABORT_JOBS
This example deletes queue QUEUE1, aborting any executing jobs in the queue.
Page 190
QMODIFY
The QMODIFY command modifies one or more of a queues properties. Syntax
QMODIFY QueueName /DESCRIPTION=string | /PRIORITY=n | /PENDING_JOBS=n | /EXECUTING_JOBS=n | /STOP | /START | /CLOSE | /OPEN | /AUTO_START=hh:mm/AUTO_STOP=hh:mm | /AUTO_OPEN=hh:mm/AUTO_CLOSE=hh:mm [/[NO]WORLDREAD] [/[NO]WORLDCONTROL] [/SERVER=ComputerName]
Qualifiers The /DESCRIPTION qualifier specifies a new description for the queue. The /PRIORITY qualifier specifies a new priority for the queue. This value may range from 0 to 255. More CPU time is given to jobs that execute in the queues of higher priorities. The /PENDING_JOBS qualifier specifies a new pending jobs limit for the queue. This value determines the maximum number of jobs that may be pending in the queue at one time. This value may range from 0 to 1000. The /EXECUTING_JOBS qualifier specifies a new executing jobs limit for the queue. This value determines the maximum number of jobs that may be executing in the queue at one time. This value may range from 0 to 100. Typical values range from 1 to around 6 or 7. The /STOP and /START qualifiers stop or start the queue, respectively. An alternate way to stop or start a queue is to use the QSTOP or QSTART commands. The /CLOSE and /OPEN qualifiers close or open the queue, respectively. An alternate way to close or open a queue is to use the QCLOSE or QOPEN command. The /AUTO_START and /AUTO_STOP qualifiers specify automatic start and stop times for the queue. These qualifiers must be specified together. If they are specified, then the queue is set to automatically start every day at the hour and minute specified by /AUTO_START and stop every day at the time specified by /AUTO_STOP. These qualifiers require 24-hour time values; for example, 6:30 means 6:30 AM, and 18:30 means 6:30 PM. The /AUTO_OPEN and /AUTO_CLOSE qualifiers specify automatic open and close times for the queue. These qualifiers must be specified together. Once these times are set, the queue will automatically open every day at the time specified by /AUTO_OPEN and close every day at the time specified by /AUTO_CLOSE. These qualifiers require 24-hour time values; for example, 6:30 means 6:30 AM, and 18:30 means 6:30 PM. The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer.
Page 191
The [/[NO]WORLDREAD] qualifier specifies whether the queue is to be viewed by other users. If /NOWORLDREAD is specified, other users, except administrators, cannot view the jobs contained by the new queue. The [/[NO]WORLDCONTROL] qualifier allows the queue to be controlled by other users. /NOWORLDCONTROL is specified, other users, except administrators, cannot delete, abort, or otherwise control the jobs contained by the new queue. Examples
C:\> QMODIFY QUEUE2/EXECUTING_JOBS=5
This example modifies queue NIGHTLY so that it automatically stops at 7:30 AM every day and starts at 7:00 PM every night.
C:\> QMODIFY CAD2/PRI=50
Page 192
QOPEN
The QOPEN command opens a queue. When a queue is open, and as long as it is not full, it will accept jobs that are submitted to it. Syntax
QOPEN QueueName [/SERVER=ComputerName]
Qualifiers The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
C:\> QOPEN LOW_PRI
Page 193
QREQUEUE
The QREQUEUE command moves a job from one queue to another queue. Syntax
QREQUEUE JobNumber /QUEUE=QueueName [/SERVER=ComputerName]
Qualifiers The /QUEUE qualifier specifies which queue to requeue the job to. This qualifier is required. The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
C:\> QREQUEUE 634/QUEUE=QUEUE2
This example moves job number 634 from the queue that it was previously in to queue QUEUE2.
Page 194
QSHOW
The QSHOW command displays information about a single queue, a single job, and all queues in the system, or all executing jobs. Syntax
QSHOW [/ALL | QueueName [/JOBS] | JobNumber | /EXECUTING_JOBS] [/SERVER=ComputerName]
Qualifiers The /ALL qualifier displays all queues in the system. This is the default if no qualifiers are specified. The /JOBS qualifier can be used with a queue name to display all of the jobs in the specified queue, along with the other queue information. The /EXECUTING_JOBS qualifier displays all jobs that are currently executing in queue. The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
C:\> QSHOW NIGHTLY
This command displays information about the queue called NIGHTLY, and also displays a list of all jobs executing and pending in the queue.
C:\> QSHOW 642
This command displays a list of all jobs that are currently executing in queue.
C:\> QSHOW /EXECUTING_JOBS /SERVER=MICRON
This command displays a list of all jobs that are currently executing on server computer MICRON.
Page 195
QSTART
The QSTART command starts a queue. When a queue is started, it will execute jobs that are pending in the queue. Syntax
QSTART QueueName [/SERVER=ComputerName]
Qualifiers The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
C:\> QSTART LOW_PRI
Page 196
QSTOP
The QSTOP command stops a queue. When a queue is stopped, it will not execute jobs that are pending in the queue. Syntax
QSTOP QueueName [/SERVER=ComputerName]
Qualifiers The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
C:\> QSTOP LOW_PRI
Page 197
QSUBMIT
The QSUBMIT command submits a job to a queue. The job is specified by its job file, which is either a command procedure (.CMD or .BAT) or executable (.EXE) file. If this command is being used on the server computer, i.e. the computer on which the Queue Engine service is running, then the current drive and directory is used if the drive or directory is not specified. If the command is being used to submit a job to a remote Queue Engine server computer, then the full filespec, relative to the queue engine server computer, must be used. Syntax
QSUBMIT JobFile [/QUEUE=QueueName] [/NAME=Name] [/PARAMS=Params] [/LOG_FILE=Filename] [/NOLOGNUMBER] [/USER=[Domain\] Username] [/PASSWORD=Password] [/AFTER=Time] [/EVERY=hh:mm] [/NOTIFY=Username | /NONOTIFY] [/NODETECT] [/[NO]WORLDREAD] [/[NO]WORLDCONTROL] [/SERVER=ComputerName]
Qualifiers The /QUEUE qualifier specifies the queue to submit the job to. If this qualifier is not specified, then the job is submitted to the default queue, which is set by the system administrator with the /DEFAULT_QUEUE qualifier of the QSYSTEM command. The /NAME qualifier specifies an alternate name for the job. If this qualifier is not used, then the jobs name is derived from the filename of the job file. The /PARAMS qualifier allows customers to supply parameters for the job. Parameters are used in batch files by using the special characters %1, %2, %3, etc. If customers need to specify more than one parameter for a job, then enclose the parameters in quotes and separate them with spaces. The /LOG_FILE qualifier specifies an alternate name for the jobs log file. If this qualifier is not used, then the jobs log file has the same name as the job filespec, except with a file type of .LOG. Also, if /NOLOGNUMBER is not used, then the Queue Engine service appends the jobs job number to the log filename. The /NOLOGNUMBER qualifier instructs the Queue Engine service not to append the jobs job number to the log file filename. By default, the Queue Engine service does append the job number, as in C:\TEST\JOB.LOG.753, in order that the filenames will be unique even if the base paths and filenames are the same for two different jobs. The /USER qualifier specifies the user account which the job runs under. If this qualifier is not specified, then the submitting users account is used. Either a username or a username and domain name may be specified. If a username but no domain name is specified, then the submitting users domain name is used. A password must be specified in order to run the job under an account other than the submitting users.
Page 198
The /PASSWORD qualifier specifies a password to associate with the jobs logon session when the job is executed. A password is required if the job file is located on a computer other than the Queue Engine server computer, or if the job must access network resources. The password must be correct at the time the job is started, or the job will fail to start. The /AFTER qualifier specifies a time after which the job may be started. The time value may be in absolute or relative time format, and various parts of the time value may be omitted. Here are some examples:
Time Value
18:00 3-APR-1994:18:00 3-APR-1994 +:30 +1:30 +2:00 +1 +1-6:00
Meaning
6:00 P.M. today 6:00 P.M. on April 3, 1994 Midnight just before April 3, 1994 30 minutes from now 1 hour and 30 minutes from now 2 hours from now 1 day from now 1 day and 6 hours from now
The /EVERY qualifier specifies a time interval at which the job is repeated. For example, if a value of 24:00 is used, then the job will be executed every 24 hours. The /NOTIFY qualifier specifies an alternate user to be notified when the job starts and completes. The /NONOTIFY qualifier specifies that no user is to be notified. If neither of these qualifiers are specified, then the user who submitted the job is notified. The /NODETECT qualifier instructs the Queue Engine not to automatically detect if the job is waiting for keyboard input, and then abort it. If this qualifier is not specified, then the Queue Engine automatically detects when a batch job is waiting for keyboard input, and aborts the job. The /EXIT_CODE_FILE qualifier specifies a file from which the Queue Engine takes the jobs exit code. If this is not specified, then the jobs exit code is set to the exit code returned from the jobs main process. If the qualifier is used, then the specified file is expected to exist after the job has completed, and contain a one- to four-digit ASCII string representing a decimal number, such as 1234. Values of zero to 8,999 are allowed. If the Queue Engine cannot read the exit code file, it sets the jobs exit code to one of the following special values:
Page 199
Meaning
The exit code file was not found General error reading file Incorrect syntax in the file Access to file denied Sharing violation (file in use by another process)
The /FAIL_EXIT_CODE qualifier specifies what exit code values constitute failure for the job. For example, GT0 means that exit codes greater than zero constitute failure for the job. GT represents greater than, LT represents less than, EQ represents equal to, and NE represents not equal to. The /SUCCESS_JOB qualifier specifies a batch file or executable to execute if the job succeeds (meaning if the job completes with an exit code not defined as failure) The /FAIL_EVENT qualifier specifies that an event should be reported to the system log on the Queue Engine server computer if the job fails (meaning if the job completes with an exit code defined as failure) The /FAIL_NOTIFY qualifier specifies that a user should be notified via the W200x Messenger Service if the job fails (meaning if the job completes with an exit code defined as failure) The /NOWORLDREAD qualifier specifies that even if the queue to which the job is submitted creates jobs with world read access as its default, this job is not to be created allowing Everyone read access to the job. The /NOWORLDCONTROL qualifier specifies that even if the queue to which the job is submitted creates jobs with world control as its default, this job is not to be created allowing Everyone full control of the job. The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
C:\> QSUBMIT PAYROLL
This example submits the batch file PAYROLL.BAT in the current directory to the current default queue. The job log file created when the job executes will be called PAYROLL.LOG in the same directory.
C:\> QSUBMIT /QUEUE=NIGHTLY \CAD\MANDEL.EXE
This example submits the executable MANDEL.EXE in the CAD directory to queue NIGHTLY. The job log file created when the job executes will be called MANDEL.LOG.JobNumber and will also be located in the CAD directory.
Page 200
This example submits the batch file D:\TOMD\NIGHTWRK.BAT to queue NIGHTLY. When the job completes, user HARRYF will be notified.
C:\> QSUBMIT PAYROLL.BAT /LOG=C:\JOHNV\PAYROLL.LOG
This example submits the batch file PAYROLL.BAT in the current directory to the current default queue. The job log file created when the job executes will be called PAYROLL.LOG in directory C:\JOHNV\PAYROLL.LOG.
C:\> QSUBMIT D:\ACCT\PAYROLL.BAT /SERVER=ARIES
This example submits the batch file PAYROLL.BAT in directory D:\ACC\ to server computer ARIES. Note that the job filespec is relative to the server computer. This means that the filespec refers to drive D: and directory ACCT on ARIES, not on the computer where this command was entered.
C:\> QSUBMIT WORK.EXE /AFTER=18:00
This example submits a job called WORK.EXE to the default queue, to be started no sooner than 6:00 P.M. today.
C:\> QSUBMIT WORK.EXE /AFTER=+2:00
This example submits a job called WORK.EXE to the default queue, to be started in two hours.
C:\> QSUBMIT C:\JOBS\BACKUP.CMD /QUEUE=SYSJOBS /AFTER=22:00 /USER=BackupAcct /PASSWORD=12345
This example submits a backup job to start at 10:00 P.M. tonight, which will run under the user account called BackupAcct.
C:\> QSUBMIT \\NT1\BUILD\BUILD1.CMD /QUEUE=BUILDS /USER=DEV\tomd /PASSWORD=12345
This example submits a build job, which will run under the user account called tomd.
C:\> QSUBMIT D:\BAT\GET_FILE.BAT /PARAMS=FY94.DAT
Page 201
QSYSTEM
The QSYSTEM command allows the system administrator to control the queue system. Most of the functions of this command are, by default, available only to members of the Administrators or Domain Admin group on the Queue Engine server computer. Syntax
QSYSTEM [/SHOW | /START | /STOP | /PAUSE | /CONTINUE | /DEFAULT_QUEUE=QueueName | /NO_DEFAULT_QUEUE | /LOG_FILE=Filename | /LOG_SIZE_LIMIT=KBytes | /KEY=LicenseKey] /MAX_EXEC_JOBS /MAX_JOB_PROCESSES /LICENSE [/SERVER=ComputerName]
Qualifiers The /SHOW qualifier displays information about the Queue Engine service. This information includes the current state of the service and the filenames of the system log file and the system settings file. This is the default if no qualifiers are specified. The /START qualifier starts the Queue Engine service. The service must be started in order for any other the Queue Engine commands to work. When the product is first installed, the Queue Engine service is configured to start automatically at system startup, so it is not necessary to manually start it every time the computer boots. The /STOP command stops the Queue Engine service. When the service is stopped, no other the Queue Engine commands will work. Stopping the Queue Engine service is a dangerous operation, because all jobs that are executing when the service is stopped are terminated. If customers need to halt the service for any reason, it is much safer to pause it using the /PAUSE qualifier. The /PAUSE qualifier pauses the Queue Engine service. When the service is paused, all jobs that are executing will continue to execute, but no new jobs will be started. Also, if any user tries to use the Queue Engine command, it will display a message saying that the Queue Engine service is paused. The /CONTINUE qualifier continues, or unpauses, the Queue Engine service, allowing it to resume normal operation. The /LICENSE qualifier displays installation and license information about a Queue Engine server computer. The /MAX_EXEC_JOBS qualifier sets the maximum executing jobs value for the queue engine server. When this number of jobs are executing on the server in all queues combined, then no new jobs are started. This value may be increased or decreased depending on the amount of memory and other system resources available to the server.
Page 202
The /MAX_JOB_PROCESSES qualifier sets the maximum number of processes among all executing jobs for the queue engine server. When this number of processes exists among all executing jobs, then no new jobs are started. This value may be increased or decreased depending on the amount of memory and other system resources available to the server. Note that the actual number of job processes on a Queue Engine server may temporarily exceed this limit, because although no new jobs are started, jobs, which are already executing may create more processes. The /DEFAULT_QUEUE qualifier sets the default queue for the product. The default queue is the queue that jobs are submitted to if no queue name is specified in the QSUBMIT command. Usually, customers will want to set the default queue to a middle of the road queue, one with a moderate priority and executing jobs limit. The /NO_DEFAULT_QUEUE qualifier clears the default queue. When no default queue is set, a queue name must be specified in order to submit a job. The /LOG_FILE qualifier changes the name and/or location of the queue engine system log file, which records entries about all events in the queue system. By default, the queue engine system log file is called SVC_LOG.TXT, and it is located in the \Argent\QueueEngine\Log directory. The /LOG_SIZE_LIMIT qualifier changes the size limit of the queue engine system log file. This value determines the maximum size, in kilobytes, that the system log file is allowed to reach. When the file reaches the size limit, the old one is renamed and a new one is started. By default, the queue engine system log file size limit is set to 512K, or one-half megabyte. The /KEY qualifier installs a new product license key. This qualifier should only be used when a representative of Argent Software Inc gives customers a license key. The /SERVER qualifier specifies the name of a Queue Engine server computer. If this qualifier is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
C:\> QSYSTEM /SHOW
This example will cause the queue engine service to pause. When the service is paused, queues will not start any pending jobs, and the queue engine commands and the queue engine Main GUI functions will not work.
C:\> QSYSTEM /CONTINUE
Page 203
This example starts the queue engine service on the queue engine server computer named ARIES.
C:\> QSYSTEM /DEFAULT_QUEUE=HIGH_PRI
Page 204
Queue Engine
The Scheduling System consists of two components that customers should now be familiar with: The Queue Engine and The Scheduler Engine. Both components consist of a server and a client. The normal installation will configure a server and install the service account. Because the Queue Engine runs in the background, it runs as a service, and as such requires an account to log in as. The service account must have administrative privileges; the rationale being the tasks being performed by this account are usually reserved to administrators. On the other hand, the client installation only installs the files necessary to connect to a server; there is no service account under a client installation (since no services are being installed). The Queue Engine server is installed on all servers that customers wish to run jobs on. This is a crucial concept. Lets say it together: jobs on the Queue Engine server(s). Every job that must run on a specific server requires a separate Queue Engine installation. Customers will almost never need to install the queue engine client; they can however if that is their preference. The minimum installation any site requires is a normal (service) installation of the Queue Engine.
Scheduler Engine
The Job Scheduler consists of a server and a client. In most cases the server and client are installed on the same machine. If customers plan on using advanced scheduling features the minimum installation required is a normal (service) installation of the Queue Engine and a normal (service) installation of the Job Scheduler. Besides the advanced scheduling features which have been covered throughout this manual, the Scheduler Engine allows customers to install a client on the desktops of users who need to schedule jobs regularly (not execute the jobs - jobs are executed by Queue Engines). Before installing a remote client they must already have installed the Scheduler Engine as a service (normal installation) on a server. This is the Job Scheduler server, which additional clients will connect to. The client portion is exactly the same as the Main GUI described in this manual; in most cases they are using the client to connect to the server, both of which exist on the same computer. The question I am frequently asked is, If I install the client on the desktops of 3 different users, will they see each others jobs? The short answer is yes and the long answer is it depends.
Page 205
Every client that connects to the same server is sharing the same database; it is in this database that all the Job Classes, alerts, macros, calendars and what-not are stored. So in a default installation (no changes in configuration) any clients that connect to a similar server will be able to see all the jobs in the shared database. Customers can set security through the use of job classes; a job class can be tied to a specific W200x user group, which is allowed to control that class and all the jobs within it. They can also have separate installations of Job Scheduler servers; in this case there will be two unique databases that will not be related to each other in any way, and any clients connecting to a server will only see the jobs on that server. Customers might want to go this route if they have two or more departments with user submitting jobs that are unrelated to each other. Here is the next important point to remember: the Scheduler Engine simply submits jobs to one or more Queue Engines. It does not run these jobs - jobs are executed by Queue Engine(s). The Scheduler Engine connects to the Queue Engine(s) that customers have specified and when the time comes the jobs that are supposed to run are executed on the appropriate Queue Engine server. The Scheduler Engines role is to keep track of schedule and ensure jobs run when and where they are supposed to.
Rollover
This is a crucial concept. By default, rollover (and archiving) occurs everyday at midnight. Customers can change this within System Configuration in the Scheduler Engine. Rollover is the crux of a job scheduling system; it allows customers to define a schedule for a job and gives them peace of mind in the sense that they know this job will run on everyday that it should, without customers intervention. Without a rollover feature customers are forced to submit jobs to the schedule everyday which can be tedious if there are hundreds of jobs to be run. By default, at midnight all the jobs that are supposed to be run that day appear in the schedule. This is the softwares automation at work; any job flagged to be Included in rollover will be automatically placed in the schedule on its given days. Remember, by default a job will be included in rollover; customers must manually specify otherwise. A job that runs automatically thanks to rollover is the opposite of an ad-hoc job. An ad-hoc job is a job that customers have manually submitted to the schedule, usually via a rightclick and choosing Submit Job to Schedule. While this is fine for testing, reliance on this feature defeats the purpose of rollover and automation; in a job scheduler customers shouldnt have to submit jobs every day since that is the schedulers job. After customers have completed the testing phase of the product they should flag most of their jobs to be included in the rollover, and let it run its course. Customers can then see the power of the software at work. As noted in the documentation, we have included a Job Forecast feature that allows customers to see their projected schedule for a date range they specify. By using this they can then ensure that their rollover jobs follow the schedule they intended.
Page 206
Background Jobs
Another crucial concept a job scheduler by nature is designed to run jobs in the background, as opposed to the foreground or interactively. Thus, a job requiring mouse or keyboard input will not work (without modification) in our scheduler. It is important to remember that this is not an issue or a design flaw; it is quite the opposite. Any job requiring user intervention cannot be run in the background; how would customers accommodate running a job everyday at 4AM (besides enraging the tech that drew this onerous assignment)? A good rule of thumb is any job that can be run under the AT command (without the interactive switch) can be run under the Job Scheduler. This includes perl scripts, VB apps, FTP transfers, etc
Security
By default, all jobs submitted via the Scheduler Engine will be run under the context of the Default Account. This account is specified in Configuration within the Queue Engine and by default it is the same as the service account. While this facilitates testing and will be appropriate for most networks, customers security needs may be more stringent. In this case customers have two options. First, customers can explicitly state a username/password combination to use for every job they define. Secondly, customers can supply a username/password for each specific Job Class they create and have each job use this combination. Our security features dont end here; within the Scheduler Engine customers can assign specific duties to different user groups. In this way customers can have regular users only able to view the GUI, whereas an administrator might have full run of the program. These settings can be adjusted in the Security tab of System Configuration.
Page 207
Page 208
statement associated with a user, it may not be found by the job when run in the schedule. Why? Because, when a process is launched from an W200x service, the search path does not contain references that are linked to a particular user. This can be easily resolved, however, by adding the reference to the system path in W200x. Server names Has a server name been changed? Although this may appear obvious, it can be the source of the job failure. New software installed The most obvious cause may be the software related to the actual batch job. During installation, many applications may share dlls (and many replace existing dlls but not always with the correct versions) or make modifications to the environment or the registry that can affect the functions of other processes.
Step 2: Run the Job Directly From the Argent Queue Engine
Did the job fail to start? Or did it start, and then fail? There is a definite difference between these two. If the job fails to start, the issue is likely to be in the way that the job is defined, or in file permissions. If the job starts, then fails, look first at the batch job. What to Check If the Job Fails To Start Job/log path Is the job there? If the job is using a local path, is the job file local to the server where Argent Queue Engine is installed? Check to make sure the log file and/or directory is accessible A common error is to specify a log file or directory that either doesnt exist or is not accessible by the batch jobs account Mapped Drives The path cannot use a mapped drive unless the drive is mapped in the job with the Net Use command. A mapped drive is linked to a specific login and cannot reliably be used by a batch job if it is not specifically created and deleted within that batch job. UNC paths are the preferred method. Check the Queue Engine log The queue engine log will report errors on this level for example, if the jobs log directory is in error, this message will be reported in the queue engine log: For example:
Sat Jul 15 13:25:53 Job JOB1 (J000026) is successfully submitted by user NTECH\JEFF. Sat Jul 15 13:25:54 Launcher cannot create the jobs log file: D:\ARGENT\WrongDirectory\JOB1_J000026.TXT, Error: 3, Job JOB1 (J000026), Line#: 113 Sat Jul 15 13:25:54 Process of job JOB1 (J000026) failed because of failure of creating job log file
Page 209
Check W200x Accounts Does the account exist? Is the password correct? Queue engine error number 68 indicates a bad account or missing or incorrect password. Remember; make sure the keyboard caps lock is not on when the password is entered. Is the account missing a required user right? Queue engine error number 67 indicates that the account is missing either the Log on locally, or the Log on as a batch job right. If the W200x account valid? Queue engine error 71 indicates that the account has been locked out by 200x security. Is the account allowed to log in at this time? Does the account have Time of Day login restrictions? Is it a domain account, or a local account? Mixing domain and local security can cause confusion. Basic security rules for Windows 200x will always apply, and will not bend! A common error is to use two accounts, one local and one domain account that have the same name, but different passwords. If these accounts are mixed up, the wrong account may be specified for the batch job. Proper naming conventions are always a good practice. A good example of why naming is important can be illustrated by a conversation overheard in tech support:
Tech Support: What does the error say? Operator:
Tech Support: What is the name of the local account you are using? Operator:
Needless to say, even though consistent, this naming system did not lend itself to simplified debugging.
Page 210
If a local account, does the account exist on the server where the queue engine is running? A local account is exactly that, local to the server, and not welcome or even recognized outside of that server. Run Job Validation from job definition in the Argent Job Scheduler The Argent Job Scheduler Job Validation feature quickly checks a number of settings critical to the batch job. Validation will tell customers: Account validity (if specified on the job level)
Job file path Does the job exist? Note: if the job uses a local path, and the queue engine is not on the same server as the job scheduler, then the test will be invalid. Queues Do the queues exist? Are they started and open? Recursion Is there an infinite loop somewhere in the job definition?
What to Check If the Job Hangs Does the job continue to use CPU time? If the job starts, but uses little or no CPU resources, then this is an indication that the job is running into trouble early. This would point to dll issues, or some sort of user interaction early in the job, perhaps a login screen or a connection error. Does the job require user interaction? Each batch job runs in a separate environment. The job has its own login, and its own desktop. If a window is displayed, it is on this virtual desktop and will not be seen. So, if a window is displayed by the job that requires user interaction to continue, the job will hang. An example of this is a batch job using MS Access that hangs because the Office Assistant help icon is enabled. Is this a good thing? Yes since running this way provides many more advantages including stability, versatility, and security. Applications designed to be run in a scheduled environment often already have options that allow them to run silent or unattended. Does the job use asynchronous processes? Jobs that query or move data in a database may fail intermittently if the process that manipulates the data is asynchronous. An asynchronous data function returns control to the primary process before it is finished. For example, consider a VB program using ADO (Active Data Objects) to query a SQL server table and return results. This particular job completes successfully as a batch job during testing, but fails in production. This same job will also complete successfully if launched manually. The reason for this is that the test data set is small enough for the query to complete before the jobs primary process has ended. When the production jobs query runs, it takes longer to complete than the main process. Because the job is
Page 211
running as a background process, the dialog box asking if the query should continue cannot be seen. A common symptom of this issue is a job that ends with a return code of 128; an W200x error code with the error text No child processes to wait for. Another symptom is when the job runs successfully with a small data set, but fails with larger data sets. Some older database utilities had issues with asynchronous processes but most have issued service packs to address the issue. Why cant I see my job run? It should show a window. By definition a batch job is not interactive. If all the batch jobs a server was running showed on the desktop, then the server would be unusable. This could also pose a potential security risk since a user with access to the terminal could then interact with a batch job and change it. In addition, creating batch jobs requiring human interactions would fundamentally defeat the purpose of automating tasks. Logs A variety of logs are maintained for different tasks. These include job logs, server logs, Scheduler logs and W200x event logs. Job Logs The Argent Queue engine generates a log for each job that it executes. Look at the original job definition to find out where the log was generated. What to Look For In the Job Log The log file or job command file may be unreachable Permissions issues Job ended unexpectedly Unrecognized file name Return codes For Queue Engine specific codes: see Argent documentation; for Job Specific codes: see specific jobs documentation; for W200x error codes: use the utility command: NET HELPMSG error#. The Debug Option From the command-line type QSYSTEM /DEBUG. The log will contain detailed internal debugging info. Because this debug option is designed for debugging only, leaving it enabled will result in large, difficult to read job logs.
Page 212
What to Look For In Argent Queue Engine Server Log W200x Security issues Server out of disk space License Key expired
Common Queue Engine Error Codes 68: Bad account or password This always means that there is a bad account or mistyped password. 67: Log on as a batch job right is missing The account is missing a required advanced user right such as Log on as a batch job and/or Log on locally. Remember, even an Admin account needs to have these rights explicitly granted. 71: Account locked out The W200x account has been locked out.
Common W200x Error Codes 5: Access Denied Inadequate permissions on a W200x resource.
Page 213
Document Conventions
The following conventions are used to show the syntax of the commands: Text that must be entered exactly as shown is printed in a normal font, e.g. qsubmit Text that represents a value that customers must provide is printed in Italics, e.g. Text that is optional is enclosed within square brackets, e.g. [/ABORT] Vertical bars indicate one of many options may be used, e.g. QueueName |
QueueName
JobNumber | /EXECUTING_JOBS
On-line Help
An on-line help screen for any Queue Engine command can be displayed simply by entering the command with the -? or -h option. For example, to see a help screen for the qsubmit command, enter:
$ qsubmit -h
If the help screen scrolls too fast, use the MORE filter, as in this example:
$ qsubmit -? | more
Command Options
Most of the queue engines commands accept options (options), or switches, that modify the meaning of the command. Options begin with the dash character. All options must precede any other argument used with the command. Many options can specify values, which are given after a space, as in q NIGHTLY. If customers want to specify a value that contains a space, enclose the entire value in quotes, as in the following example:
$ qcreate D Default queue queue1
Notice that the options are placed before the queue1 argument. All commands support the h and -? options that print out information about using the particular command.
Page 214
Queue Names
The Queue Engine handles queue names with upper case letters. The user may specify queue names on the command line with either upper or lower case letters.
Stopped, Open
The first qshow command in this example reported an error because the Queue Engine service was not running on the local computer. The second command was successful because a server computer was specified with the s option. Here is an example of the second method, setting the TABF_SERVER environment variable:
$ export TABF_SERVER=nt2 $ qshow Connecting to nt2. Queue Name Status Owner Description ---------------- ---------------- -------- --------------------------
Page 215
Started, Open
swr
Started, Open swr Background build queue Stopped, Open swr Nightly processing queue Started, Open swr SQL query queue
In this example, the -s option was not required for the QSHOW command, because the TABF_SERVER environment variable had been set. This method is easier to use than the -s method, because once the environment variable is set, all Queue Engine commands will automatically be directed to the correct server computer. In addition, customers could set the TABF_SERVER environment variable in their .profile, so that it is set automatically when they log on.
QCANCEL
The QCANCEL command cancels, aborts, or discards a job, depending on the current status of the specified job. Syntax
qcancel [-a] [-s ComputerName] JobNumber
Options If the a option is present and the specified job is executing, then the job is aborted. If this option is not present, then this command returns an error if the job is executing. Terminating jobs is a potentially dangerous action, and, depending on the nature of the job that is terminated, it may cause loss or corruption of data. The -s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
$ qcancel 522
This example cancels job number 522. If the job is executing at the time this command is entered, then an error message is displayed and the job is not canceled.
$ qcancel a 522
Page 216
QCLOSE
The QCLOSE command closes a queue. When a queue is closed, it will not accept jobs that are submitted to it. Syntax
qclose [-s ComputerName] QueueName
Options The s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
$ qclose LOW_PRI
This example closes the queue called QUEUE2 on server computer NT2.
QCREATE
The QCREATE command creates a queue. Various queue properties can be specified when the queue is created, and they can also be changed at a later time with the QMODIFY command. Default values are used for any attributes that are not specified. The queue name may be up to 16 characters long, and may not contain any spaces. The Queue Engine handles queue names with upper case letters. The user may specify queue names on the command line with either upper or lower case letters. Syntax
qcreate [ -D string ] [ -k ] [ -M 0NNN ] [ -p N ] [-s ComputerName ] [ -a hh:mm -b hh:mm ] [ -m hh:mm -n hh:mm ] [ -h ] [ -? ] [ -c | -o ] [ -t | -u ] [ -C N ] [ -e N ] [ -j N ] QueueName
Options The -D option specifies a description for the queue. The p option specifies the priority for the new queue. This value may range from 0 to 255, with 0 being the lowest priority. The default is 128. The j option specifies the pending jobs limit for the new queue. The pending jobs limit determines the maximum number of jobs that may be pending in the queue at one time. If this option is not specified, a default of 32 is used.
Page 217
The e option specifies the executing jobs limit for the new queue. This value determines the maximum number of jobs that may be executing in the queue at one time. Typical values range from 1 to around 6 or 7. If this option is not specified, a default value of 1 is used. The -C option sets the Queue Affinity to processor N. If this parameter is set then jobs created from this queue will only execute on processor N on an SMP machine. The -t and -u options specify whether the new queue is initially stopped or started. By default, a queue is started when it is created. The c and -o options specify whether the queue is initially closed or open. By default, a queue is open when it is created. The -a and -b options specify optional automatic start and stop times for the queue. If these are specified, then the queue is automatically started every day at the hour and minute specified by -a and stopped every day at the time specified by -b. Times are specified with these options in 24-hour time; for example, 6:30 means 6:30 AM, and 18:30 means 6:30 PM. If these options are not specified, then the queue has no automatic start and stop times. The -m and -n options specify optional automatic open and close times for the queue. If these are specified, then the queue is automatically opened every day at the hour and minute specified by -m and closed every day at the time specified by -n. Times are specified with these options in 24-hour time; for example, 6:30 means 6:30 AM, and 18:30 means 6:30 PM. If these options are not specified, then the queue has no automatic open and close times. The -s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. The M option is used to set the permissions Mode of the Queue. The mode setting follows the UNIX permission mode model (see chmod(2)). There are read, write, and execute permissions afforded to three different classes of user: The Queue owner. Any member within the same group as the Queue owner. All others.
If a user has read permissions for a Queue, that user may list the jobs associated with the Queue. If the user has write permissions, that user may submit jobs to that Queue and delete jobs from that Queue. If the user has execute permissions, that user may open, close, stop or start that Queue. Generally the owner of a Queue has Read, Write, and Execute permissions for that Queue. Only the owner, or root, can change the permissions pertaining to a Queue. When a Queue is created default permissions are Read, Write, and Execute for the owner. Anyone else only has Read permissions (rwxrr--). Examples
$ qcreate ABC
This command creates a queue called ABC, with default values for all queue attributes.
Page 218
This command creates a queue called QUEUE1, with the description Default queue, a priority of 150, a pending jobs limit of 30, and an executing jobs limit of 3.
$ qcreate d Nightly batch queue p 80 j 50 e 3 b 8:00 a 18:30 NIGHTLY
This command creates a queue called NIGHTLY, with a priority of 80, a pending jobs limit of 50, and an executing jobs limit of 3. The queue will automatically stop every day at 8:00 AM and start every day at 6:30 PM.
QDELETE
The QDELETE command deletes a queue, canceling any jobs in the queue. If the queue contains any executing jobs, the QDELETE command will not delete the queue. The QCANCEL utility must be used first to abort any running jobs. If a job number is used instead of the name of a queue, that job will be deleted from whatever queue it is associated with. Syntax
qdelete [-n N] [-s ComputerName] QueueName|JobNumber
Options The n option will direct the Queue Engine to delete N number of jobs beginning with JobNumber. The -s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
$ qdelete QUEUE1
This example deletes queue QUEUE1. If the queue contains any executing jobs, then an error message is displayed and the queue is not deleted.
QMODIFY
The QMODIFY command modifies one or more of a queues properties.
Page 219
Syntax
qmodify [ -D string ] [ -k N ] [ -M 0NNN ] [ -s ComputerName ] [ -a hh:mm -b hh:mm | -O ] [ -h ] [ -? ] [ -m hh:mm -n hh:mm | -S ] [ -e N ] [ -j N ] [ -c | -o ] [ -t | -u ] [ -p N ] [ -C N ] [ -U ] QueueName
Options The -D option specifies a new description for the queue. The p option specifies the priority for the queue. This value may range from 0 to 255, with 0 being the lowest priority. The default is 128. The -j option specifies a new pending jobs limit for the queue. This value determines the maximum number of jobs that may be pending in the queue at one time. This value may range from 0 to 1000. The -e option specifies a new executing jobs limit for the queue. This value determines the maximum number of jobs that may be executing in the queue at one time. This value may range from 0 to 100. Typical values range from 1 to around 6 or 7. The -C option sets the Queue Affinity to processor N. If this parameter is set then jobs created from this queue will only execute on processor N on an SMP machine. The -U option resets the Queue Affinity to association with no particular processor. The -t and -u options stop or start the queue, respectively. An alternate way to stop or start a queue is to use the qstop or qstart commands. The c and -o options close or open the queue, respectively. An alternate way to close or open a queue is to use the qclose or qopen command. The O option disables Auto Open/Close. The -m and -n options specify automatic start and stop times for the queue. These options must be specified together. If they are specified, then the queue is set to automatically stop every day at the hour and minute specified by -m and starts every day at the time specified by -n. These options require 24-hour time values; for example, 6:30 means 6:30 AM, and 18:30 means 6:30 PM. The a and -b options specify automatic close and open times for the queue. These options must be specified together. Once these times are set, the queue will automatically close every day at the time specified by -a and open every day at the time specified by -b. These options require 24-hour time values; for example, 6:30 means 6:30 AM, and 18:30 means 6:30 PM. The S option disables Auto Start/Stop. The -s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. The k option is used to set the number of minutes that completed jobs are retained in the queue. The default time is 1440 minutes (24 hours).
Page 220
The M option is used to modify the permissions Mode of the Queue. The mode setting follows the UNIX permission mode model (see chmod(2)). There are read, write, and execute permissions afforded to three different classes of user: The Queue owner. Any member within the same group as the Queue owner. All others.
If a user has read permissions for a Queue, that user may list the jobs associated with the Queue. If the user has write permissions, that user may submit jobs to that Queue and delete jobs from that Queue. If the user has execute permissions, that user may open, close, stop or start that Queue. Generally the owner of a Queue has Read, Write, and Execute permissions for that Queue. Only the owner, or root, can change the permissions pertaining to a Queue. When a Queue is created default permissions are Read, Write, and Execute for the owner. Anyone else only has Read permissions (rwxrr--). Examples
$ qmodify e 5 QUEUE2
This example modifies queue NIGHTLY so that it automatically stops at 7:30 AM every day and starts at 7:00 PM every night.
$ qmodify p 50 CAD2
QOPEN
The QOPEN command opens a queue. When a queue is open, and as long as it is not full, it will accept jobs that are submitted to it. Syntax
qopen [-s ComputerName] QueueName
Options The -s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer.
Page 221
Examples
$ qopen low_pri
QREQUEUE
The QREQUEUE command moves a job from one queue to another queue. Syntax
qrequeue q QueueName [-s ComputerName] JobNumber
Options The -q option specifies which queue to requeue the job to. This option is required. The -s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
$ qrequeue q queue2 634
This example moves job number 634 from the queue that it was previously in to queue QUEUE2.
QSHOW
The QSHOW command displays information about a single queue, a single job, and all queues in the system, or all executing jobs. Syntax
qshow [ -h ] [-s ComputerName] [ -a | [-j] [-e] QueueName | [ -l ] JobNumber ]
Options The -a option displays all queues in the system. This is the default if no options are specified. The -j option can be used with a queue name to display all of the jobs in the specified queue, along with the other queue information.
Page 222
The -e option displays all jobs that are currently executing in queue. The -l option, which can be used only in conjunction with a JobNumber, displays the contents of the Log File associated with that JobNumber. The -s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
$ qshow NIGHTLY
This command displays information about the queue called NIGHTLY, and also displays a list of all jobs executing and pending in the queue.
$ qshow 642
This command displays a list of all jobs that are currently executing in queue.
$ qshow e s micron
This command displays a list of all jobs that are currently executing on server computer MICRON.
QSTART
The QSTART command starts a queue. When a queue is started, it will execute jobs that are pending in the queue. Syntax
qstart [-s ComputerName] QueueName
Page 223
Options The s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
$ qstart LOW_PRI
QSTOP
The QSTOP command stops a queue. When a queue is stopped, it will not execute jobs that are pending in the queue. Syntax
qstop [-s ComputerName] QueueName
Options The -s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
$ qstop LOW_PRI
QSUBMIT
The QSUBMIT command submits a job to a queue. The job is specified by its job file, which is either a command procedure or executable file. If this command is being used on the server computer, i.e. the computer on which the Queue Engine service is running, then the current directory is used if the directory path is not specified. If the command is being used to submit a job to a remote Queue
Page 224
Engine server computer, then the full file path, relative to the queue engine server computer, must be used. Syntax
qsubmit -q QueueName [ -p Parameter String ] [ -s ComputerName ] [-a [[[[YYYY]MM]DD]hh]mm | +hh:mm ] [-e hh:mm ] [ -P Password -U UserName ] [ -l logFileName ] [ -g ] [ -n Name ] FilePath
Options The -q option specifies the queue to submit the job to. If this option is not specified, then the job is submitted to the default queue, which is set by the system administrator with the -q option of the QSYSTEM command. The -n option specifies an alternate name for the job. If this option is not used, then the jobs name is derived from the filename of the job file. The -p option allows customers to supply parameters for the job. Parameters are used in batch files by using the special characters $1, $2, $3, etc. If customers need to specify more than one parameter for a job, then enclose the parameters in quotes and separate them with spaces. The -l option specifies an alternate name for the jobs log file. If this option is not used, then the jobs log file has the same name as the job file name. A .log is appended to the file. Also, if -g is not used, then the Queue Engine service appends the jobs job number to the log filename. The -g option instructs the Queue Engine service not to append the jobs job number to the log file filename. By default, the Queue Engine service does append the job number, as in /test/job.log.753, in order that the filenames will be unique even if the base paths and filenames are the same for two different jobs. The g only affects the behavior of the -l option. The -U option specifies the user account, which the job runs under. If this option is not specified, then the submitting users account is used. A password must be specified in order to run the job under an account other than the submitting users. The -P option specifies a password to associate with the jobs logon session when the job is executed. A password is required if the job file is located on a computer other than the Queue Engine server computer, or if the job must access network resources. The password must be correct at the time the job is started, or the job will fail to start. The -a option specifies a time after which the job may be started. The time value may be in absolute or relative time format, and various parts of the time value may be omitted. Here are some examples:
Time Value
1800
Meaning
6:00 P.M. today
Page 225
6:00 P.M. on April 3, 1994 30 minutes from now 1 hour and 30 minutes from now 2 hours from now 1 day from now 1 day and 6 hours from now
The -e option specifies a time interval at which the job is repeated. For example, if a value of 24:00 is used, then the job will be executed every 24 hours. The -s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
$ qsubmit payroll
This example submits the batch file payroll in the current directory to the current default queue. The job log file created when the job executes will be called payroll in the same directory.
$ qsubmit q NIGHTLY /cad/mandel
This example submits the executable mandel in the cad directory to queue NIGHTLY. The job log file created when the job executes will be called MANDEL.LOG.JobNumber and will also be located in the /cad directory.
$ qsubmit l /users/jonhv/PAYROLL.LOG payroll
This example submits the batch file payroll in the current directory to the current default queue. The job log file created when the job executes will be called payroll in directory /users/johnv/.
$ qsubmit -s aries /acct/payroll
This example submits the batch file payroll in directory /acct to server computer aries. Note that the job file path is relative to the server computer. This means that the file path refers to directory /acct on aries, not on the computer where this command was entered.
$ qsubmit a 18:00 work
This example submits a job called work to the default queue, to be started no sooner than 6:00 P.M. today.
Page 226
This example submits a job called work to the default queue, to be started in two hours.
$ qsubmit q SYSJOBS a 22:00 U backupacct P frodo p 12345 /jobs/backup
This example submits a backup job to start at 10:00 P.M. tonight, which will run under the user account called backupacct.
$ qsubmit q BUILDS U tomd P mom1234 -p 12345 /build/build1
This example submits a build job, which will run under the user account called tomd.
$ qsubmit p FY94.DAT /bat/get_file
This example submits a job called GET_FILE to the default queue, with a first parameter of FY94.DAT. When the batch job is executed, the string FY94.DAT will be substituted for all occurrences of the character $1 within the batch file.
QSYSTEM
The QSYSTEM command allows the system administrator to control the queue system. Most of the functions of this command are, by default, available only to Administrators who are logged in as root on the Queue Engine server computer. The examples illustrate this by using the # super user prompt where appropriate. Syntax
qsystem [ -L KBytes ] [ -q QueueName | -Q ] [ -x | -k ] [ -D AAnn-AAnn-AAnn-AAnn ] [-K AAnn-AAnn-AAnn-AAnn ] [ -l ] [ -S ] [ -f N ] [ -j N ] [ -p N ] [ -r N ] [ -s ComputerName ]
Options The -S option displays information about the Queue Engine service. This information includes the current state of the service and the filenames of the system log file and the system settings file. This is the default action if no options are specified. All options, except for the -S option, can only be executed by a user with root permissions. The -x option starts the Queue Engine service. The service must be started in order for any other the Queue Engine commands to work. When the product is first installed, the Queue Engine service may be configured to start automatically at system startup, so it is not necessary to manually start it every time the computer boots. The -k command stops the Queue Engine service. When the service is stopped, no other the Queue Engine commands will work. Stopping the Queue Engine service is a dangerous operation, because all jobs that are executing when the service is stopped are terminated.
Page 227
The l option displays installation and license information about a Queue Engine server computer. The -j option sets the maximum executing jobs value for the queue engine server. When this number of jobs is executing on the server in all queues combined, then no new jobs are started. This value may be increased or decreased depending on the amount of memory and other system resources available to the server. The -r option sets the jobs roll over value for the queue engine server. When the job number reaches the number set by this option, the job number is reset to 0. The -p option sets the maximum number of processes among all executing jobs for the queue engine server. When this number of processes exists for all executing jobs, then no new jobs are started. This value may be increased or decreased depending on the amount of memory and other system resources available to the server. Note that the actual number of job processes on a Queue Engine server may temporarily exceed this limit, because although no new jobs are started, jobs, which are already executing may create more processes. The -q option sets the default queue for the product. The default queue is the queue that jobs are submitted to if no queue name is specified in the qsubmit command. Usually, customers will want to set the default queue to a middle of the road queue, one with a moderate priority and executing jobs limit. The f option displays the Log File of the Queue Engine. If N is 0, the entire Log File is displayed. If N is greater than 0, the last N Kbytes of the Log File will be displayed. The -Q option clears the default queue. When no default queue is set, a queue name must be specified in order to submit a job. The -L option changes the size limit of the queue engine system log file. This value determines the maximum size, in kilobytes, that the system log file is allowed to reach. When the file reaches the size limit, the old one is renamed and a new one is started. By default, the queue engine system log file size limit is set to 1024K, or one megabyte. The -K option installs a new product license key. This option should only be used when a representative of Argent Software Inc gives customers a license key. The -K option executes by communicating with the Queue Engine. This is done to allow the Queue Engine to run some validity checks on the new key before it is installed. If the Queue Engine is not running because there is a license key issue, the following option can be used. The -D option installs a new product license key. This option should only be used when the -K option cannot be used. No checking of the keys validity takes place, however, if the Queue Engine cant run because it needs a new license key, this is the option to use. The -s option specifies the name of a Queue Engine server computer. If this option is absent, then the command uses the value of the TABF_SERVER environment variable, if defined. If this environment variable is also absent, then the command assumes the local computer. Examples
$ qsystem -S
Page 228
# qsystem -p
This example will cause the queue engine service to pause. When the service is paused, queues will not start any pending jobs, and the queue engine commands and the queue engine Main GUI functions will not work.
# qsystem -c
This example starts the queue engine service on the queue engine server computer named ARIES.
# qsystem -q HIGH_PRI
Page 229
W200x Facilities
The UNIX Queue Engine is a peer to the Queue Engine that runs on W200x. Besides the Command Line utilities, there are two GUI programs that run on W200x, which can be used to queue Jobs and manage Queues. These GUI programs are the Argent Job Scheduler, and the Argent Queue Engine Main GUI. The Queue Engine Main GUI is an interface designed mostly for Job and Queue management purposes. The Job Scheduler is a menu driven GUI, which provides the user with a powerful interface to create and schedule Jobs. Both of these programs are described in detail in the Argent Job Scheduler Users Guide.
W200x Administration
In order for the W200x programs to interface with the UNIX Queue Engine, the W200x programs need to know two essential pieces of information: How to contact the UNIX Queue Engine. Under whose account will a particular command or Job be executed.
Two files are used to provide this information. The file that contains the contact information necessary to connect to the UNIX Queue Engine is called Hosts.dat. The file that contains the account information used to queue and control jobs is called Users.dat.
HOSTS.DAT
The Hosts.dat file is usually located in 2 directories. There will be a Hosts.dat in the Argent\QueueEngine directory and one in the Argent\SchedulingEngine directory. The Queue Engine Main GUI and the Command Line utilities use the Hosts.dat in the QueueEngine directory. The Job Scheduler uses the Hosts.dat file located in the SchedulingEngine directory. These files may be created via Dialogue Boxes in the Queue Engine Main GUI and in the Job Scheduler. These files can also be created via a text editor. The format of the Hosts.dat is shown as follows:
#HOSTS.DAT SPECIFIES THE PORT AND SERVER TYPE FOR REMOTE QUEUE ENGINES INCLUDING #VARIOUS UNIX FLAVORS #THE COMMENT LINE WHICH STARTS WITH # AND EMPTY LINES ARE IGNORED.
Page 230
#THE FORMAT OF EACH LINE HAS THREE COLUMNS. THEY ARE SERVER, PORT AND TYPE #SEPERATED BY ONE OR MORE TAB CHARACTERS.
#SERVER PORT TYPE
Figure 0-1- Hosts.Dat Format The server name will have to be in the LMHOSTS file that is used/imported by enabling LMHOSTS lookup in the TCP/IP WINS menu1. If LMHOSTS lookup is not enabled, an IP address can be used. If customers choose to use the Program Dialogue Box, press the System menu button on the Queue Engine Main GUI or the Settings menu button on the Job Scheduler. Select Remote/UNIX Server Management. This will cause a Dialogue Box to appear (See Figure 2). The TCP/IP port 3000 is the default port that is used by the UNIX Queue Engine. If the Port Number has been modified on the UNIX side via the /etc/services file or NIS interface, the menu value will have to be adjusted accordingly.
This is found by right clicking My Network Places on the desktop and selecting Properties. Next right clicking on Local Area Connection and selecting Properties brings up the Properties menu. Select TCP/IP and hit the Properties button. Hit the Advanced button and customers can get top the WINS menu tab from there.
Page 231
Figure 0-2 - Hosts.Dat Dialogue Box To insert a new host entry, press the New button. Enter the information and then press the Save button.
USERS.DAT
The Users.dat file is usually located in 2 directories. There will be a Users.dat in the Argent\QueueEngine directory and one in the Argent\SchedulingEngine directory. The Queue Engine Main GUI and the Command Line utilities use the Users.dat in the QueueEngine directory. The Job Scheduler uses the Users.dat file located in the SchedulingEngine directory. These files may be created via Dialogue Boxes in the Queue Engine Main GUI and in the Job Scheduler. These files can also be created via a text editor. The format of the Users.dat is shown as follows:
#USERS.DAT SPECIFIES THE ACCOUNT TRANSLATION BETWEEN NT ACCOUNT AND UNIX ACCOUNT. #THE COMMENT LINE WHICH STARTS WITH # AND EMPTY LINES ARE IGNORED. #THE FORMAT OF EACH LINE HAS FOURS COLUMNS. THEY ARE NT_ACCOUNT UNIX_SERVER, #UNIX_ACCOUNT AND PASSWORD SEPERATED BY ONE OR MORE TAB CHARACTERS. #THE PASSWORD COLUMN IS NORMALLY ENCRYPTED. THE PLAIN TEXT PASSWORD CAN BE #SPECIFIED IN THE FORMAT OF #PLAIN_PASSWORD# #THE NT ACCOUNT IS SPECIFIED IN THE FORMAT OF NT_DOMAIN\NT_LOGON_USER #THE UNIX ACCOUNT IS SPECIFIED IN THE FORMAT OF DOMAIN\ACCT IF THERE IS A DOMAIN #INVOLVED
#NT_ACCOUNT UNIX_SERVER UNIX_ACCOUNT PASSWORD
dev\swr
Note: The W200x Account must contain the domain name (or server name) as well as the user account ID in order to connect properly with the UNIX Queue Engine
Page 232
The domain portion of the UNIX Account, in this case dev, is not used by the UNIX Queue Engine. The user should generate this file by using the Dialogue Box. The program interfacing with the Dialogue Box encrypts the password. The UNIX Queue Engine uses the encrypted password. Putting in a plain text password will not work with the Queue Engine. In addition, sending plain text over a network creates a potential security leak. Bringing up the Hosts.Dat Dialogue Box and then clicking on the Account menu tab opens the UNIX Account Dialogue Box.
Figure 0-4 - Users.Dat Dialogue Box To enter a new account, press the New button. Enter the information and then press the Save button.
Page 233
Available Functionality
Used in conjunction with the Argent Job Scheduler engine, the Argent iSeries Job Adapter allows customers to submit, monitor, and manage iSeries batch jobs. The Argent iSeries Job Adapter allows customers to: Submit jobs for processing Hold jobs that need special attention Release jobs that have been held Hold and release iSeries job queues Monitor each submitted job all the way through execution to completion Retrieve generated spooled file output, including job logs
Page 234
Each of these processes has a specialized role and has been developed to meet the highest standards of product quality, reliability, and security.
The Listener
The Listener process is responsible for managing the connections between an iSeries server and the Argent Job Scheduler. The Listener checks to make sure that only permitted connections are allowed to complete. It also makes sure that the TCP/IP addresses on all incoming Job Scheduler requests meet defined policy for access. When the Listener process detects a valid connection request from an Argent Job Scheduler, it hands off control to a Worker process.
The Worker
The Worker process is responsible for doing the all the iSeries work needed by an Argent Job Scheduler. The Worker process interacts directly with the iSeries operating system to manage iSeries jobs, control iSeries job queues and manage generated spooled file output. The Worker process stays connected to the Argent Job Scheduler engine for as long as needed.
Page 235
Page 236
by the Argent iSeries Job Adapter. In the case that you have difficulties connecting the Argent Job Scheduler to the Argent iSeries Job Adapter, it may be necessary to use a different port number. LOGLVL(log level) The LOGLVL parameter tells the adapter how much detail to include in the messages written to the Argent iSeries Job Adapter log file. This log file is comparable to the iSeries system history logs. The Argent iSeries Job Adapter log file contains routine messages about normal operation of the adapter as well as messages that can help identify potential problems. There are four values supported: *NONE This value limits log messages to the very fewest possible. *NORMAL This value directs the adapter to store routine messages about normal operations as well as messages about potential error conditions. *DETAILED This value directs the adapter to write extensive messages, including information about the status of internal adapter operations and important calculations and results. *VERBOSE This value directs the adapter to the most extensive messages possible. This value is typically used only on the advice of qualified Argent support personnel in problemdetermination or troubleshooting scenarios. The default value for the LOGLVL parameter is *NONE. LOGSIZ(log file size) The LOGSIZ parameter tells the adapter how large each Argent iSeries Job Adapter log file member can grow before it will be closed and a new log file member will be opened for logging. The name of the Argent iSeries Job Adapter log file is LOG and it is stored in the production installation library ARGSCHED. Each log file member within the LOG file has a member name that follows the naming convention Myymmddnnn where M is the letter M, yymmdd is the date the log file member was created, and nnn is a sequence number starting at 001 and ranging up to 999. The LOGSIZ parameter specifies the largest size of each member within log file LOG. Similar to many IBMprovided system values, the LOGSIZ parameter is expressed in bytes.
Page 237
JOBD(job description library/name) The JOBD parameter tells the adapter which job description to use to submit work for iSeries processing. The default value for this parameter is *LIBL/ARGSCHED. The default value is appropriate in most situations and should only be changed if the distributed Argent work management objects are not suitable in your iSeries IT environment. MSGQ(message queue library/name) The MSGQ parameter tells the adapter which message queue to use to send and store informational and other messages about the operations of the Argent iSeries Job Adapter. The default for this parameter is the special value *SYSOPR. *SYSOPR is interpreted by the adapter to mean message queue QSYSOPR in library QSYS. It is common for iSeries system administrators to want to route messages about a system monitoring product like the Argent iSeries Job Adapter to a message queue other than *SYSOPR. In some environments, many applications send messages to *SYSOPR, which tends to make important messages like Argents harder to find. In that case, you can use the CRTMSGQ command to create a separate message queue and then specify the message queue name and the library name of that message queue in this parameter. ALWIPADDR(list of allowed IP addresses) The ALWIPADDR parameter allows you to restrict access to the Argent iSeries Job Adapter. This parameter provides the adapter with a list of IP addresses which are allowed to connect to your Argent iSeries Job Adapter. The default for this parameter is the special value *ANY. The *ANY special value is interpreted by the adapter to mean that any Job Scheduler engine is allowed to connect to your Argent iSeries Job Adapter. *ANY is usually a good choice to get started with your new software. After the adapter has been installed and running smoothly, the system administrator for your iSeries machine should change this value to specify a list containing only the IP addresses that are authorized to connect. Up to sixteen (16) values can be specified for this parameter. If more than one value is specified, the *ANY special value is disallowed. If more than one value is specified, each value must be enclosed in single quotes separated by spaces. Additionally, you can specify generic values using the wildcard character (*). Generic values are a useful way to specify a group of IP addresses that are allowed. To specify that all the IP address in the range 192.1.16.100 through 192.1.16.199 are allowed to connect to your Argent iSeries Job Adapter, you can specify the generic value 192.1.16.1*. As with simple list element values, generic values must be enclosed in single quotes and separated by a space. Simple values and generic values can be used together as list elements for this parameter.
Page 238
Note: Using the *ANY special value or generic values containing the wildcard character can potentially reduce the security of your Argent iSeries Job Adapter. Please consult with your network administrator to be sure you have the best balance between configuration simplicity and network security. ALWHOSTS(list of allowed Job Scheduler engine hosts) The ALWHOSTS parameter allows you to restrict access to the Argent iSeries Job Adapter. This parameter provides the adapter with a list of Job Scheduler engine platform names which are allowed to connect to your Argent iSeries Job Adapter. The default for this parameter is the special value *ANY. The *ANY special value is interpreted by the adapter to mean that any Job Scheduler engine is allowed to connect to your Argent iSeries Job Adapter. *ANY is usually a good choice to get started with your new software. After the software has been installed and running smoothly, the system administrator for your iSeries machine should change this value to specify a list containing only the Job Scheduler engine hosts that are allowed to connect. Up to sixteen (16) values can be specified for this parameter. If more than one value is specified, the *ANY special value is disallowed. If more than one value is specified, each value must be enclosed in single quotes separated by spaces. LICKEY(license key) The Argent iSeries Job Adapter is a licensed software program product. A license key is needed to activate the software. The LICKEY parameter configures adapter license. If youve downloaded a trial version of the software, you use the special value DEMO to activate the software for an evaluation period of thirty (30) days. After the evaluation period, youll need to contact Argent Software to acquire a full product license key. Use the CFGARGJSA command with the LICKEY parameter to configure the license key.
Page 239
Page 240
In this example, the user supplied the LOGLVL(*VERBOSE) parameter value from the command line. When the user presses F4 to invoke the command prompter, the following display is shown:
Page 241
Notice that values supplied from the command line before pressing F4 are highlighted by the command prompter using the > character. Other values supplied from the existing configuration are not highlighted.
Page 242
Page 243
Page 244
Page 245
/* User mod flag . . . . . . . . . . . . . : *NO UM*/ /* ED*/ /********************************************************************/ PGM DCL VAR(&STRWTRS) TYPE(*CHAR) LEN(1) DCL VAR(&CTLSBSD) TYPE(*CHAR) LEN(20) DCL VAR(&CPYR) TYPE(*CHAR) LEN(90) VALUE('5722-SS1 (C) COPYRIGHTIBM CORP 1980, 2000. LICENSED MATERIAL - PROGRAM PROPERTY OF IBM') QSYS/STRSBS SBSD(QSERVER) MONMSG MSGID(CPF0000) QSYS/STRSBS SBSD(QUSRWRK) MONMSG MSGID(CPF0000) QSYS/RLSJOBQ JOBQ(QGPL/QS36MRT) MONMSG MSGID(CPF0000) QSYS/RLSJOBQ JOBQ(QGPL/QS36EVOKE) MONMSG MSGID(CPF0000) QSYS/STRCLNUP MONMSG MSGID(CPF0000) QSYS/RTVSYSVAL SYSVAL(QCTLSBSD) RTNVAR(&CTLSBSD) IF COND((&CTLSBSD *NE 'QCTL QSYS ') *AND (&CTLSBSD *NE'QCTL QGPL ')) THEN(GOTO CMDLBL(DONE)) QSYS/STRSBS SBSD(QINTER) MONMSG MSGID(CPF0000) QSYS/STRSBS SBSD(QBATCH) MONMSG MSGID(CPF0000) QSYS/STRSBS SBSD(QCMN) MONMSG MSGID(CPF0000) DONE: QSYS/STRSBS SBSD(QSPL) MONMSG MSGID(CPF0000) QSYS/RTVSYSVAL SYSVAL(QSTRPRTWTR) RTNVAR(&STRWTRS) IF COND(&STRWTRS = '0') THEN(GOTO CMDLBL(NOWTRS)) CALL PGM(QSYS/QWCSWTRS) MONMSG MSGID(CPF0000) NOWTRS: RETURN CHGVAR VAR(&CPYR) VALUE(&CPYR) ENDPGM
To modify your systems IPL start up program to automatically start the ARGSCHED subsystem, you will need to change and re-compile this program.
Page 246
NOWTRS:
Page 247
Page 248
The system will respond with an informational message confirming that the scheduler has been started. The message should look similar to the following example: Argent Job Scheduler Adapter has been submitted for processing. Note: If the scheduler is already active, the STRAGRJSA command will respond with an informational message similar to the following example: Argent Job Scheduler Adapter is not ENDED. The STRARGJSA command takes no parameters and can be issued from a command line or incorporated into a High Level Language (HLL) program such as a C/L program.
Page 249
In this example, there are two jobs active in the ARGSCHED subsystem. The first one to take note of is JSASCHED. This is the Daemon Monitor process described earlier in this document. The other job is JSAMAIN. This is the Listener process described earlier. JSASCHED, the Daemon Monitor, spends most of its time in a SIGW state. JSAMAIN, the Listener process, spends most of its time in a TIMW state. This is normal and shows that the Argent iSeries Job Adapter is active and operating normally. When a Job Scheduler engine has connected and has issued at least one request, the JSAWORK job will be present in the ARGSCHED subsystem. It will operate normally in a variety of states, depending on the exact request from the Job Scheduler engine. When the Job Scheduler engine has ceased issuing commands and has disconnected from the Argent iSeries Job Adapter, the JSAWORK job will end.
Page 250
Page 251
When the ENDARGJSA command is issued an informational message about the result of the command is issued. The message should appear similar to the example below: Argent Job Scheduler Adapter end request has been submitted. If desired, you can verify that the Argent iSeries Job Adapter has ended by using the WRKACTJOB command. The display should appear similar to the example below:
Page 252
Notice that, after a normal termination of the Argent iSeries Job Adapter, the ARGSCHED subsystem no longer contains either the JSASCHED job, the JSAMAIN job, or the JSAWORK job.
Page 253
ENDARGJSA DLYJOB DLY(5) ENDSBS ARGSCHED This line is recommended for the adapter to end normally.
Page 254
Appendix L: Job Scheduler Adapter for iSeries - Special Library List Considerations
In several places in this document, there have been references to the ADDLIBLE ARGSCHED command. Over time, many iSeries system administrators prefer making a permanent change to the system so as to avoid these extra keystrokes. Once you have implemented the Argent iSeries Job Adapter and deployed it in a production environment, you may want to consider making a permanent change to the system library list. To do this, you will need to make two changes: Change the QSYSLIBL system value to include library ARGSCHED. Change the ARGSCHED job description object in library ARGSCHED so that it takes advantage of the first change.
Page 255
Type Option 2=Change to initiate the change. The following display is shown:
Page 256
You can type the name of the ARGSCHED library on the first available line after the last one on the display as highlighted above. Once you have completed making the change, you can simply press <Enter>. A confirmation message will be shown near the bottom of the terminal display session. The message should appear similar to the example shown below:
System value QSYSLIBL changed from QSYS Press F3=EXIT to end the WRKSSYVAL command.
QSYS2
QUSRSYS ...
Page 257
Page 258
Page 259
Normal, informational messages are generated each time the Argent iSeries Job Adapter starts or ends. In addition, messages are generated when an unexpected or unusual condition occurs. This might be due to things like an unexpected disconnection by a Job Scheduler engine due to a network or system failure, for example. All messages generated by the Argent iSeries Job Adapter are clearly identifiable. All messages generated by the Argent iSeries Job Adapter have the three-letter prefix JSA and are stored in message file object JSAMSGF. Whenever you use the DSPMSG command to view the contents of a message queue, the F1=HELP key is available to display detailed information about the particular message. To use this feature of DSPMSG, simply position the display session cursor anywhere on the line desired and press F1=HELP. A display similar to the following is shown:
Page 260
Note that, in the above example, the message is clearly identifiable as a message generated by the Argent iSeries Job Adapter because it has the prefix JSA and the source of the message is clearly identified within the message text itself.
Page 261
You can use the PAGE UP and PAGE DOWN keys to scroll forward and backward through the log file. In addition, you can use the F19=LEFT and F20=RIGHT command keys to window left or right to view information not immediately visible on your terminal display session.
Page 262
Index
A Abort Job if Waiting for Keyboard Input 48 About This Document i Accessing Network Shares from Command Procedures 153 Additional Buttons of The Argent Job Scheduler 4 Advanced Pager Setup 65 Alert Definitions 57 Alert Description Window 58 Alert Macros 82 Alert Notifications 46 Archive Job List 117 Automatic Starting and Stopping of Queues 34, 138, 156 B Background Jobs 190 Backup Database 112 Backup Node 131 Bell Alerts 67 C Calendar Definition 100 Calendars 98 Calendars Window 99 Command Qualifiers 167, 202 Components of a Batch Job 20 Configuration Options 118 Connecting to Queue Engine Servers 30 CPU Affinity 129 Create Job Forecast 115 D Database 119 Defining Alert Macros 83 Defining Email Macros 80 Defining Global String Macros 95 Defining Job Sequence Macros 91 Defining Pager Macros 77 Defining Queue Macros 88 Defining User Macros 85 Definitions 14 Delete Jobs Log When Job Is Deleted 121 Discard Incomplete Record 121 Display Session Manager Registry Warning at Startup 122 Do not Monitor Job CPU Time 48 Document Conventions 167, 202 Domain Administrator Group Privileges 5 Downloading The Argent Job Scheduler 6 E Ease of Use 3 Edit Job Class Table 114 Email Alerts 59 Email Macros 79 Email Options 122 Error 1069 142 Error Handling in Command Procedures 151, 164 Every Definition 110 Every Definitions 103 Execute Manual Rollover 113 Executing Jobs Limit 138, 156 Exit Code Handling 46 F Fault Tolerance and Backup Nodes 190 File Dependency 40 Font Convention i G Global String Macros 94 Guardian Alerts 72 Guest Accounts 142 GUI Options 121 H Holiday Definitions 108 Holidays Definition 110 Home Path 119 How a Queue Engine Executes Jobs 54 How the queue engine Executes Jobs 139, 157 How to access Alert Definitions 57 How to access Calendars 98 How to access Job Classes 36 How to access Macros 74 How to access Queue Engine Servers 29
Page 263
How to access The Argent Job Scheduler Schedule 21 How to access The Argent Job Scheduler Service 17 How to access The Argent Job Schedulers Menu Items 111 How to Create a Job Class 37 How to Create a Schedule 42 How to Install The Argent Job Scheduler 7 How to Upgrade The Argent Job Scheduler 12 I Installation 5 J Job Activity 25 Job Classes 36 Job Classes List 39 Job Definition 40 Job Definition Basic Tab 40 Job Definition Dependencies 45 Job Definition Schedule Tab 42 Job Definition Servers 45 Job Exit Codes 56 Job Exit Codes 140, 158 Job Info Tab 19 Job List 127 Job List Refresh Interval 120 Job Log Files 139, 157 Job Log Files 55 Job Menu 112 Job Parameters 140, 158 Job Parameters 55 Job Processing Thread Limit 120 Job Scheduling 141, 158 Job Sequence Macros 90 Jobs in Queue Engines 138, 157 L List of Job Definitions Window 39 Log Screen Width 120 Log Size Limit 121 M Macros 74 Macros Window 75
Managing The Argent Job Scheduler Service 17 Max Executing Jobs 34 Max Pending Jobs 34 Menu Items for Administering a Queue Engine Server 35 Menu Items for Calendar Definitions 109 Menu Items for Defining Alerts 73 Menu Items for Job Sequence Macros 97 Menu Items for Monitoring Job Progress 27 Menu Items for The Argent Job Scheduler 53 Monitoring Job Progress 27 N NT Message Alerts 70 O ODBC Setup 120 On-line Help 167, 202 Overview of The Argent Job Scheduler 2 P Pager Alerts 63 Pager Macros 76 Pending Jobs Limit 138, 156 Period Definition 110 Period Definitions 106 Permissions for Startup Jobs 32 Powerful Features 3 Priority 137, 156 Protect from Everyone Full Control 48 Protect from Everyone - Read 48 Q QCANCEL 170 QCLOSE 171, 205 QCREATE 172, 206 QDELETE 174, 208 QMODIFY 175, 209 QOPEN 177, 211 QREQUEUE 178, 212 QSHOW 179, 213 QSTART 180, 214 QSTOP 181, 215 QSUBMIT 182, 216 QSYSTEM 186, 219 Queue Description 34
Page 264
Queue Engine Assigning User Rights 136 Queue Engine General Info 32 Queue Engine Properties 33 Queue Engine Queue Affinity 45 Queue Engine Queue Properties 33 Queue Engine Queue Status 33 Queue Engine Security 146, 161 Queue Engine Server General Settings 135 Queue Engine Server Log 19 Queue Engine Servers 29 Queue Engine System Configuration 147, 162 Queue Engines 137 Queue Macros 87 Queue Options 50 Queue Priority 34 Queue Properties 137, 155 Quit Without Saving Changes 112 R Refresh Time Zone Cache 112 Refreshing the Job List 25 Restore Database 112 Retain Job List Settings 122 Retain Jobs 34 Return Codes 154 Rollover 189 Rollover & Archiving 133 Run Command Alerts 68 Run SETUP.EXE 7 S Save When Leaving New or Changed Record 121 Scan Entire Network 112 Scheduler Colors 24 Scheduler Columns 26 Security 190 Security 125 Server 120 Servers Field Option 24 Service Management Window 18 Service Restart 130 Setting Up Exchange Email 61 Setting Up SMTP Mail 62 Settings Menu 118
Show Warning Message if non_UNC file name is used for job 122 Show Warning Message on Delete 121 Simple to use The Argent Job Scheduler 2 Sleep after Scheduling Cycle 120 SMTP Protocol Email Options 124 Software Requirements 5 Some Examples of Calendars 110 Start / End Date of Forecast 115 Start Service 111 Startup Jobs 142 Startup Jobs 32 Status 138, 156 Stop Service 111 Submit Jobs 112 Submitting Jobs 139, 157 Submitting Jobs 54 System Menu 111 System Options 119 System Requirements 5 T Terminology Conventions ii The Argent Job Scheduler Basics 14 The Argent Job Scheduler Features 3 The Argent Job Scheduler Log Window Options 19 The Argent Job Scheduler Scheduler 21 The Argent Job Scheduler Service Management Options 18 The Argent Job Schedulers Contribution to Data Center Management 1 The Log Size Limit 143, 159 The NT Event Log forThe Argent Job Scheduler 18 The Queue Engine 188 The Queue Engine Commands 145, 160 The Queue Engine Main GUI 144 The Queue Engine Service 142, 159 The Queue Engine System Log 143, 159 The Queue Engine, Creating Batch Files 150, 163 The Queue Engine, Predefined Environment Variables 150, 163 The Queue Engine, Working with Jobs 150, 163 The Scheduler Engine 188 Toolbar Buttons 15 Types of Alerts 20
Page 265
Types of Job Masks 23 Types of Log Entries 19 U User Macros 84 User Notification 140 Using Job Masks 23 Using Job Parameters 154, 166 Using Show Status 24 Using The Argent Job Scheduler Window 15 Using the Commands Across a Network 168, 203 Using the Date/Time Format 24 Using the Job Scheduler 111
V Verify Database 112 View Job History File 117 W Wait between Queue Engine Scans 120 Welcome to The Argent Job Scheduler 1, 155 What are Macros? 20 What is an Exit Code? 46 Why use The Argent Job Scheduler? 2 Windows Messaging Email Options 123 Write Record to NT Event Log for Stopped Jobs 49
Page 266