VARGRAPH(length {:2 | 4})

The VARGRAPH keyword is used in a free-form definition to indicate that the item is variable-length graphic.

It must be the first keyword.

The parameter specifies the length in bytes. It can be between 1 and 8,386,550.

The parameter can be a literal or a named constant. If it is a named constant, the constant must be defined prior to the definition statement.

The second parameter is optional. It specifies the number of bytes used to store the current length of the variable-length item. See Size of the Length-Prefix for a Varying Length Item.

Each parameter can be a literal or a named constant. If it is a named constant, the constant must be defined prior to the definition statement.

In the following example
  • field cust_name is defined as a variable-length graphic field with a maximum length of 50 characters
  • field message is defined as a variable-length graphic field with a maximum length of 500 characters and a prefix size of 4 bytes.

  DCL-S cust_name VARGRAPH(50);
  DCL-S message VARGRAPH(500 : 4);

For information on defining a fixed-length graphic item, see GRAPH(length).