Introduction

Overview

A hidden aspect of TES is its command line program. The sacmd.cmd (Windows) or sacmd.sh (Unix/Linux) program provides access to TES through the MS-DOS command prompt. The Unix version of TES uses a similar program called tesmcmd . The command line program is generally done from the Tidal Web client but you can also use the sacmd.cmd (Windows) or sacmd.sh (Unix/Linux) program on a master machine. You can automate TES job control functions by including commands in scripts or by embedding job control functions in the code running your company processes.

Installing the Command Line Program

Windows

To install the Command Line program for Windows:


Step 1 From your Enterpise Scheduler product DVD, locate and run Command Line\TIDAL Enterprise Scheduler CommandLine.msi for either 32-bit or 64-bit.

Step 2 Click Next.

The Destination Folder panel displays.

Step 3 Click Next to install to the default folder location or click Change to choose a different location.

The Ready to Install the Program panel displays.

Step 4 Click Install to begin the installation.

When the setup is complete, the Setup Completed panel displays.

Step 5 Click Finish to complete the installation.


 

Linux/Unix

To install the Command Line program from Console mode:


Step 1 Open a command prompt window by selecting from the Start menu, Programs>Command Prompt .

Step 2 Enter $ ./install.bin -i console .

Step 3 Press Enter to continue the installation.

The Choose Install Folder screen displays.

Step 4 Press Enter to select the default location.

-or-

Enter an absolute path to the appropriate location, then press Enter .

Step 5 At the IS THIS CORRECT? prompt, enter Y if the path for the install folder is correct or N if it is incorrect.

Step 6 Press Enter .

The Pre-Installation Summary screen displays.

Step 7 After reviewing the installation information, press Enter to begin the installation.

The Installing screen displays.

Step 8 When the installation is complete, press Enter to exit the installer.


 

Activating the Command Line Program

Before you can use the Command Line Program, you must connect to the Client Manager DSP.

To connect:


Step 1 Verify that the Master and Client Manager are running.

Step 2 Locate the path to the sacmd command and enter the following information:

sacmd -cmdspurl http://hostname:8080/api/tes-6.2 -user username -pass password


 

Using Job Aliases

The command-line interface to TES allows you to refer to jobs by their job ID number or the job alias. Job aliases are set automatically to the unique job ID number whenever you create a job definition. You can edit the job alias to a name of your own choosing on the Options tab in the Job Definition dialog; however, the job alias must be unique and the Job Alias field cannot be left blank. Many commands allow you to refer to a job or group using the alias name or job ID, but not the full job or group name.

Job aliases must be between one and eight characters in length. Do not use spaces in job aliases.


Note You can use the listrule command to discover the job alias, as well as other job rule data, for your jobs and job groups.


Scripts and Batch Files

The sacmd.cmd (Windows) or sacmd.sh (Unix/Linux) program includes the file command that reads commands from a file, letting you batch-process a group of commands.

