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 15:29:46 #2
 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?
 
For Replacing:

var1 = 'abc pqrs xyz'

INSPECT var1 REPLACING CHARACTERS BY 'p'  BEFORE INITIAL 'abc' AFTER INITIAL 'xyz'
end-inspect.

Sol: var1 = 'abc pppp xyz'
     

 

Back To Question