Description of the LET statement


The LET statement assigns a value to a variable.

The string that provides the value can be a literal, a variable, or concatenations of both. This string is evaluated, and the result is placed into the receiving variable. The receiving variable can be named by the contents of a variable (for example, LET &VAR_NAME = '). The receiving variable name is stored in the variable VAR_NAME.'

Arithmetic calculations require an arithmetic operator and an additional literal or variable. Multiple arithmetic conditions can be used within one LET statement. The following operands are supported:

  • Add (+)
  • Subtract (-)
  • Divide (/)
  • Multiply (*)
  • Integer division (%)
  • Remainder (~)

Use the DIMENSION parameter to determine the number of entries within a specific dimensional level of an array. The receiving variable is assigned a numeric value corresponding to the number of entries that are found. If the requested array is undefined or does not contain array data, zero is returned. Because the DIMENSION parameter uses the actual name of an array, it is not prefixed by an ampersand (&).

If a dimensional level number is not specified, the first dimension is assumed. If the first dimension is selected, the receiving variable contains the number of rows within the array. If the second dimension is selected, the returned count represents the number of columns that are associated with the first row of the array.

Use the DATATYPE parameter to determine the data type of a string expression. The receiving variable resolves to 'NUM' if the string expression is numeric (contains only numbers, with an optional operand prefix). If the string expression is not numeric, the receiving variable resolves to 'CHAR'.

Related topic



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Database Advisor for IMS 3.2