Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

6.2.21.2 TALLYING Phrase (Formats 1 and 3)



This phrase counts the occurrence of a specific character (alphabetic, numeric, or special character) in a data item.

identifier-2
Is the count field, and must be an elementary integer item defined without the symbol P in its PICTURE character-string.


X Identifier-2 cannot be:

  • X A DBCS item
  • X An external floating point item
    
    
You must initialize identifier-2 before execution of the INSPECT statement begins.

identifier-3 or literal-1
Is the tallying field (the item whose occurrences will be tallied).

Identifier-3 can be any of the following:

  • Elementary alphanumeric data item
  • Numeric data item with USAGE DISPLAY
  • X External floating point item
    
    
Literal-1 must be nonnumeric, and can be any figurative constant that does not begin with the word ALL. (If literal-1 is a figurative constant, it is considered to be a 1-character nonnumeric literal.)

CHARACTERS
When CHARACTERS is specified and neither the BEFORE nor AFTER phrase is specified, the count field (identifier-2) is increased by 1 for each character (including the space character) in the inspected item (identifier-1). Thus, execution of the INSPECT TALLYING statement increases the value in the count field by the number of characters in the inspected item.

ALL
When ALL is specified and neither the BEFORE nor AFTER phrase is specified, the count field (identifier-2) is increased by 1 for each non-overlapping occurrence of the tallying comparand in the inspected item (identifier-1), beginning at the leftmost character position and continuing to the rightmost.

LEADING
When LEADING is specified and neither the BEFORE nor AFTER phrase is specified, the count field (identifier-2) is increased by 1 for each contiguous non-overlapping occurrence of the tallying comparand in the inspected item (identifier-1), provided that the leftmost such occurrence is at the point where comparison began in the first comparison cycle for which the tallying comparand is eligible to participate.

FIRST (Format 3 Only)
When FIRST is specified and neither the BEFORE nor AFTER phrase is specified, the substitution field replaces the leftmost occurrence of the subject field in the inspected item (identifier-1).


Previous Topic Next Topic © Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.