01 text-data pic x(100).
move 'xyzdbfrjjg u' to text-data.
how to find the value of last index of text-data?

Answer Posted / billyboyo

Presumably you mean the last character? Redefine the field
as OCCURS 100 PIC X. Start your subscript/index at
the "end" and work backwards to find the first non-blank
character. Careful if the whole field is blank, or if there
are no blanks.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to convert the recors form vsam file to db2 table tru file aid

2763


What is the difference between goback, stop run and exit program in cobol?

932


What is the difference between Global and External Variables?

666


What are literals?

632


Define static linking and dynamic linking.

669






What rules are followed by the search verb.

638


how do you reference the printer file formats from cobol programs

668


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

634


What are declaratives and what are their uses in cobol?

714


How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

1005


What is the problem of ordered sequential files access?

704


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.

3722


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

712


What are the pertinent COBOL

2045


What is the difference between next sentence and continue in cobol programing language?

712