how can count the number of character in feild ?? suppose
for instance i have a feild with value ' rajesh sarkar'
then how can v count the number of characters whitout
spaces...........

Answers were Sorted based on User's Feedback



how can count the number of character in feild ?? suppose for instance i have a feild with value ..

Answer / vikas pujar

We can use Inspect to accomplish this.

1) Inspect ws-var tallying ws-count for all spaces.

Here number of spaces will come and sit in ws-count, by deducting it with length of variable will get number of characters.

Is This Answer Correct ?    13 Yes 1 No

how can count the number of character in feild ?? suppose for instance i have a feild with value ..

Answer / akviswa

1. Count the length of the string
2. Move the value of WS-IND to 1
2. perform until the length of the string=0
a. If string(ws-ind:1) <> spaces
Increment the counter for count
end-if
b. Decrement the length of string and increment WS-IND
end-perform

Is This Answer Correct ?    4 Yes 1 No

how can count the number of character in feild ?? suppose for instance i have a feild with value ..

Answer / pradeep

INSPECT VARIABLE1 TALLYING WS-COUNT FOR CHARACTERS

Is This Answer Correct ?    2 Yes 0 No

how can count the number of character in feild ?? suppose for instance i have a feild with value ..

Answer / dk

Declare an array with PIC X.
check for every subscript whether it is not SPACES.
Count the occurrences for non space values.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

What are INPUT PROCEDURE and OUTPUT PROCEDURE?

0 Answers  


What are the pertinent COBOL

0 Answers   IBM,


Write a cobol program making use of the redefine clause.

0 Answers  


Which of the following characters is NOT valid in column 7? a. - b. \ c. * d. # e. $

4 Answers  


i want all ERRORS codes in COBOL ,JCL,VSAM ,DB2,CICS

4 Answers   Infosys,






can i give 9(10) in comp 3 instead of s9(10) ? if i can give wht would be ths ans

2 Answers   DELL,


Can we use goto statement in inline_perform ?

5 Answers   IBM,


What is the figurative constant in cobol?

1 Answers  


why occurs clause not mentioned in 01 level

6 Answers   HCL, NIIT, TCS, Tesco,


How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

0 Answers   Infosys,


if someone is using my file,how can i find which user id is using?

4 Answers  


plz,could any one tell me? what about EBCDIC in cobol?briefly?

1 Answers  


Categories