opens

Specifies files that must be available before a job or job stream can be launched.

Syntax

opens [folder/][workstation#]"filename" [(qualifier)] [,...]

Arguments

[folder/]workstation
Specifies the name of the workstation or workstation class on which the file exists, and optionally, the name of the folder in which the workstation is defined. The default is the workstation or workstation class of the dependent job or job stream. If you use a workstation class, it must be the same as that of the job stream that includes this statement.
filename
Specifies the name of the file, inclusive of its full path, enclosed in quotation marks. You can use HCL Workload Automation parameters as part or all of the file name string. You can also use variables defined in the variable table of the workstation on which the file exists. Refer to Variable and parameter definition for additional information and examples.
qualifier
Specifies a valid test condition. In UNIX®, the qualifier is passed to a test command, which runs as root in bin/sh. However, on dynamic agents, if a no root agent installation was performed, then you must verify that the test command is available to the installation user and the test will be run as the HCL Workload Automation user (for example, the installation user).

For pools and dynamic pools, because it is not possible to know in advance on which member agent the test will run, and there is no affinity between the agent that satisfies the condition and the agent that runs the job, then a file dependency is recommended only in the case of a condition that is to be evaluated on a shared file system.

If you want to have at least one agent satisfy the condition and to run the job, see the event-driven workload automation file monitor with the TWSAction submit actions, using a variable as the workstation. See TWSAction actions in the Event-driven workload automation event and action definitions section of the HCL Workload Automation: User's Guide and Reference. See also Defining file dependencies in dynamic scheduling for more information about managing file dependencies with dynamic agents, pools, and dynamic pools.

Attention:
  • On UNIX operating systems, the list of the supported qualifiers depends on the operating system type. You can verify the supported qualifiers by running the bin/sh/test command.
  • On Windows®, the test function is performed as theHCL Workload Automation user (for example, the installation user).

The valid qualifiers are:

-d %p
True if the file exists and is a directory.
-e %p
True if the file exists.
-f %p
True if the file exists and is a regular file.
-r %p
True if the file exists and is readable.
-s %p
True if the file exists and its size is greater than zero.
-w %p
True if the file exists and is writable.
-a
Boolean operator AND.
-o
Boolean operator OR.

In both UNIX® and Windows®, the expression %p, is used to pass the value assigned to filename to the test function.

Entering (notempty) is the same as entering (-s %p). If no qualifier is specified, the default is (-f %p).

Comments

The combination of the path of the file and the qualifiers cannot exceed 145 characters, and the name of the file cannot exceed 28 characters.

Examples

The following example checks to see that file c:\users\fred\datafiles\file88 on workstation nt5 is available for read access before launching ux2#sked6:
schedule ux2#sked6 on tu opens nt5#"c:\users\fred\datafiles\file88"
The following example checks to see if three directories, /john, /mary, and /roger, exist under /users before launching job jobr2:
jobr2  opens "/users"(-d %p/john -a -d %p/mary -a -d %p/roger)
The following example checks to see if cron has created its FIFO file before launching job job6:
job6  opens "/usr/lib/cron/FIFO"(-p %p)
The following example checks to see that file d:\work\john\execit1 on workstation dev3 exists and is not empty, before running job jobt2:
jobt2  opens dev3#"d:\work\john\execit1"(notempty)
The following example checks to see that file c:\tech\checker\startf on workstation nyc exists, is not empty, and is writable, before running job job77:
job77  opens nyc#"C:\tech\checker\startf"(-s %p -a -w %p)