How to read records in reverse order in flat file?
I know we can do it by reading all records into an array....
Then read records in reverse order by using subscript or index
but can any body give me the exact code.
Answer Posted / muttaiah
Narayan if we use your sort card we will get records in
reverse order but along with sequence numbers in cols 81-
84. You are not trimming the seq numbers
Stp1:
SORT FIELSD=COPY
OUTREC=(1,80,SEQNUM,4,ZD)
stp2:
SORT FIELSD=(81,4,ZD,D)
Outrec=(1,80)
The output file will have the records in reverse order.
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
What are the different types of condition in cobol and write their forms.
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.
What rules are followed by the search verb.
Name some of the examples of COBOl 11?
how do you reference the printer file formats from cobol programs
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?
What is rmode(24)
In which area will you utilize 88 level items in cobol?
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
What are the different rules to perform a Search?
Why occurs cannot be used in 01 level in COBOL?
What is the difference between PIC 9.99 and 9v99 in COBOL?
Write the code implementing the perform … varying.
Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks