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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / krishna chaitanya

cana ny one post a code for that ,

thanks in advance

krishna

Is This Answer Correct ?    0 Yes 0 No

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

Answer / kumar

By using UNSTRING Verb we can do

UNSTRING text-data DELIMITED BY ' ' INTO ws-f1 (o/p varible)

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More COBOL Interview Questions

I have a files containing both duplicate and non-duplicate records.The file is already sorted by a key.I want to determine those records that are duplicate and records that are non-duplicate.If duplicate the record is move to a duplicate file and if non-duplicate that will be move to valid file.thank you

1 Answers  


What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(10) VALUE 'ABCDEFGHIJ'. 01 WS-VARN REDEFINES WS-VARX PIC 9(5) VALUE '12345'. What will happen I am going to Display the WS-VARX and WS- VARN?

6 Answers   Xansa,


What is difference between comp & comp-4?

6 Answers  


Write a program to explain size error.

0 Answers  


Consider the following: 77 A PIC 9(10) 77 B PIC 9(10) 77 C PIC 9(19) MULTIPLY AB BY B GIVING C Which of the following is true ? (a) The execution of the above may result in size error. (b) The execution of the above will result in size error. (c) The definition of C is invalid resulting in compilation error. (d) No error will be thee and the program would proceed correctly.

4 Answers   TCS,


What is level 66 used for ?

3 Answers   TCS,


In an EVALUTE statement is the order of the WHEN clauses significant?

4 Answers  


How include time & date in the report generation in cobol programing?

2 Answers  


how to convert vsam table into DB2 table?

1 Answers   IBM, Wipro,


What is XDC ?

3 Answers   Cap Gemini, IBM,


why mainframe we use not like java as frontend oracle as backend. or not word excel.In there also huge ammount data stored.

2 Answers   TCS,


what is qualification on occurs clause?

2 Answers  


Categories