String delimited by size in cobol example
- string and unstring in cobol
- difference between string and unstring in cobol
- unstring in cobol example
- unstring cobol syntax
Cobol concatenate string and variable!
COBOL - String Handling
String handling statements in COBOL are used to do multiple functional operations on strings. Following are the string handling statements −
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.
Unstring in cobol example
The options used for the string operations are as follows −
Tallying
Tallying option is used to count the string characters.
Syntax
Following is the syntax of Tallying option −
INSPECT input-string TALLYING output-count FOR ALL CHARACTERSThe parameters used are −
- input-string − The string whose characters are to be counted.
- output-count − Data item to hold the count of characters.
Example
IDENTIFICATION DIVISION.PROGRAM-ID. HELLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-CNT1 PIC 9(2) VALUE 0. 01 WS-CNT2 PIC 9(2) VALUE 0. 01 WS-STRING PIC X(15) VALUE 'ABCDACDADEAAAFF'.
Cobol string statement examples
PROCEDURE DIVISION. INSPECT WS-STRING TALLYING WS-CNT1 FOR CHARACTER. DISPLAY "
- unstring cobol
- unstring into table cobol