Shared Functions > Daily Batch

Daily Batch

Why:

It is often necessary to run a sequence of events on a daily and/or monthly basis without user input, the Daily Batch provides this feature for GDS.

 

Where:

From any section of the Fusion Workbench, select the General > Utilities > Daily Batch command. A list of sequential lines are presented on the Daily Batch Commands window, each line represents an operating system command or call to a GDS program.

 

As you can see above, the window is split into several sections: A menu bar, a toolbar, a sequence finder and 8 columns in the detailed list. The 8 columns displayed are:

 

Column Name

Description

Errors

This displays a cross icon if the last run of the command ended in failure (the error can be viewed using the right mouse button.

Sequence

The number is a number in the range of 1->9999 and is the order that the command line will run in.

Batch Command

The description of the command line entered.

Held

This displays a hexagonal Stop sign if the command will not run with the other Daily Batch commands.

D

Daily - Ticked if the Run value is set to All, or it will show an abbreviated text value.

M

Month – This flag should be ticked if you want this command line to run at month end only.

Y

Year – This flag will be ticked for every item with its year flag ticked.

C

Company – This flag will be ticked for every item with its company flag ticked

If you open a command line you will see the following window which displays the same information as the rest of the columns in the detailed list.

 

 

Component Name

Description

Sequence Number

Here you may change the sequence number.

Description

Here you may change the Batch Command Description.

AS400 Command

This is the command that is to be run, as you would type it on the AS400 command line. You can use the special substitution value &&&&&&&&&& for a branch parameter so that the Daily Batch can call the command for each branch in turn. (e.g. “CALL PGM(THC342) PARM('W' '2008' '&&&&&&&&&&')” will print a separate WPR Daily Sales report for every branch.)

Command to execute should program fail

This is optional and can contain a command you want to run, such as an email notification command.

 

This submenu has several choices: Blank – Do not run with a Daily frequency. All – Run everyday. Alternatively, select a day of the week, Monday, Tuesday etc, when the batch is to run.

Monthly

Activate this flag if you want this command line to run at month end only.

Yearly

Activate this flag if you want this command line to run at year end only.

Company

This flag should be ticked if you want to run for the whole company, i.e. do not run for specific branches. If you do not want to run for the whole company then you may specify the required branches on the ‘Branches’ tab (see below). if you do not specify any branches and do not tick the company flag, then the Daily Batch will run the job for all non-imprest branches only. The following Batch options should not have the Company flag active:

CALL PGM(THC1126) - Not Sold Analysis
CALL PGM(GB110C) - Parts Invoice Journal
CALL PGM(SU003C) - Surcharge History Transfer
CALL PGM(TR080C1) PARM(' ' ' ' ' ' ' ') - One Page Summary Main All
CALL PGM(TR085C) - One Page summary Imprest
CALL PGM(THC536) - Aged Claim Report
CALL PGM(THC522) - Pending Claim Report
CALL PGM(THC523) - Rejected Claim Report
REPPACK PACK(DEFAULT) - Report Pack

Action to take should program fail

This has three options: Fatal - issue message to Daily Batch message queue (defined in parameter DBA 001 and DBA 002), update the Daily Batch Command file with information about the error and date and time, then dump the Daily Batch job.
Message - issue message to Daily Batch message queue (defined in parameter DBA 001 and DBA 002) with reply options Retry and Ignore.
Skip - issue message to Daily Batch message queue (defined in parameter DBA 001 and DBA 002) and run next sequential job.

 

Use the branches tab if you want to specify which branches a particular command line should run for. Select the branch in the left pane and press the “Add ->” button to move it to the right pane. Reverse the procedure with the “<- Remove” button to remove a branch from the right pane.

 

How to Create a New Daily Batch Command Line:

You must use the File menu New option or the New button  on the toolbar.

 

How to Open a Daily Batch Command Line:

Use the File menu, open option or the Open button  on the toolbar, select the “Open” item from the right mouse button’s context menu, or by double-clicking a command line.

 

How to Delete a Daily Batch Command Line:

Use the Edit menu, Delete option or the Delete button  on the toolbar, or select the Delete item from the right mouse button’s menu.

 

How to Hold a Daily Batch Command Line:

To Hold an existing command line so that it will never run unless it is released, select the “Hold” item from the right mouse button’s context menu. The “Release” item on the context menu will release a held command line.

Finally, the LastRun item on the context menu will allow you to see the details of the last time the command line was run. This is particularly useful when the Error icon is displayed in the 1st column of the detailed list.

 

How to Compile a List of Daily Batch Commands:

When selecting and entering your list of commands to run, bare in mind that most reports (except for those mentioned in this section) are designed to be run by themselves in submitted jobs only. The Daily Batch should have exclusive access to the GDS environment, so submitted jobs and the Report Pack may interfere with some of the Daily Batch commands. Because of this, any submitted jobs and calls to the Report Pack should always be at the very end of the Daily Batch list of commands.

The sequence of Daily Batch items is largely up to the user, but the following commands (if used) must be before the Month & Year end processing:

CALL PGM(TFC8994)     Select & Print Claims
CALL PGM(TR060AC)     Roll Prospecting Data
CALL PGM(THC699)       Year end obsolescence
CALL PGM(THR1170)    
Month & Year end processing

The following commands must be after the Month & Year end processing:

- All archive programs

All submitted jobs, reports and the Report Pack must be placed at the end of the list of Daily Batch commands, before or after the GDS VMACS application is re-opened.

 

How to Add a Report Pack to the Daily Batch:

The Report Pack is a list of reports especially designed to be run as a group within a package called the Report Pack. Each report pack has a unique name, but best results have always been achieved if the Report Pack that is added to the Daily Batch is named DEFAULT and that the PCK001 parameter is also set to DEFAULT.

Maintain your report pack using the Report Pack maintenance tool which is on the Fusion Workbench in the General > Reports menu. See Report Pack Group Maintenance.

The Report Pack should be called (if necessary) from within the Daily Batch using the REPPACK command. (e.g. REPPACK PACK(DEFAULT))

 

How to Run the Daily Batch from Robot:

The Daily Batch is submitted once every night, for each GDS data environment, by the Robot tool.

To create the correct entry in Robot, setup a command (using the GDS data environment’s GDS Batch job description) that calls the program Daily Batch program with no parameters (CALL THR901).  This Robot entry must REACT to the relevant GDS data environment’s nightly backup Robot entry, and no other job of any kind must run using the same data environment at the same time as the Daily Batch.

 

 

How to Diagnose Daily Batch Errors:

Any line indicated with an error check mark in the Daily Batch Commands list will have some error information stored, and this information can be viewed using the LastRun context menu option, as detailed above. More information can only be found in the job log spooled file of the Robot job.

As the Daily Batch is run within Robot, the Robot tool should make it easy to see the last few days of job logs and output produced by the Daily Batch. If the job description logging is set to the correct level, the job logs can offer a lot of information on particular errors. Use the command line “CHGJOB LOG(4 00 *SECLVL) LOGCLPGM(*YES)” at the beginning of the Daily Batch if you wish to override the job description’s logging level to the maximum possible value for only particular Daily Batch runs (e.g. month end or Fridays.)

In the event of an error being encountered which requires support from Application Delivery, please provide as much detail as possible to help with the diagnosis by completing a Support Request document.

 

Related Topics:

Report Packs, see Report Pack Group Maintenance.