Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

COUNT clause

Function

For a data item described by means of the IDENTIFIED clause, the COUNT clause generates an additional elementary item which indicates whether a READ statement was able to assign a node from the XML document to the element or attribute which is described by the IDENTIFIED clause.

Format


COUNT IN data-name-1


Syntax rules

  1. The COUNT clause may only be specified for data items which also have a correct IDENTIFIED clause.

  2. data-name-1 may not be defined in the same source unit, and it must be possible to reference it uniquely without qualification.

General rules

  1. For the data description entry in which it is specified the COUNT clause generates an internal elementary item with the name data-name-1.

  2. data-name-1 has the implicit description PIC S9(9) USAGE COMP-5.

  3. If the data description entry which the COUNT clause references is subordinate to a data description entry for which the EXTERNAL clause is specified, the COUNT elementary item is also an external data item.

  4. If the data description entry which the COUNT clause references contains a GLOBAL clause or is subordinate to such a file or data description entry, data-name-1 is also a global name.

  5. After a successful read statement, data-name-1 has the value 1 if a node from the XML document was assigned to the entry which the COUNT clause references. If no node was assigned, data-name-1 has the value 0.

  6. An unsuccessful READ statement does not change the value of data-name-1.

The COUNT elementary item does not indicate the number of repetitions of an element in the XML document.