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

when iam reading a flat file which has 100 records through cobol program when iam reading 50th records it gets abends .. so when i run the program again it should read from 50th record .where it got abened ? how it is possible

1 Answers   Patni,


I know my query will return more than one row but I don't want cursor what should I do?

1 Answers  


What is 88 level used for ?

2 Answers  


Can a Search can be done on a table with or without Index?

0 Answers  


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

0 Answers   TCS,






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 want Display WS-VARX and WS-VARN?

3 Answers   Xansa,


Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM PERFORM PARA-X UNTIL W-NUM > 9. ------ PARA-X ADD 1 TO W-NUM How many times PARA-X is executed ?

14 Answers   Accenture, TCS,


where will we code call by content and call by reference dude pls reply soon ?

2 Answers  


Write a cobol program making use of the redefine clause.

0 Answers  


what will be the output when a)pic 9(6)value 000178 is moved to pic ***,***. b)pic 9(5) value 57397 is moved to pic $$,$$9.

5 Answers  


Define REDEFINE clause and Is it possible to have the redefine clause anywhere in the working storage section for a data name?

3 Answers  


Is it possible to mutliply a comp variable with an comp-3 variable. Will there be any error if i do it?

3 Answers   IBM, UST,


Categories