GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL

 Print  |  
Question:  Give example of Inspect TALLYING / BEFORE INTIAL / AFTER INITIAL. In which situation will use this in COBOL?

Answer: 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.


July 07, 2008 14:58:47 #1
 sarath_sawanth   Member Since: July 2008    Total Comments: 2 

RE: Give example of Inspect TALLYING / BEFORE INTIAL / AFTER INITIAL. In which situation will use this in COBOL?
 
Hi,

var1 = 'abc sarath pqrs sawanth xyz'  

INSPECT var1 TALLYING count1 FOR ALL 'S'
  BEFORE INITIAL 'sarath' AFTER 'sawanth'
end-inspect.

sol: count1 = 1

This is used to tally the occurance of a character or group of characters in data field.

Regards,
~SS~
     

 

Back To Question