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 convert the recors form vsam file to db2 table tru file aid

2759


What is the usage of comp fields in cobol?

653


what happens if parmparameter passes zero bytes to the program

1659


What are the different rules to perform a Search?

613


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

8156






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

1472


What is amode(24)?

680


How do we get current date from system with century in COBOL?

796


Can you please let me know the centre name of INS certification in Kolkata.

1713


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

706


Whats the difference between search & search ALL?

5258


How do get the result of your program directly on your pc?

1878


What is Pic 9v99 Indicates in COBOL?

722


Write a program to enter and display the names of students in a class using the occurs clause.

647


How many sections are there in data division in COBOL?

676