can we read records in a file from botom to top. if
possible how can we read

Answer Posted / kk

data division.
working storage section.
01 opr pic a(1).
01 arrays.
02 aaa occurs n times.
03 name attribute.
------------------
------------------
01 I pic 9(2) value 1.

procedure division.
open file
read file at end move 'n' to opt
perform para1 until opt = 'n'
perform para2 until i = 0

para1.
move filed to aaa
add i to i.
read file at end move 'n' to opt.
perform-end.

para2.
diplay aaa(I).
compute i=i-1.
perform-end.

stop run.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?

2052


What are various search techniques in cobol? Explain.

641


Write the code implementing the perform … varying.

639


How to print 10 to 1 if the input have only 10 digit number?

808


I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......

10577






What are the cobol coding sheets?

660


What is the usage of comp fields in cobol?

653


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1520


Why did you choose to work with ibm mainframe cobol programming?

627


What type of SDLC u followed? Why?

1516


What are all the divisions of a COBOL program?

660


How do you get the data to code the BMS macro?

1472


What is a report item?

737


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

743


What rules are followed by the search verb.

631