You can add comments to your file by preceding the comment with two forward slashes
(//) or the sharp sign (#).
You can use spaces or tabs in front of the comment character
(// or #), but otherwise it must be the first character in a line.

Lines that contain only spaces or tabs are ignored. You can add clarity to your script or batch file by using blank lines to separate different sections of your file.

Running the Command Line from TES

The Command file can be defined in a job definition along with any necessary command parameters. Commands can be run from TES as jobs if the user:

  • is a valid Scheduler user. (A valid Scheduler user can login to the Tidal Web client. A user who is only a runtime user is not a valid Scheduler user.)
  • either uses Windows passwords

-or-

runs the agent as a user

  • has the TES access right to a particular command

Command files are defined from the Program tab of the Job Definition dialog. The command is entered in the Command field and any parameters for the command are entered in the Parameters field.

Information for accessing the DSP should precede the command line command in the Command Parameters field.

Command Modes

There are two modes for entering commands from the command line program, Single and Multiple Command.


Note Before using sacmd <command>, you can set -persist to save the given URL, user and password in an encrypted file in the user's home directory, so that next time sacmd is started, the URL, user and password will not have to be specified. For further information on command arguments, refer to the help by running sacmd -help from the bin directory of the Command Line Program home.


Single Command Mode

Using this mode, type SACmd before each command. After entering the command, you return to the MS-DOS prompt.

To enter a single command:


Step 1 Open a command prompt window by selecting Start>Programs>Accessories>Command Prompt .

Step 2 Change directories by entering the following text (if you used the default location for files during installation) after the prompt:

cd /d C:\Program Files\TIDAL\TESCmdLine\bin

Press the Enter key and your prompt becomes the following:

C:\Program Files\TIDAL\TESCmdLine\bin>

Step 3 Enter SACmd and then the command and press the Enter key. The command executes and you are returned to the prompt.

C:\Program Files\TIDAL\TESCmdLine\bin>

For example,

C:\Program Files\TIDAL\TESCmdLine\bin\>SACmd status -i 8


 

Multiple Command Mode

Using the multiple command mode, you can enter TES commands without typing SACmd each time.

To enter multiple command mode:


Step 1 Open a command prompt window by selecting Start>Programs>Accessories>Command Prompt .

Step 2 Change directories by entering the following (if you used the default location for files during installation) after the C:\> prompt:

cd /d C:\Program Files\TIDAL\TESCmdLine\bin

Press the Enter key and your prompt becomes the following:

C:\Program Files\TIDAL\TESCmdLine\bin>

Step 3 Type SACmd and press the Enter key again.

The prompt changes to SACmd> and remains SACmd> until you exit. You are now in program’s multiple command mode. You can enter TES commands without preceding them with SACmd . For example, entering a command from this mode looks like this:

SACmd>status -i 8

To exit, enter EXIT and press the Enter key.


 

Command Line Interface


Note Verify the Master and Client Manager are up and running before using the Command Line program.



Note Before using sacmd <command>, you can set -persist to save the given URL, user and password in an encrypted file in the user's home directory, so that next time saCmd is started, the URL, user and password will not have to be specified. For further information on on command arguments, refer to the help by running sacmd -help from the bin directory of the Command Line Program home.



Note Once you have entered a SACmd session, you can enter help for an understanding of available commands. For example, SACmd>help.


To start the TES command line interface, enter SACmd at an MSDOS command prompt.

The general format for using SACmd is as follows:

SACmd command -option1 Argument1 -option2 “Argument 2”

where you provide the command, the options and the arguments. For example:

SACmd addrule -n alfa -G

where addrule is the command, n and G are options, alfa is the argument for n , and G has no argument.

Command Line Syntax

Command syntax is listed for each command.

  • Any argument not enclosed in brackets is required.
  • When options are enclosed in square brackets, that is, [and], they are optional and not required.
  • If options are separated with a vertical bar, that is, |, either one or the other option must be used.

The argument for an option may be required or optional, depending on the command. If you do use an argument, it must follow the option it belongs to.

Options and arguments are case sensitive, but the command is not. If an argument has a space, enclose the argument in quotes. For example,

SACmd addrule -G -a clock -h “Windows Agent”

In the above example, “Windows Agent” is the argument to the -h option. Windows Agent was enclosed in quotes because it contains a space.

The order of the arguments is usually not important. If arguments do need to be given in a specific order, it is stated in the text.


Warning Always enclose arguments containing spaces in quotes, or the command will not execute successfully. For example, if the Program Files folder is included in a path statement as an argument, the entire path must be enclosed by quotes.


Text Conventions

Each listed command may have several sections to explain different aspects of the command.

  • Syntax – Displays how to enter the command. The syntax section uses certain punctuation conventions to denote characteristics of the command options as explained in the prior Command Line Syntax section.
  • Options – Explains each parameter for the command.
  • Operation – Amplifies aspects of command behavior that may not be readily apparent.
  • Examples – Displays some ways to use the command.

Job Status ID Cross Reference

Usually, when specifying job status in a command, you either specify the job status itself, or you specify its job status ID. For example:

SACmd jobset -i 3245 -s “Completed Abnormally”


Caution When specifying the job status, any status containing two or more words must be in quotes. All arguments including spaces must be enclosed in quotes, or your command will not execute successfully.

It may be easier to specify a job status using a numerical value when you know the status that the numerical value corresponds to. For example, the above command can be typed as:

SACmd jobset -i 3245 -s 103

The following table cross-references each job status as shown in the Tidal Web client with their internal job status number. You can also obtain this information using the liststat command.

Table 1-1 Job Status

Job Status

Job Status ID

Scheduled

0

Waiting on Dependencies

1

Waiting on Operator

2

Held

3

Timed Out for Day

5

Agent Unavailable

7

Agent Disabled

8

Agent Outage

9

Waiting on Group

10

Waiting on Children

11

Cancel Pending

12

Waiting on Resource

49

 

(Continued)

Launched

50

Active

51

Stopped

52

Deferred

53

Error Occurred

66

Completed Normally (Gathering Output)

97

Completed Abnormally (Gathering Output)

98

Externally Defined (Gathering Output)

99

Completed

100

Completed Normally

101

Completed Abnormally

103

Skipped

104

Orphaned

105

Aborted

106

Externally Defined

107

Timed Out

108

Cancelled

109

Preorphan

110

Cancelled Normally

112

Command Summary

The following tables list all the available commands and their description:

Commands to Control the Master

 

Table 1-2 Available Commands

Command Name

Description

compile

Compiles the production schedule.

status

Displays the master’s status.

resume

Resumes the production schedule after being paused.

 

(Continued)

pause

Pauses the production schedule. No waiting jobs will run, even if their dependencies are met.

jobadd

Inserts a job with the specified job rule jobid into the production schedule.

Note that this command refers to the ID of the job rule and not to the ID of the job occurrence, as in the other commands.

jobcancel

Cancels or aborts the job with the specified jobid .

jobremove

Removes a job from the production schedule.

jobhold

Holds a waiting job or stops an active job with the specified jobid .

jobgo

Overrides the dependencies of the job with the specified jobid , and immediately runs the job.

jobrelease

Releases a job that is in the Waiting on Operator status, or resumes a job that has been waiting or has Stopped .

jobrerun

Reruns the specified jobid .

jobset

Sets the completion status of the specified job.

submit

Inserts the specified job into production.

Commands to Control Individual Job Occurrences

Table 1-3 Available Commands

Command Name

Description

grpupd

Updates inherit attributes for jobs in the specified group. You can obtain the group's job run ID by using the jobmon command.

jobadd

Inserts a job with the specified job rule jobid into the production schedule.

Note that this command refers to the ID of the job rule and not to the ID of the job occurrence, as in the other commands.

jobcancel

Cancels or aborts the job with the specified jobid .

jobremove

Removes a job from the production schedule.

jobhold

Holds a waiting job or stops an active job with the specified jobid .

jobgo

Overrides the dependencies of the job with the specified jobid , and immediately runs the job.

jobmod

Modifies a job occurrence. You can obtain the job run ID by using the jobmon command.

jobrelease

Releases a job that is in the Waiting on Operator status, or resumes a job that has been waiting or has Stopped .

jobrerun

Reruns the specified jobid .

jobset

Sets the completion status of the specified job.

submit

Inserts the specified job into production.

Viewing the Production Schedule

Table 1-4 Available Commands

Command Name

Description

jobmon

Provides a list of all job occurrences and their job ID in the database for the specified day.

Commands to Control Dependencies

Table 1-5 Available Commands

Command Name

Description

jobdep

Displays all file or job dependencies for a job or job group.

depdel

Deletes job and file dependencies.

depadd

Adds job and file dependencies.

Viewing the Production Schedule

Table 1-6 Available Commands

Command Name

Description

listrule

Lists all job and job group rules in the database.

Commands to Define Job and Job Group Definitions

Table 1-7 Available Commands

Command Name

Description

submit

Submits a job or group definition into the production schedule.

modrule

Modifies a job rule created with addrule .

delrule

Deletes a job or job group definition (job rule).

inactrule

Inactivates a job or job group definition.

addrule

Adds a job or job group to the database.

liststat

Lists all statuses and their corresponding numbers for input into commands.

calendar

Lists all calendars in the database.

alerts

Lists all the alerts presently in the production schedule.

alertset

Manually sets the status of an alert.

varset

Manually sets the value of a pre-existing variable.

hosts

Lists all the available TES hosts on the network.

Command for Batch Processing

Table 1-8 Available Commands

Command Name

Description

file

Runs a batch of commands listed in an input ascii file.

Help

Table 1-9 Available Commands

Command Name

Description

help

Invokes the help text.