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

Answers were Sorted based on User's Feedback



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

Answer / kamal

hi Sreejith,
u r giving wrong answer previous is not available in
cobol.pls find.

Is This Answer Correct ?    10 Yes 1 No

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

Answer / raj

yes,it is possible through JCL.

1. QSAM (sequential) file. You can run it thru SORT utility
adding SEQNUM and then sort then sort by SEQNUM in DESC
order
2. VSAM: In CICS you can read backward using READREV;
3. VSAM: I Batch unload the VSAM file using SORT in DESC
order by key value.

Is This Answer Correct ?    3 Yes 0 No

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

Answer / jayant

Sorry..the answer given by me was wrong...

Is This Answer Correct ?    1 Yes 0 No

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

Answer / rakesh

you can point to last rec using start, then read using 'read
prior' statement

Is This Answer Correct ?    1 Yes 0 No

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

Answer / guest

If you are using CICS Answer:1 is correct. Orther wise we
can not read from botom to top.

Is This Answer Correct ?    2 Yes 2 No

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

Answer / jayant

WORKAROUND:Sort the file in the descending manner first
based on its key,than read it normally.

Is This Answer Correct ?    1 Yes 1 No

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

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

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

Answer / hari

Move low values to the key and then use READ PREV.

Is This Answer Correct ?    0 Yes 0 No

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

Answer / krishna

If it is a tape file,

OPEN INPUT FILEXXX REVERSED,

then the pointer is posistioned at the last record and read
next will read the prior record...

Is This Answer Correct ?    0 Yes 1 No

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

Answer / piyush mani

hi all..
store the content of file in table(array) and then
by using index of array start reading the file from bottom


giv ur feedback....

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More COBOL Interview Questions

should I use Go back in the main program ? Yes we can use Go back in main program as well.

2 Answers   Xansa,


is it possible to rename 01 level?

4 Answers  


What are ISOLATION LEVELS? Where do we need to specify them?

3 Answers   EXL,


which generation language is cobol

4 Answers   Kanbay,


if i am reading a file with some 50000 records and moving to a DB2 table and suddenly the program abends in between, is there anyway i could restart from the exact record at which the job failed once the program restarts.

2 Answers   UST,






In the JCL, how do you define the files referred to in a subroutine ?

2 Answers  


I want to remove a duplicates form a given input field using cobol program. please Any one help me out to solve this ... Thanks in Advance.

3 Answers   IBM,


How do you compile cobol program..?

1 Answers  


When search all is used in cobol program without sorted input data?

6 Answers   CGI, Principal Finance,


How can we find out wether to declare the data items like Integer, Char,Comp? If comp types how can we decide wether it is Comp and Comp3.How it is? Please Explain... Cheers.

1 Answers   Syntel,


sample code for read a 2nd record from last in flatfile how can do?

4 Answers   iNautix,


what happens when a copybook variables are declared using include statement ?

3 Answers   IBM,


Categories