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 |
where will u code file status ?
How will 128 be saved in s9 (3) comp-3 How will 12 be saved in s9 (2) comp
how to know that the file has 300 records how to acess it?
I have a seq file with different fields one field is address with pic x(50) as input in a cobol program. In address there is 'PUNE' at any different positions in the address field ( form 1 t0 50) . My requirement is select the fields with address 'PUNE' by using cobol. Please suggest
How do u initialize an array?
Difference between array and sub-script ?
The disposition parameter in the jcl is share ( DISP+SHR ) and the program opens file in extend mode what will happen?
how to move the records from file to array table. give with code example
give the examples of strings in cobol
How arrays can be defined in COBOL?
Difference between next and continue clause
I try to use some column names in my cobol progorm but these column not in db2 table ..when do i get error ..while bind time or runtime?