VMS Help  —  COBOL  PROCEDURE_DIVISION, INSPECT  3format TALLYING REPLACING
  The INSPECT statement counts or replaces occurrences of single
  characters or groups of characters in a data item.

  Format 3 -

   INSPECT src-string TALLYING

   {
   { tally-ctr FOR
   {

    {
    {            [ { BEFORE }                   ]           }      }
    { CHARACTERS [ { AFTER  } INITIAL delim-val ] ...       } ...  } ...
    { { ALL     } {
    { { LEADING } { compare-val
    {
                  [{ BEFORE }                   ]     }     }      }
                  [{ AFTER  } INITIAL delim-val ] ... } ... } ...  } ...
   REPLACING

    { CHARACTERS BY replace-char [{ BEFORE } INITIAL delim-val] ... }
    {                            [{ AFTER  }                  ]     }
    { { ALL     }                                                   } ...
    { { LEADING } { compare-val BY replace-val
    { { FIRST   }

                         [ { BEFORE } INITIAL delim-val ] ... } ... }
                         [ { AFTER  }                   ]     }     }
Additional Information: explode extract

src-string
tally-ctr
compare-val
delim-val
replace-char replace-val
Close Help