Reading part of a field

When you are using a field variable in a Variable update action, you can specify a location string that contains two locations. Use this feature if you want to read only part of the contents of a field.

Type the first and second locations into the value field with a colon (:) between them. For example, if the first location is 5,14 and the second location is 5,17, then you would type '5,14:5,17'.

When you specify two locations:
  • The first location specifies the first position in the field to read from.
  • The second location specifies the last position in the field to read from.
As an example, suppose that the host terminal contains a 3270 or 5250 field with the following characteristics:
  • It begins at row 5, column 8
  • It ends at row 5, column 32
  • It contains the string 'Print VTOC information'
In addition, suppose that you set up a Variable update action with the following values:
  • In the variable name field you type the name of a field variable that you have just created, $fldData$.
  • In the value field you type a location string, '5,14:5,17'. Here you are specifying both a beginning location and an ending location within the field.
When the macro runtime performs this Variable update action, the macro runtime reads the string 'VTOC' from the field (beginning at the position specified by the first location string and continuing until the position specified by the second location string) and stores the string 'VTOC' into $fldData$.

If the second location lies beyond the end of the field, the macro runtime reads the string beginning at the first location and continuing until the end of the field. The macro runtime then stores this string into the field variable.