SUPPOSE I HAVE 60 CHARACTERS STING. IN THAT I WANT FIND OUT
HOW MANY TIMES 'A'(ASSUME)WILL REPEATED AND I HAVE TO
PASS 'E' IN PLACE OF 'A'ALONG THAT STRING.

Answers were Sorted based on User's Feedback



SUPPOSE I HAVE 60 CHARACTERS STING. IN THAT I WANT FIND OUT HOW MANY TIMES 'A'(ASSUME)WI..

Answer / vinodh

ASSUME WS-NAME HAS 60 CHARACTERS
INSPECT WS-NAME TALLYING WS-COUNT CHARACTER 'A'
INSPECT WS-NAME REPLACING ALL 'A' BY 'E',

Is This Answer Correct ?    17 Yes 0 No

SUPPOSE I HAVE 60 CHARACTERS STING. IN THAT I WANT FIND OUT HOW MANY TIMES 'A'(ASSUME)WI..

Answer / pandu

Thanks Vinodh

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More COBOL Interview Questions

Suppose i want to declare a binary comp fild of 7 byte .how to write?

6 Answers   IBM,


Can anyone please give the example of Inline Perform.

6 Answers   TCS,


How do you code Cobol to access a parameter that has been defined in JCL?

3 Answers  


How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.

7 Answers   CGI, TCS,


What are the divisions in a cobol program? Which one is the mandatory division among them?

1 Answers  






can i use multiple when statements in search & search all ? justify ur answer?

2 Answers  


What is the maximum data length for Numeric DataType ?

3 Answers   Cap Gemini,


How many bytes will be allocated for the following record description entries? 01 REC-A. 05 A PIC S9(4). 05 B PIC XXXBXXX. 05 C PIC ____9.99. 05 D PIC S9(5) COMP-3. 05 E PIC 9(3) COMP.

16 Answers   IBM, TCS,


What are the different ways to run a COBOL DB2 program using JCL?

2 Answers  


study the data discriptions and answer the questions given below i)01 ORDER RECORD 05 OUT-HEADER PIC X(50) 05 ITEM-COUNT PIC 99 05 OUT-ITEM PIC X(20) OCCURS 1 TO 20 DEPENDING ON ITEM-COUNT ii)01 NAME-AND-ADDRESS 05 N-AND-A-LINE OCCURES 5 05 LINE-LENGTH PIC P9 05 N-AND-A-CHAR PIC X OCCURS 1 TO 20 DEPENDING ON LINE-LENGTH iii)01 SALES-LIST 05 SALESMAN-COUNT PIC 99 05 SALES PIC 9(6) OCCURS 1 TO 100 DEPENDING ON SALESMAN-COUNT iv)01 ORDER-RECORD 05 NO-OF-BRANDS PIC 99 05 BRAND-PURCHASED OCCURS 1 TO 15 DEPENDING ON NO-OF-BRANDS which of the following is true? a.i) and iii) are valid b.i) and iv) are valid c.i) and iii) are not valid d.all are valid

4 Answers   TCS,


when iam reading a flat file which has 100 records through cobol program when iam reading 50th records it gets abends .. so when i run the program again it should read from 50th record .where it got abened ? how it is possible

1 Answers   Patni,


How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not using JCL)

9 Answers   Bank Of America,


Categories