Field variables

A field variable is a type of string variable. It holds a string, just as a string variable does, and you can use it in any context in which a string variable is valid.

However, a field variable differs from a string variable in the way in which a string is stored into the field variable. The string that a field variable contains is always a string that the macro runtime reads from a 3270 or 5250 field in the current session window. To get the macro runtime to read this string from the 3270 or 5250 field, you have to create a Variable update action that specifies:
  1. The name of the field variable (such as $fldFilename$).
  2. A location string (a string containing a pair of integers separated by a comma, such as '5,11').
When the macro runtime performs the Variable update action it takes the following steps:
  1. Looks in the session window at the row and column value specified by the location string.
  2. Finds the 3270 or 5250 field in which the row and column value is located.
  3. Reads the entire contents of the field.
  4. Stores the entire contents of the field as a string into the field variable.

For more information, see Variable update action with a field variable.