Creating a Watched File Rule

Complete the following procedure to create and validate a watched file rule that tests for a file name that contains a specified string:

  1. Select the Default_config file from the Configurations window.
  2. Click the Rules tab.
  3. Select the Submit Process rules tab and click New.
  4. Type a name for the rule and click OK. The sample rule in this example is named daily. The rule is added to the list of rules.
  5. Select the rule and click Edit.

    The Match criteria list (top) and the Submit Process information (bottom) display in the right pane of the GUI. These two areas must contain information as follows for the rule:

    • Match criteria list—A list of conditions that must be met before the rule is applied to the detected file or event.
    • Submit Process information—These parameters specify the Process that Sterling Connect:Direct® File Agent submits to the Sterling Connect:Direct server. This Process is submitted only when there is a match for the associated rule.
  6. Choose the first item in the Match criteria list and click Edit match. The Edit match criterion window is displayed.
  7. Click Enabled to enable the match criterion.
  8. Click the property of the file to test. Match either the name or the size of the new file. In this example, the option Name of the newly arrived file is selected.
  9. Click the Matches arrow to display the drop down list of operators. In this example, Contains is selected as the operator for the match criterion.

    Using Contains as the operator searches all subdirectories in the watched directory and matches the name of the file in the compare string in any position (beginning, end, or middle). Characters other than those specified in the compare string can be included before and after the string and an exact match is not required. See Match Criteria and Operators for details about other operators.

  10. Type the portion of the file name to detect in the Compare string field, for example, daily. Include the absolute path of the file. When the compare string is correct, click OK.
  11. Define the Process information in Submit Process information.

    In this example, the Process C:\daily.cdp is submitted to the Sterling Connect:Direct server. Specify the following Process arguments: &FAF="%FA_FILE_FOUND."

    The path and file name for the detected file is sent the symbolic variable &FAF; this variable is included in the Sterling Connect:Direct Process (c:\daily.cdp) submitted.

    Parameters allowed in the Submit Process information operate as described in the following table:

    Parameter Description  
    Alternate file name Name of an alternate file to process for this event. If you specify an alternate file name, the name of the alternate file is used instead of the file detected in a watched directory. Variables are evaluated against the alternate file name and the results of to the Process are submitted as arguments.

    For example, whe alt.txt is specified, the file q1sales.txt is detected in the watched directory c:\reports\ as a match for a rule. Although the argument string &F="%FA_FILE_FOUND." is specified as the Process arguments, the string alt.txt is sent to the Process it submits. With no alternate file name specified, c:\reports'1sales.txt is sent to the Process submitted after detection, based on the Sterling Connect:Direct File Agent variable (%FA_FILE_FOUND.).

    Process name Process to submit. On z/OS® systems, this is specified as the Member Name in DMPUBLIB. On Microsoft Windows and UNIX, this is the path and file name of the Process. Sterling Connect:Direct File Agent must have read access to the path and file on Microsoft Windows or UNIX. Type an asterisk in this field to copy the default Process name from the File Agent tab.
    Process arguments Type the Process variable and argument string to send to the Process specified by the rule. For example, type: &F="%FA_DATE." to send the current date for the detected file as the symbolic variable &F to the Process that Sterling Connect:Direct File Agent submits.

    Sterling Connect:Direct File Agent allows the variables described in z/OS Process Arguments Example . The leading percent (%) character and the ending period (.) are required for all variables. When arguments contain special characters, enclose the argument string in double quotes.

    Process Class Type the numeric class that the Process submitted to the Sterling Connect:Direct server should use for execution. This can be a value between 1-255 and is used to determine the order in which a Process is executed.
    Process Priority Type the numeric priority that the Process submitted to the Sterling Connect:Direct server should use for execution. This can be a value between 0-15 and is used to determine the order in which a Process is executed. Refer to Sterling Connect:Direct documentation for more information.
    Notification userid Type the userid to notify when the Process completes if notification is supported. If this field is blank, no user is notified.
  12. After specifying parameters, click Done under the Match criteria list.
  13. The Rules tab is displayed again, with the rule listed. Click Enabled on the right to enable the rule.
  14. Click Save.

The Refresh Configuration option is dynamic. You can select Yes or No and the changes are recognized. If you select No, restart Sterling Connect:Direct File Agent to enable the changes