I have two questions here.
1. How to read a flat file in reverse order?
2. How to read a VSAM KSDS file in reverse order?
In both the cases we donot know the total number of records.
Answers were Sorted based on User's Feedback
Answer / kingmanish
For the KSDS file we can set the pointer on the last record.
After that use the command READ Previous to read the
records in the reverse order.
I am not very sure about flat file. May be we can use a
turn around.
Sort the file in descending order first and then start
reading.
| Is This Answer Correct ? | 7 Yes | 6 No |
Answer / hanish
Flat file may be read in reverse order by using the following code
READ file-name into data-name REVERSED.
| Is This Answer Correct ? | 0 Yes | 3 No |
How to define a array dynamically.....
WE HAVE 2 FILES IN COBOL. ONE IS FIXED LENGTH RECORDS ANOTHER ONE IS VARIABLE LENGTH. IF I DECLEAR LRECL OF FIXED ONE AS 80 AND 2ND RECORD AS 132. WHAT WE NEED TO DECLEAR LRECL FOR THOSE 2 FILES IN JCL?
01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i need to get the miuns sign in the result?
What are the different types of condition in cobol and write their forms.
How to read records which is in sequential file in reverse order ? Exp. 1 2 3 4 5 . i want 5 4 3 2 1?please clear my doubt any one
BY seeing a program how can we say that it is static call or dynamic call
if you code move high-values to variable,can you move it into numeric variable or alphanumeric variable?
How can you get the ksds file records into your cobol program?
If a file has 1000 records.. if i have to replace the first and last characters of the file with another character. how it can be done....
how can we code index in an array of cobol pgm?
If we use GO BACK instead of STOP RUN in cobol?
Have you code any new programs in COBOL ? What is the functionality of the programs?