Give example of Inspect TALLYING / BEFORE INTIAL / AFTER INITIAL. In which situation will use this in COBOL?We have different type of Inspect verb
1.counting INSPECT.
2.replacing INSPECT.
3.combined INSPECT.
4.converting INSPECT.
Give example of any Inspect verb which you know.
INSPECT word TALLYING count FOR LEADING “L” BEFORE INITIAL “A”, count-1 FOR
LEADING “A” BEFORE INITIAL “L”.
Where word = LARGE, count = 1 and count-1 = 0.
Where word = ANALYST, count = 0 and count-1 = 1.
INSPECT word TALLYING count FOR ALL “L”, REPLACING LEADING “A” BY “E” AFTER
INITIAL “L”.
Nucleus
7830 7709–000 2–103
Where word = CALLAR, count = 2 and word = CALLER.
Where word = SALAMI, count = 1 and word = SALEMI.
Where word = LATTER, count = 1 and word = LETTER.
INSPECT word REPLACING ALL “A” BY “G” BEFORE INITIAL “X”.
Where word = ARXAX, word = GRXAX.
Where word = HANDAX, word = HGNDGX.
INSPECT word TALLYING count FOR CHARACTERS AFTER INITIAL “J” REPLACING ALL “A”
BY “B”.
Where word = ADJECTIVE, count = 6 and word = BDJECTIVE.
Where word = JACK, count = 3 and word = JBCK.
Where word = JUJMAB, count = 5 and word = JUJMBB.
INSPECT word REPLACING ALL “X” BY “Y”, “B” BY “Z”, “W” BY “Q” AFTER INITIAL
“R”.
Where word = RXXBQWY, word = RYYZQQY.
Where word = YZACDWBR, word = YZACDWZR.
Where word = RAWRXEB, word = RAQRYEZ.
INSPECT word REPLACING CHARACTERS BY “B” BEFORE INITIAL “A”.
word before: 1 2 X Z A B C D
word after: B B B B B A B C D
No comments:
Post a Comment
Please Provide your feedback here