Inspect

cobol interview questions

Moderator: Moderator Group

Post Reply
kartiprasad
Member
Posts: 7
Joined: Mon Jun 23, 2014 1:45 pm

Inspect

Post by kartiprasad » Mon Jun 23, 2014 1:48 pm

Hi

Can anybody tell How to replace

'I love my country' with 'I love my India' with Inspect verb

Thanks
Raj

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Mon Jun 23, 2014 11:14 pm

Please do not post the same question on multiple forums. I have locked the other one that I found.
Regards
Nic

kartiprasad
Member
Posts: 7
Joined: Mon Jun 23, 2014 1:45 pm

Post by kartiprasad » Tue Jun 24, 2014 9:21 am

Hi Teery,

Please if you know the answer respond to my question. Why so many doubts from your end.

Consider this as Interview Question

Thanks
Raj

kartiprasad
Member
Posts: 7
Joined: Mon Jun 23, 2014 1:45 pm

Post by kartiprasad » Tue Jun 24, 2014 9:25 am

Hi Terry,

Please answer my question, I need at the earliest.

Thanks,
Raj

kartiprasad
Member
Posts: 7
Joined: Mon Jun 23, 2014 1:45 pm

Post by kartiprasad » Tue Jun 24, 2014 12:17 pm

Hi Terry,

Can you please clarify my doubt. Its an Interview question.

I want to replace string with another using Inspect verb. Below is the requirement.

'I love my country' as 'I love my India'

Tell me whether it is possible, in case of source string and target string lengths are different. If possible please reply me the answer.

Thanks,
Raj

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Jun 24, 2014 2:08 pm

COBOL does not have strings. For your simple question on INSPECT, reading the manual would have taken you a few minutes only.

kartiprasad
Member
Posts: 7
Joined: Mon Jun 23, 2014 1:45 pm

Post by kartiprasad » Tue Jun 24, 2014 4:50 pm

Hi Collins,

Thanks for your reply, while going through manuals only I found some interesting thing like 'Inspect with replacing option' this option replaces a character or group of characters right.

In our case 'country' is nothing but group of chars right, so is this possible to convert to 'India'

Please explain.

Thanks

kartiprasad
Member
Posts: 7
Joined: Mon Jun 23, 2014 1:45 pm

Post by kartiprasad » Tue Jun 24, 2014 5:05 pm

Sorry I think I should address you as William right?

Also one more query, in your above mail you have mentioned that COBOL doesn't have strings right?

But we have string and unstring concepts in COBOL right?

Can you clarify both?

Thanks
Raj

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Jun 24, 2014 8:58 pm

In COBOL we have fixed-length fields, or fields whose size is determined by a numeric value.

We do not have fields which are terminated, a field whose current length depends upon its content up to the terminator. We don't have strings.

We have STRING and UNSTRING, but so what? The values which are put together (STRING) are sourced from fixed-length fields, and the values which are separated are placed in fixed-length fields. Fixed-length (alpha or alphanumeric) fields are always space padded to the right with space when content is less than length, not ended with a terminator value.

kartiprasad
Member
Posts: 7
Joined: Mon Jun 23, 2014 1:45 pm

Post by kartiprasad » Wed Jun 25, 2014 7:14 am

Thanks William .............Now I got your answer

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others