How to Set Up File Dependencies in a Tivoli Workload Scheduler for a z/OS End-to-End Environment

Note: This is publication is now archived. For reference only.

Published 07 May 2006

More options

Rate and comment

Authors: Vasfi Gucer

Abstract

In an ordinary (non end-to-end) Tivoli Workload Scheduler network (one in which the MDM is a UNIX or Windows workstation) it is possible to create a file dependency on a job or job stream. This is not possible in an end-to-end network because the controlling system is Tivoli Workload Scheduler for z/OS.
It is very common to use files as triggers or predecessors to job flows on non-mainframe systems such as UNIX servers.

Tivoli Workload Scheduler 8.2 includes TWSHOME/bin/filewatch.sh, a sample script that can be used to check for the existence of files. This Technote discusses the usage of filewatch.sh.

Contents

In an ordinary (non end-to-end) Tivoli Workload Scheduler network (one in which the MDM is a UNIX or Windows workstation) it is possible to create a file dependency on a job or job stream. This is not possible in an end-to-end network because the controlling system is Tivoli Workload Scheduler for z/OS.

It is very common to use files as triggers or predecessors to job flows on non-mainframe systems such as UNIX servers.

Tivoli Workload Scheduler 8.2 includes TWSHOME/bin/filewatch.sh, a sample script that can be used to check for the existence of files. You can configure the script to check periodically for the file, just as with a real Tivoli Workload Scheduler file dependency. By defining a job that runs filewatch.sh, you can implement a file dependency.

Here is an overview of the filewatch.sh script:

Synopsis:

filewatch.sh -kd test_options
-fl path_name
-dl deadline | -nd
-int interval
[ -rc return_code ]
[ -tsk task ]

Description:

filewatch.sh checks periodically for the existence of a file.

Arguments:

-kd The options to pass to the test command. See the man page for the test command for a list of allowed values.

-fl Path name of the file (or directory) to look for.

-dl The deadline period in seconds; cannot be used together with -nd.

-nd No deadline; cannot be used together with -dl.

-int The interval between file checks.

-rc The return code to exit with if the file is not found by the deadline.

-tsk The task to run if the file is found.

Examples:

In this example, the script checks for file /tmp/filew01 every 15 seconds indefinitely:

JOBSCR('/tws/bin/filewatch.sh -kd f -fl /tmp/filew01 -int 15 -nd')

In this example, the script checks for file /tmp/filew02 every 15 seconds for 60 seconds. If the file is not there 60 seconds after the check has started, the script will end with return code 12:

JOBSCR('/tws/bin/filewatch.sh -kd f -fl /tmp/filew02 -int 15 -dl 60 -rc 12')

Figure-1 shows how the filewatch script might be used as a predecessor to the job that will process the file being “watched.” This way you can make sure that the file to be processed is there before running the job that will process the file.

How to use filewatch.sh to set up a file dependency
Figure-1 How to use filewatch.sh to set up a file dependency

To learn more about filewatch and how to use it, read the detailed description in the comments at the top of the filewatch.sh script.


Special Notices

This material has not been submitted to any formal IBM test and is published AS IS. It has not been the subject of rigorous review. IBM assumes no responsibility for its accuracy or completeness. The use of this information or the implementation of any of these techniques is a client responsibility and depends upon the client's ability to evaluate and integrate them into the client's operational environment.

Follow IBM Redbooks

Follow IBM Redbooks