:PUT_ATT
Use the :PUT_ATT script statement to change the value of object attribute during the generation process. Attributes defined for an object affect how the object is processed. This script statement lets you dynamically change those object attributes and assign new values when the task is generated. The new values are only valid for the current generation and are not permanently stored in the object.
Prerequisites and Context
When you dynamically change object attributes, be aware of the order in which scripts are processed in the Process pages, and the stages of execution. Changing attributes is only useful before an object is processed, and may lead to undesired outcomes if you do not consider the stages of execution.
For example, if a task is configured to be generated at runtime and a :PUT_ATT statement on the Pre-Process page sets the queue, the system checks available slots and the status of the queue before it processes the script on the Pre-Process page. The task starts in the queue that you set with the :PUT_ATT statement, but the limit of the new queue is not verified, and the task may start too early.
Syntax
:PUT_ATT Attribute = Value
Parameters
| Parameter | Description | Format | Allowed Values | Default Value |
|---|---|---|---|---|
| Attribute | Name of the attribute to change. | AE name | n.a. | n.a. |
| Value | New value to assign to the attribute. | Script literal, script variable or script function | The value that you can assign to a given attribute depends on the system environment. | n.a. |
Important Considerations
Key considerations include:
- Do not use the :PUT_ATT on the Process page of an Event object or on a Post Process page. This statement might have no effect when you use it on those pages.
- You can only change the attributes of a particular object such as the Login object with a :PUT_ATT statement if the user has write access (W) to both the old value and the new value of the attribute.
- You can only assign the start type " " to a Job that starts immediately or to a group that has already been defined. Any other specification causes an error during generation.
- You cannot use a :PUT_ATT statement to change the Agent Group. Agent Groups are resolved, and the Agent is selected, before the script is processed. You can however use the statement to select a different Agent.
- If the object is configured to generate the task at runtime, then you cannot change the start type of the object through a :PUT_ATT statement.
- Attributes can have different maximum lengths. The :PUT_ATT statement does not check the specified value. If the value exceeds the maximum allowed length of the attribute, then the value is truncated.
- The statement does not modify the contents of script variables.
- If you want to set the following attributes, you must use the :PUT_ATT statement on the Pre-Process page: ATTR_DLG, HOST, SYSLST_DB, SYSLST_FILE, SYSOUT_DB, SYSOUT_FILE, OL, OO (BS2000 Jobs).
- :PUT_ATT commands that have been defined in earlier versions of RA Agents may no longer work when attributes of RA Jobs change in new versions of the RA agents. Use object variables for field replacements instead of :PUT_ATT commands for RA specific attributes.
Note: As of version 3 of the RA_FTP and version 3 of the RA_WEBSERVICE, there are no field replacements anymore for RA attributes. In this case, you must set the attributes using :PUT_ATT.
Tip: You can use this script statement on the Process page in order to limit the maximum number of parallel runs (attribute: MAX_PARALLEL_TASKS). In this case, the limit is only checked after the script has been processed when the task is generated at runtime.
Examples
The GET_ATT script function assigns the value FA to the script variable &TYPE#. After the :PUT_ATT call, the event type is FT because the attribute FILE_STABLE belongs to the file system event. The variable &TYPE# still includes the value FA.
:SET &TYPE# = GET_ATT(EVENT_TYPE)
:PUT_ATT EVENT_CHECK_METHOD2 = "FILE_STABLE"
:PRINT &TYPE#
The following example shows how to assign a new Agent to an object:
:PUT_ATT HOST = "UNIX02"
Related Topics
- Defining the Attributes Page
- Executing Objects
- Executing Objects: Generating Task at Activation Time vs Generating Task at Runtime
- Defining the Variables Page
- PREP_PROCESS_AGENTGROUP
See also:
seealso