I have two files , file1 is input file it contains
10,20,30,....,records
but i want to display the records in file 2 as reverse order
.how can we do by using jcl& cobol(dont use array)
please any one can tell me the answer

Answer Posted / abhishek

First open file-1 as:

OPEN INPUT FILE-1 REVERSED

->If REVERSED clause is specified at the time of opening a
particular file, then that file can be read in reverse
direction.

Now we can read file-1 like
READ FILE-1
INTO ws-record
NOT AT END
PERFORM PARA-1
END-READ

PARA-1
WRITE FILE-RECORD
FROM WS-RECORD
END-WRITE

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

1938


Can we redefine the field of x(200) to less than 200?

818


What kind of error is trapped by on size error option?

740


System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..

1588


Why would you use find and get rather than to obtain?

687






Difference between cobol and cobol-ii?

704


What is the difference between a binary search and a sequential search what are the pertinent cobol?

735


How do you reference the following file formats from cobol programs?

693


What is the difference between structured cobol programming and object alternativelyiented cobol?

755


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

8164


Write the code implementing the perform … varying.

646


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.

2008


What is the difference between PIC 9.99 and 9v99 in COBOL?

732


here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?

6829


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

714