Working with Variables

A Variable contains a single slice of data that can be globally defined for all JAMS Jobs. Variables are a powerful tool that can make batch processing easier and more effective. You can use them to easily change references in multiple places, such as server names or file path names.

Variables are also useful when working in multiple environments. For example, any environment-specific information can be put into Variables. The Jobs that use these Variables will then use the correct value based on the current environment.

Using Variables

  • As a default value for a Job parameter - When working with multiple Jobs that require the same parameter value, creating a default value within a Variable can greatly increase efficiencies, allowing you to modify a value in one place to make changes to all Jobs that use the Variable.
    NOTE: An encrypted Variable must be referenced by a Job Parameter. Job Parameter values can be linked to Variable values within the Parameter properties. Ensure the encrypted Variable is set as the Variable for the Parameter.

  • Directly within the Job Source - Variables can be specified in the Job Source using <<VariableName>>. When the Job runs, it replaces <<VariableName>> with the value of the Variable. If you have Variables with the same names in different folders, use the fully qualified path to the appropriate Variable. It is recommended to map the Variable to a Parameter on the Job and reference the Parameter value in Job Source. This allows you to select the References tab on the Variable and see all the Jobs/Folders that use it.

    NOTE: When using a Parameter and a Variable that have the same name, the Parameter takes precedence. To use the Variable rather than the Parameter, enter the fully qualified path to the Variable within the <<>>.
  • As an undefined parameter in a parsed Job. Parsed Jobs can use the value of a Variable. In fact, the Variable does not need to be associated with the Job, other than to include the Variable within the command file (source) where you need the Variable's value to appear.
  • In Job Dependencies. One type of Job and Sequence Dependency relies on the value of a Variable. You can quickly define Dependencies that require a specific Variable condition to execute a Job.
  • In Triggers. Triggers support both event and calendar scheduling simultaneously. You can design a Trigger to use the value of a Variable to fire Trigger actions. 
  • In your application programs and/or DCL command procedures. You can retrieve or set the value of Variables using command procedures. This can be very useful for Jobs that do not use a parsed execution method, but still need to use the value of the Variable for their process. Whether parsed or not, Jobs that have access to the JAMS command-line interface can set the value of Variables.

Variable Definitions Screen

The Variable Definitions screen lets you view, create, delete, and modify Variables. Each Variable displays the following:

  • Variable Name – The name of Variable.

  • Description – An optional description of the Variable to provide more information.

  • Data Type – The type of data the Variable will store.

  • Current Length – The character length of the Variable value.

You can add additional columns by using the Column Chooser. Right-click a column heading, and select Column Chooser.

Creating a New Variable

When you create a Variable, ensure it has the correct security options set. Variables do not inherit security settings from other JAMS objects, such as Folders. If you do not add other groups or users, only the JAMS administrators and the account that created the Variable will have access.

  1. Click Definitions from the Shortcut menu.
  2. Click the Variable Definitions tab.
  3. Click Add. A dialog is displayed.
  4. In the Folder field, select where the Variable will be saved.
  5. In the Name field, enter a unique Name for the new Variable. Note that this name will be used when referencing the Variable elsewhere in JAMS.
  6. If desired, give the Variable a description.
  7. In the DataType field, select a data type for the Variable.
  8. In the Value field, enter a default value for the Variable.
  9. Click OK. By default, the Variable Definition dialog is displayed.
  10. Click the Value tab.
  11. If needed, select the Encrypt checkbox to encrypt the Variable. See the section below for more information.
  12. Click the Security tab.
  13. Click + to add additional Active Directory groups or users to have access to the variable.
  14. Click Save and Close. The new Variable is displayed in the Variable Definitions list.

Modifying a Variable

  1. Click Definitions from the Shortcut menu.
  2. Click the Variable Definitions tab.
  3. Double-click a Variable.
  4. On the Variable tab, you can change the name.
  5. On the Value tab, you can change the value.
  6. Click Save and Close.

Encrypting a Variable Value

You can encrypt a Variable value. You can see and change the value of an encrypted Variable if you have the Decrypt permission on that Variable. To view the value, use the Display Value option on the Variable definition.

NOTE: The Encrypted checkbox cannot be cleared after you select it.

See the Using Variables section for details on using an encrypted Variable in the Job source.

  1. Click Definitions from the Shortcut menu.
  2. Click the Variable Definitions tab.
  3. Double-click a Variable.
  4. Click the Value tab.
  5. Select the Encrypt checkbox.
  6. Click Save and Close.

Deleting a Variable

Before deleting a Variable, ensure all Jobs or Folders that currently use it have been updated to remove references to it. To view where it is referenced, double-click the Variable and select the References tab.

  1. Click Definitions from the Shortcut menu.
  2. Click the Variable Definitions tab.
  3. Right-click a Variable, and select Delete.
  4. When prompted to confirm the deletion, click Yes.

Copying a Variable

  1. Click Definitions from the Shortcut menu.
  2. Click the Variable Definitions tab.
  3. Right-click a Variable, and select Copy To.
  4. Under Destination Folder, click to go to the Folder where the Variable will be saved.
  5. Double-click the Folder.
  6. In the Variable Name field, you can rename the Variable, if needed.
  7. Click Ok.

Variable Data Types

  • Text
  • Integer
  • Date
  • Time
  • DateTime (a date and time of day, such as 12/31/2015 2:00:00 PM)
  • Float (a floating point number, such as 3.0, -122.5)
  • Unknown (any data type)
  • Boolean

Variable Definition Dialog

You can modify an existing Variable by opening its Variable Definition dialog. Double-click an item in the Variable Definitions view to open the dialog. The following tabs are available:

Variable Tab

Option Description
Variable Name This property is the unique name for the Variable.
Description This optional property can provide a more complete explanation of the Variable.
Last Changed Includes the username who last modified this Variable and the date and time when this change occurred.

Value Tab

Option Description
Data Type Each Variable must be assigned a Data Type as described in the previous section: Creating a New Variable. Use the dropdown list to make a selection.
Value Enter the value of the Variable that corresponds with the selected Data Type.
Encrypt Encrypt the Variable value. After a value has been encrypted, it cannot be decrypted
Display Value View the value of an encrypted Variable. This option is available only if the user has the Decrypt and Inquire ACEs.

Security Tab

Option Description
Access Control Entries The ACE(s) set on the Variable. Each ACE is configured with a set of rights, specified below.
Security Rights
  • Change: Allows you to modify the Variable definition, if you also have Change access to Variable definitions.
  • Control: Allows you to modify the Variable’s Access Control List.
  • Decrypt: Allows you to view the value of an encrypted Variable. If this option is selected, you can use the Display Value checkbox on the Variable definition. It also enables you to use an encrypted Variable as a parameter value.
  • Delete: Allows you to delete the Variable definition, if you also have Delete access to Variable Definitions.
  • Inquire: Allows you to inquire into the Variable definition, if you have Inquire access to Variable definitions.

References Tab

Option Description
References The References tab lets you view where the Variable is referenced in JAMS.

Related Topics