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
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 |
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 |
Answer / pradeep
INSPECT VARIABLE1 TALLYING WS-COUNT FOR CHARACTERS
| Is This Answer Correct ? | 2 Yes | 0 No |
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 |
What is COMP-1? COMP-2?
How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length
What is the difference between SEARCH and SEARCH ALL?
What is SQL Code -904 and -903 in DB2 And how to handle it?
Explain the configuration section of a cobol program with examples of syntax.
How many variables can be declared in w-s section.?
what are the error codes in cobol, db2, cics, vsam , and jcl
What is an in line perform? When would you use it? Anything else you wish to say about it.
What will happen if we generate GDG (+2) version without generating (+1) version?
WHAT IS SOC3?HOW IT CAN BE RESOLVED?
Why do we use COMP-3 variables for computation, when we know that they are non displayable fields and require additional MOVE to numeric field before we populate it in output Reports?
In EBCDIC, how would the number 1234 be stored?