Select Page

Tallying and replacing data items (INSPECT)

Use the INSPECT statement to inspect characters or groups of characters in a data item and to optionally replace them.. Use the INSPECT statement to do the following tasks:. Count the number of times a specific character occurs in a data item (TALLYING phrase).; Fill a data item or selected portions of a data item with specified characters such as spaces, asterisks, or zeros (REPLACING phrase).

Sursa: www.ibm.com/support/knowledgecenter/en/SS6SG3_4.2.0/com.ibm.entcobol.doc_4.2/PGandLR/tasks/tpstr13.htm

INSPECT statement – IBM

TALLYING phrase (formats 1 and 3) This phrase counts the occurrences of a specific character or special character in a data item. When identifier-1 is a DBCS data item, DBCS characters are counted; when identifier-1 is a data item of usage national, national characters (encoding units) are counted; otherwise, alphanumeric characters (bytes) are counted.

Sursa: www.ibm.com/support/knowledgecenter/SS6SG3_5.1.1/com.ibm.cobol511.ent.doc/PGandLR/ref/rlpsinsp.html

INSPECT Statement (Tallying, Replacing, and Converting)

INSPECT Statement (Tallying, Replacing, and Converting) The INSPECT statement can be used to tally the number of occurrences of specific character strings, to replace characters by other characters, or to convert from one set of characters to another. Setting the …

Sursa: supportline.microfocus.com/Documentation/books/sx51/lhexam0a.htm

INSPECT statement in COBOL Programs – Tech Agilist

7/9/2019 · The INSPECT statement can be used to tally the number of occurrences of specific character strings, to replace characters by other characters, or to convert from one set of characters to another including UPPERCASE to LOWERCASE and vice versa. The INSPECT verb has two options, TALLYING and REPLACING. You can do one or the other or both. If both are done, the TALLYING is …

Sursa: www.techagilist.com/mainframe/cobol/inspect-statement-in-cobol-programs/

COBOL – String Handling – Tutorialspoint

Inspect. Inspect verb is used to count or replace the characters in a string. String operations can be performed on alphanumeric, numeric, or alphabetic values. Inspect operations are performed from left to right. The options used for the string operations are as follows − Tallying. Tallying option is used to count the string characters. Syntax

Sursa: www.tutorialspoint.com/cobol/cobol_string_handling.htm

COBOL String Handling — TutorialBrain

COBOL INSPECT is the used to analyze a string to either do any of these of the following: Follow @tutorial_brain. 1. TALLYING … Syntax INSPECT source-string TALLYING tallying-counter FOR ALL CHARACTERS [BEFORE INITIAL ‘XYZ’] [AFTER INITIAL ‘ABC’]

Sursa: www.tutorialbrain.com/mainframe/cobol_string_handling/