Windows Job Details
The information in this section applies to defining a Windows Job. For additional information about this platform, refer to Microsoft LSAM Configuration and Operation in the Microsoft LSAM online help.
Jobs can be .exe, .com, .bat, or .cmd type files. If specifying a .com file, the command line must have the .com extension.
Windows Definition
- Job Action: Defines the run process the job uses. A job action can be Run Program, File Arrival, or Embedded Script.
- User ID: Defines the User ID assigned to the job for Windows
security authentication.
- Define "Use Service Account" if the MSLSAM is running as a Domain User. For additional information on running the MSLSAM as a Domain User, refer to Service Configuration Options in the Microsoft LSAM online help.
- Define a specific Domain User if the MSLSAM is running as the Local System. For additional information on running the MSLSAM as the Local System, refer to Service Configuration Options in the Microsoft LSAM online help.
- If the User ID does not list the Domain User, register the Domain User in the EM. For information on registering a Domain User in the Enterprise Manager (EM), refer to Setting up a New Microsoft (MS) LSAM Batch User in the Enterprise Manager online help.
Fields for Run Program
Job Priority: Defines the Windows process priority for the job. The options are Normal, High, Idle, or Real-Time.
Do not use Real-Time unless the machine can be dedicated to that single process.
Run in Command Shell: Defines whether or not to run the defined Windows command line in a command shell.
Prerun: Defines the information for a prerequisite process that runs immediately before the primary job and contains the Command Line and Working Directory information.
- If a prerun fails, the primary job does not start. Upon failure, the SAM reschedules the prerun at a user-defined interval. For information on this Prerun setting, refer to Time Settings.
- The Prerun job continues to execute at the user-defined interval until it succeeds. When a prerun job is successful, the primary job starts (provided there are no other dependencies).
(Prerun) Working Directory: Defines the working directory for the job listed in the Prerun. A working directory is a requirement for jobs needing input (e.g., .ini files) or creating output (e.g., log files).
- The maximum length of the working directory is 255 characters (or the current Windows working-directory maximum).
- The working directory supports OpCon and Windows System Variables.
- Enclose OpCon properties in double brackets to create tokens (e.g., [[property]]). - Enclose Windows System Variables in percent signs (e.g., %TEMP%).
- For OpCon or Windows System Variables, verify that the expanded text does not exceed the maximum length of the working directory.
- Operating systems Windows XP and higher support a Universal Naming Convention (UNC) pathname in the working directory.
Command Line: Defines the full path to the executable file on the LSAM machine.
- The maximum length of the command line is 255 characters (or the current Windows command-line maximum).
- The command line supports the Universal Naming Convention (UNC) standards (e.g., \\server\bin\wintst.exe).
- If a job uses a Machine Group, a wildcard (*) character should replace the computer name in the UNC pathname (e.g., \\*\bin\wintst.exe). A wildcard allows the job to run on the machine the SAM selects from the Machine Group.
- If the command line has a reference to a directory or filename that contains spaces, the directory and file name must be enclosed in double quotes (e.g., "c:\this is my directory\test.exe").
- Do not place command-line parameters within the double quotes.
- The MSLSAM automatically executes .com, .exe, .cmd, and .bat files; otherwise, the command line must specify a path to a file interpreter and must specify a path to the file itself. Another approach would be to insert the command line information in a .com, .exe, .cmd, or .bat file and execute the file normally through OpCon.
- The command line supports OpCon and Windows System Variables.
- Enclose OpCon properties in double brackets to create tokens (e.g., [[property]]). - Enclose Windows System Variables in percent signs (e.g., %TEMP%).
- For OpCon or Windows System Variables, verify that the expanded text does not exceed the maximum length of the command line.
Working Directory: Defines the working directory for the job listed in the Command Line. A working directory is a requirement for jobs needing input (e.g., .ini files) or creating output (e.g., log files).
- The maximum length of the working directory is 255 characters (or the current Windows working-directory maximum).
- The working directory supports OpCon and Windows System Variables.
- Enclose OpCon properties in double brackets to create tokens (e.g., [[property]]). - Enclose Windows System Variables in percent signs (e.g., %TEMP%).
- For OpCon or Windows System Variables, verify that the expanded text does not exceed the maximum length of the working directory.
- Operating systems Windows XP and higher support a Universal Naming Convention (UNC) pathname in the working directory.
E.C.O.F.: Defines the full path to the Exit Code Override File (E.C.O.F.). Since some jobs do not return a meaningful termination status to the operating system, SMA Technologies provides the E.C.O.F feature to help create informative feedback from jobs.
- If a job uses this feature, the value in the E.C.O.F. supersedes the job's standard termination value.
- Upon termination, the job produces the E.C.O.F. The MSLSAM reads the E.C.O.F. and compares the value in the file to the Failure Criteria (refer to below) to determine the job's final status. Refer to Microsoft LSAM Configuration and Operation in the Microsoft LSAM online help.
Basic Failure Criteria: Provides fields to define basic criteria for OpCon to determine the final status of the job. If basic criteria options do not meet the needs of the job, define the Advanced Failure Criteria instead. The Exit Codes section applies to the primary job and the Prerun Exit Codes section applies to the prerun job.
- Job Exit Codes: If any one of the criteria is TRUE at the end of
a job, the OpCon reports the job as
Failed. Up to five different failure criteria may be defined. A
failure criterion contains two parts: Operator and Exit Code
integer:
- Operator: An exit code criterion may use one of the
following operators to compare the exit code with a user-defined
value.
- EQ (equal to)
- NE (not equal to)
- LT (less than)
- GT (greater than)
- GE (greater than or equal to)
- LE (less than or equal to)
- Exit Code: Any integer (-2,147,483,648 through 2,147,483,647) to compare with the job's exit code.
- Operator: An exit code criterion may use one of the
following operators to compare the exit code with a user-defined
value.
Advanced Failure Criteria: Windows jobs can make use of the Advanced Failure Criteria feature for the job defined in the Command Line. For more information, refer to Advanced Failure Criteria.
If Advanced Failure Criteria is selected, no job-related customized log entries will be added to the Windows Event Log.
Prerun Exit Code: If the criterion is TRUE at the end of a prerun job, the OpCon reports the prerun job as Failed. After a failure, the SAM reschedules the prerun job. OpCon allows only one prerun failure criteria. The failure criterion's structure for the prerun job and for the main job is the same. (Refer to the description for Exit Codes above.)
Job Output Parsing: Provides fields to define the search criteria for analyzing job output that matches the defined characters (string) and will result in the defined exit code.
- Search Operation: Defines the type of search operation to perform.
- String to Search: Defines the parsing value string to be searched. Windows wildcard characters are supported in the string value.
- Exit Code: Defines the exit code to use if the String to Search matches the Search Operation criteria. If no matches are found, the Agent will return the Windows job exit code.
- Custom Application Log: Defines an external application log to be attached to the job output log. The external log will be searched for a matching String to Search value(s) to determine the application's exit code. Windows wildcard characters can be used to create a file naming pattern for specifying multiple application log files.
Environment Variables: Defines the environment variables for the job to use. The table lists the key=value pairs that define the variables and their associated values.
The job JobAdded-runtime-Envvar has environment variables defined as:
Run_Time=[[JI.1]]
Exit_Code=[[JI.2]]
This job can be added to the daily using an event with various values of Run_Time and Exit_Code.
[[$SCHEDULE DATE]],[[$SCHEDULE NAME]],JobAdded-runtime-Envvar,ap1,1=20;2=20,Y
[[$SCHEDULE DATE]],[[$SCHEDULE NAME]],JobAdded-runtime-Envvar,ap1,1=30;2=30,Y
[[$SCHEDULE DATE]],[[$SCHEDULE NAME]],JobAdded-runtime-Envvar,ap1,1=40;2=40,Y
-
Env Variable Name: Defines the environment variable name.
-
Env Variable Value: Defines the environment variable value. OpCon properties can be used for values.
Fields for File Arrival
- File Name: Defines the file path and name of the file to detect. The file path and name support the Universal Naming Convention (UNC) standards, and Windows wildcard characters are supported in the file name (e.g., C:\Folder\Filename?ABC*.txt).
- Sub-directory Search: Specifies whether or not to search sub-directories under the specified file path.
- File Creation Time Stamp Window, Relative to Midnight (in days,hrs,mins or a token): Defines the time frame that the program uses to watch for the arrival of the file. As best practice, SMA Technologies recommends setting the time frame to be close to the expected time of arrival (e.g., if the file is expected to arrive in the evening, set the time frame to evening hours).
- File Size Stable Duration (in secs): Defines the amount of time the file size has remained stable to indicate the file has finished arriving.
- Failure Criteria: Windows jobs can make use of the Advanced Failure Criteria feature for the job defined in the Start Image. For more information, refer to Advanced Failure Criteria.
Fields and Controls for Embedded Script
Script: Defines the embedded script to associate with the job. Refer to the Embedded Scripts concept.
- At runtime, the script and type information are used by the Agent to create a temporary script file in the location of the $FILE placeholder in the run command template. For more information, refer to Adding Script Runners in the Enterprise Manager online help.
Script Type: Displays the script type associated with the script.
Version: Defines the specific version (or revision) of the script to run for this job.
View: Displays the contents of the script when clicked.
The View button will only be enabled for embedded scripts for which the user is a member of a role with privileges to view the contents from Job Details. A user must be a member of a role with All Administrative Functions, All Function Privileges, Maintain Embedded Scripts privilege, View Embedded Script Contents privilege, or must be in the ocadm role to view the contents.
Runner: Defines the run command template for executing the script.
Run Command Template: Displays the syntax for the selected runner.
Arguments: Defines any script parameters to pass to the script at runtime.
- At runtime, the Agent will place the arguments in the location of the $ARGUMENTS placeholder. For more information, refer to Adding Script Runners in the Enterprise Manager online help.
Working Dir.: Provides the executed script a specific execution context in the same manner as with a standard Windows job.
Failure Criteria: Windows jobs can make use of the Advanced Failure Criteria feature for the job defined in the Start Image. For more information, refer to Advanced Failure Criteria.
Environment Variables: Defines the environment variables for the job to use. The table lists the key=value pairs that define the variables and their associated values.
The job JobAdded-runtime-Envvar has environment variables defined as:
Run_Time=[[JI.1]]
Exit_Code=[[JI.2]]
This job can be added to the daily using an event with various values of Run_Time and Exit_Code.
[[$SCHEDULE DATE]],[[$SCHEDULE NAME]],JobAdded-runtime-Envvar,ap1,1=20;2=20,Y
[[$SCHEDULE DATE]],[[$SCHEDULE NAME]],JobAdded-runtime-Envvar,ap1,1=30;2=30,Y
[[$SCHEDULE DATE]],[[$SCHEDULE NAME]],JobAdded-runtime-Envvar,ap1,1=40;2=40,Y
-
Env Variable Name: Defines the environment variable name.
-
Env Variable Value: Defines the environment variable value. OpCon properties can be used for values.
Windows Job Sub-Types
Windows job sub-types simplify the job definition process by displaying fields to generate the command line for programs commonly used by SMA Technologies' customers. The following job sub-types are currently supported for Windows:
- Command: File Copy
- Command: File Delete
- Command: File Move
- Command: File Rename
- Corelation
- WS_FTP Pro
Command: File Copy
This Windows sub-type is for an OpCon user who does a lot of Windows File Copies. Enterprise Manager provides a simple Job SubType screen in order to copy a file.
Basic Tab
- User Id: Defines the User ID assigned to the job for Windows security authentication.
- Source File: Defines the directory and file or files to be
copied.
- For multiple files, use wildcards.
- Destination File: Specifies the directory and/or filename for the new file(s).
Advanced Tab
In the Advanced tab, this frame contains a place to define the options for Windows File Copy.
- Verify Destination File(s): Verifies that new files are written correctly.
- Use Short Name Format: Uses short filename (if available) when copying a file.
- Copy Subdirectories: Copies directories and subdirectories, unless they are empty.
- Other Options: Used to specify additional options for the copy command. Type xcopy /? in a Windows Command prompt to see all possible options.
Command: File Delete
This Windows sub-type is for an OpCon user who does a lot of Windows File Deletes. Enterprise Manager provides a simple Job SubType screen in order to delete a file.
Basic Tab
This tab will contain the most basic options for the command.
- User Id: Defines the User ID assigned to the job for Windows security authentication.
- File To Delete: Specifies a comma separated list of one or more
files or directories.
- Wildcards may be used to delete multiple files.
- If a directory is specified, all files within the directory will be deleted.