Data specification options

Data specifications in GET and PUT statements specify the data to be transmitted.

Read syntax diagramSkip visual syntax diagram
>>-+-+------+--(-| data-list |-)----------------------+--------><
   | '-LIST-'                                         |   
   +-DATA--+--------------------------+---------------+   
   |       |    .-,--------------.    |               |   
   |       |    V                |    |               |   
   |       '-(----data-list-item-+--)-'               |   
   |       .----------------------------------------. |   
   |       V                                        | |   
   '-EDIT----(-| data-list |-)--(-| format-list |-)-+-'   

data-list

   .-,----------------------------.   
   V                              |   
|----+-data-list item-----------+-+-----------------------------|
     '-(-data-list--type-3-DO-)-'     

format-list

   .-,--------------------.   
   V                      |   
|----+-format-item------+-+-------------------------------------|
     +-n--format-item---+     
     '-n--(format-list)-'     

If a GET or PUT statement includes a data list that is not preceded by one of the keywords LIST, DATA, or EDIT, LIST is the default.

Important: In a statement without LIST, DATA, or EDIT preceding the data list, the data list must immediately follow the GET or PUT keyword. Any options required must be specified after the data list.
DATA
See Data-directed data specification.
EDIT
See Edit-directed data specification.
LIST
See List-directed data specification.
data-list item
On input, a data-list item for edit-directed and list-directed transmission can be an element, an array, or a structure variable. For a data-directed data specification, a data-list item can be an element, an array, or a structure variable. None of the names in a data-directed data list can be subscripted or locator-qualified. However, qualified (that is, structure-member) or string-overlay-defined names are allowed.

On output, a data list item for edit-directed and list-directed data specifications can be an element expression, an array expression, or a structure expression. For a data-directed data specification, a data-list item can be an element, an array, or a structure variable. It must not be locator-qualified. It can be qualified (that is, a member of a structure) or string-overlay-defined.

The data types of a data-list item can be any computational data (except for GET statements it must not have the VALUE attribute), and in PUT statements, the data type might also be POINTER. If the data type is non-computational, the contents of the item will be transmitted as if the item had been specified by applying the HEX built-in function applied to the item (and for PUT DATA, the hex value will be enclosed in quotation marks followed by a suffix of BX).

An array or structure variable in a data-list is equivalent to n items in the data list, where n is the number of element items in the array or structure. For edit-directed transmission, each element item is associated with a separate use of a data-format item.

data-list type-3-DO
The syntax for the Type 3 DO specification is described under DO statement. Data list items with Type 3 DO specifications are not allowed in data-directed data lists for GET statements.

When the last repetitive specification is completed, processing continues with the next data-list item.

Each repetitive specification must be enclosed in parentheses, as shown in the syntax diagram. If a data specification contains only a repetitive specification, two sets of outer parentheses are required, because the data list is enclosed in parentheses and the repetitive specification must have a separate set.

When repetitive specifications are nested, the rightmost DO is at the outer level of nesting. Consider the following example:
  get list (((A(I,J)
       do I = 1 to 2)
       do J = 3 to 4));

There are three sets of parentheses, in addition to the set used to delimit the subscripts. The outermost set is the set required by the data specification. The next set is that required by the outer repetitive specification. The third set of parentheses is required by the inner repetitive specification.

This statement is equivalent in function to the following nested do-groups:
  do J = 3 to 4;
     do I = 1 to 2;
       get list (A (I,J));
     end;
  end;
It assigns values to the elements of the array A in the following order:
  A(1,3), A(2,3), A(1,4), A(2,4)
format list
For a description of the format list, see Edit-directed data specification.





Published: 23 December 2018