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

how to fetch the record before the last record in a cobol file( its a huge file and if the key field is not known)

5 Answers   IBM,


How to use the same COBOL program in Batch and CICS on lines? explain with an example

0 Answers   IBM,


What is the use of EVALUATE statement?

4 Answers   Tesco,


what is the basic concept of mainframe? what knowledge is needed for learn this mainframe?

4 Answers   CSE, TCS, Wipro,


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

1 Answers   Syntel,






i Want All cobol ERROR codes?

4 Answers   HCL, IBM,


hai friends ,i have HSBc exam on this sunday,my platform is Mainframe,i have 1 year exp,pls any one send me placement papers of Hsbc and technical questions on mainframe

6 Answers   Citi Bank, CitiGroup, HSBC, iNautix, Wipro,


i have a variable block which is used in my cobol program as input file having records of 4080 after compilation while runing the program im getiing file attribut mismatch and it is saying tht the record length of the file is 4084 can any one knw the answer how to reslove it ?

2 Answers  


How to declare if emp-name = AAAAA""BBB in working-storage section. After display emp-name should print like AAAAA""BB

6 Answers   Polaris,


How can we increase the size of an existing PDS to include more no. of modules. I tried the answer posted by Jagan(TSO PDS 'pds name') but did not find it working. The answer posted by kamal i know very well. Please suggest me a answer so that we don't need to delete the existing PDS and still we can change the size as well.

10 Answers  


What will happen if we try to create GDG (+2) generaton instead of (+1) generation?

1 Answers  


how will u retreive value from a table.write it with syntex. 01 ws-table 05 ws-table1 occurs 10 times. 05 ws-table2 occurs 10 times. the above is 2 dimensional array..how will u retrieve 1st element of an array

3 Answers   ADP,


Categories